Skip to content

Commit c63ea1c

Browse files
committed
Merge branch 'main' of github.com:fbraz3/GeneralsX into thesuperhackers-sync-06-19-2026
2 parents 71f3b67 + 2737e4d commit c63ea1c

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

  • GeneralsMD/Code/GameEngineDevice/Source/SDL3Device/GameClient
  • Generals/Code/GameEngineDevice/Source/SDL3Device/GameClient

Generals/Code/GameEngineDevice/Source/SDL3Device/GameClient/SDL3Mouse.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,13 @@ void SDL3Mouse::translateWheelEvent(const SDL_MouseWheelEvent& event, MouseIO *r
812812

813813
// SDL3 wheel: positive = up/away, negative = down/toward user
814814
// Multiply by MOUSE_WHEEL_DELTA (120) to match Windows behavior
815-
result->wheelPos = (Int)(event.y * MOUSE_WHEEL_DELTA);
815+
// GeneralsX @bugfix msmesoft 17/06/2026 macOS "natural scrolling" makes SDL
816+
// flag the wheel values as SDL_MOUSEWHEEL_FLIPPED; invert them so the in-game
817+
// scroll direction matches the Windows convention regardless of the OS setting.
818+
float wheelY = event.y;
819+
if (event.direction == SDL_MOUSEWHEEL_FLIPPED)
820+
wheelY = -wheelY;
821+
result->wheelPos = (Int)(wheelY * MOUSE_WHEEL_DELTA);
816822

817823
result->leftState = MBS_None;
818824
result->rightState = MBS_None;

GeneralsMD/Code/GameEngineDevice/Source/SDL3Device/GameClient/SDL3Mouse.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,13 @@ void SDL3Mouse::translateWheelEvent(const SDL_MouseWheelEvent& event, MouseIO *r
812812

813813
// SDL3 wheel: positive = up/away, negative = down/toward user
814814
// Multiply by MOUSE_WHEEL_DELTA (120) to match Windows behavior
815-
result->wheelPos = (Int)(event.y * MOUSE_WHEEL_DELTA);
815+
// GeneralsX @bugfix msmesoft 17/06/2026 macOS "natural scrolling" makes SDL
816+
// flag the wheel values as SDL_MOUSEWHEEL_FLIPPED; invert them so the in-game
817+
// scroll direction matches the Windows convention regardless of the OS setting.
818+
float wheelY = event.y;
819+
if (event.direction == SDL_MOUSEWHEEL_FLIPPED)
820+
wheelY = -wheelY;
821+
result->wheelPos = (Int)(wheelY * MOUSE_WHEEL_DELTA);
816822

817823
result->leftState = MBS_None;
818824
result->rightState = MBS_None;

0 commit comments

Comments
 (0)