From 3951407b68bd9b0ff4e486c64c0271ff58d80c51 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 5 Apr 2023 07:16:19 +1000 Subject: [PATCH] - Fix issue with memset calls from 0eba341ac131f22dfc96d336511779461b1cb5c5. --- source/common/platform/posix/cocoa/i_joystick.cpp | 2 +- source/common/platform/posix/sdl/i_joystick.cpp | 2 +- source/common/platform/win32/i_input.cpp | 2 +- source/core/mainloop.cpp | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/common/platform/posix/cocoa/i_joystick.cpp b/source/common/platform/posix/cocoa/i_joystick.cpp index 6de2396c0..8d9e80127 100644 --- a/source/common/platform/posix/cocoa/i_joystick.cpp +++ b/source/common/platform/posix/cocoa/i_joystick.cpp @@ -1202,7 +1202,7 @@ void I_GetJoysticks(TArray& sticks) void I_GetAxes(float axes[NUM_JOYAXIS]) { - memset(axes, 0, sizeof(axes)); + memset(axes, 0, sizeof(float) * NUM_JOYAXIS); if (use_joystick && NULL != s_joystickManager) { diff --git a/source/common/platform/posix/sdl/i_joystick.cpp b/source/common/platform/posix/sdl/i_joystick.cpp index 8f2474065..f3c30e8e8 100644 --- a/source/common/platform/posix/sdl/i_joystick.cpp +++ b/source/common/platform/posix/sdl/i_joystick.cpp @@ -324,7 +324,7 @@ void I_GetJoysticks(TArray &sticks) void I_GetAxes(float axes[NUM_JOYAXIS]) { - memset(axes, 0, sizeof(axes)); + memset(axes, 0, sizeof(float) * NUM_JOYAXIS); if (use_joystick && JoystickManager) { diff --git a/source/common/platform/win32/i_input.cpp b/source/common/platform/win32/i_input.cpp index 496ee57aa..8263d3dc6 100644 --- a/source/common/platform/win32/i_input.cpp +++ b/source/common/platform/win32/i_input.cpp @@ -635,7 +635,7 @@ void I_StartFrame () void I_GetAxes(float axes[NUM_JOYAXIS]) { - memset(axes, 0, sizeof(axes)); + memset(axes, 0, sizeof(float) * NUM_JOYAXIS); if (use_joystick) { diff --git a/source/core/mainloop.cpp b/source/core/mainloop.cpp index 5ebfd0cbf..6302cbb87 100644 --- a/source/core/mainloop.cpp +++ b/source/core/mainloop.cpp @@ -436,11 +436,6 @@ void Display() screen->BeginFrame(); screen->SetSceneRenderTarget(gl_ssao != 0); //updateModelInterpolation(); - if (!SyncInput()) - { - I_GetEvent(); - gameInput.getInput(inputScale); - } gi->Render(); DrawFullscreenBlends(); drawMapTitle(); @@ -608,6 +603,11 @@ void TryRunTics (void) gi->Predict(myconnectindex); #endif } + if (!SyncInput()) + { + I_GetEvent(); + gameInput.getInput(inputScale); + } return; }