Skip to content

Commit db3a35e

Browse files
akien-mgaslouken
authored andcommitted
joystick: Fix MSVC errors C2099 with /fp:strict
1 parent 9ed83e7 commit db3a35e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/joystick/hidapi/SDL_hidapi_ps4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,8 +1003,8 @@ static bool HIDAPI_DriverPS4_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device
10031003

10041004
static void HIDAPI_DriverPS4_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS4_Context *ctx, PS4StatePacket_t *packet, int size)
10051005
{
1006-
static const float TOUCHPAD_SCALEX = 1.0f / 1920;
1007-
static const float TOUCHPAD_SCALEY = 1.0f / 920; // This is noted as being 944 resolution, but 920 feels better
1006+
static const float TOUCHPAD_SCALEX = 5.20833333e-4f; // 1.0f / 1920
1007+
static const float TOUCHPAD_SCALEY = 1.08695652e-3f; // 1.0f / 920 // This is noted as being 944 resolution, but 920 feels better
10081008
Sint16 axis;
10091009
bool touchpad_down;
10101010
int touchpad_x, touchpad_y;

src/joystick/hidapi/SDL_hidapi_ps5.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,8 +1355,8 @@ static void HIDAPI_DriverPS5_HandleStatePacketCommon(SDL_Joystick *joystick, SDL
13551355

13561356
static void HIDAPI_DriverPS5_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS5_Context *ctx, PS5StatePacket_t *packet, Uint64 timestamp)
13571357
{
1358-
static const float TOUCHPAD_SCALEX = 1.0f / 1920;
1359-
static const float TOUCHPAD_SCALEY = 1.0f / 1070;
1358+
static const float TOUCHPAD_SCALEX = 5.20833333e-4f; // 1.0f / 1920
1359+
static const float TOUCHPAD_SCALEY = 9.34579439e-4f; // 1.0f / 1070
13601360
bool touchpad_down;
13611361
int touchpad_x, touchpad_y;
13621362

@@ -1406,8 +1406,8 @@ static void HIDAPI_DriverPS5_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_d
14061406

14071407
static void HIDAPI_DriverPS5_HandleStatePacketAlt(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS5_Context *ctx, PS5StatePacketAlt_t *packet, Uint64 timestamp)
14081408
{
1409-
static const float TOUCHPAD_SCALEX = 1.0f / 1920;
1410-
static const float TOUCHPAD_SCALEY = 1.0f / 1070;
1409+
static const float TOUCHPAD_SCALEX = 5.20833333e-4f; // 1.0f / 1920
1410+
static const float TOUCHPAD_SCALEY = 9.34579439e-4f; // 1.0f / 1070
14111411
bool touchpad_down;
14121412
int touchpad_x, touchpad_y;
14131413

0 commit comments

Comments
 (0)