mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-14 10:09:32 +01:00
libretro: Replace std::clamp() with clamp()
This commit is contained in:
2 files changed
+5
-2
No files matched your search
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
template <typename T>
|
||||
static T clamp(T f, T low, T high);
|
||||
uint32_t whiteAlpha(float alpha);
|
||||
uint32_t blackAlpha(float alpha);
|
||||
uint32_t colorAlpha(uint32_t color, float alpha);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <mutex>
|
||||
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/Data/Color/RGBAUtil.h"
|
||||
#include "Common/Log.h"
|
||||
#include "Common/LogManager.h"
|
||||
#include "Common/System/Display.h"
|
||||
@@ -1430,8 +1431,8 @@ static void retro_input(void)
|
||||
}
|
||||
|
||||
float mappedNorm = norm;
|
||||
x_left = std::clamp(x_left / norm * mappedNorm, -1.0f, 1.0f);
|
||||
y_left = std::clamp(y_left / norm * mappedNorm, -1.0f, 1.0f);
|
||||
x_left = clamp(x_left / norm * mappedNorm, -1.0f, 1.0f);
|
||||
y_left = clamp(y_left / norm * mappedNorm, -1.0f, 1.0f);
|
||||
|
||||
__CtrlSetAnalogXY(CTRL_STICK_LEFT, x_left, y_left);
|
||||
__CtrlSetAnalogXY(CTRL_STICK_RIGHT, x_right, y_right);
|
||||
|
||||
Reference in new issue
Block a user