Skip to content

fix(input): resolve SDL3Mouse ODR violation causing dropped clicks#232

Closed
fbraz3 wants to merge 2 commits into
mainfrom
fix/issue-231-sdl3mouse-odr-violation
Closed

fix(input): resolve SDL3Mouse ODR violation causing dropped clicks#232
fbraz3 wants to merge 2 commits into
mainfrom
fix/issue-231-sdl3mouse-odr-violation

Conversation

@fbraz3

@fbraz3 fbraz3 commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Description

Fixes #231

Changes

  • Add missing #include "PreRTS.h" in SDL3Mouse.cpp for both Generals and Zero Hour to resolve an ODR violation regarding the DUMP_PERF_STATS macro, ensuring the SubsystemInterface layout is correctly sized so the virtual update() dispatch executes.

fbraz3 added 2 commits July 21, 2026 22:38
The previous attempt to include PreRTS.h caused build failures on macOS
because PreRTS.h is not available in the GameEngineDevice include paths.
Instead, we include Common/GameCommon.h which brings in the
DUMP_PERF_STATS macro, successfully aligning the memory layout of
SubsystemInterface without breaking the build.
@costin-alupului

Copy link
Copy Markdown

Thanks for digging into this @fbraz3 — the ODR violation is a real find and worth fixing on its own.

I built this branch (fix/issue-231-sdl3mouse-odr-violation, confirmed the GameCommon.h include is compiled into the SDL3Mouse.cpp object) on top of current main and tested on macOS 26 / M4 Max / native arm64. Unfortunately it does not change the #231 behavior — same as before the fix:

  • Drag-box selection rectangle still draws with a visible delay (~1s of dragging before it appears).
  • Moving units still cannot be reliably clicked — a moving dozer misses on the trailing edge (the unit vacates the clicked spot before the click resolves).
  • Stationary-unit selection still works (with the same delay), and control-group hotkeys are still instant.

So the ODR fix is good to land as its own correctness fix, but #231 is not resolved by it.

Worth noting re: the "dropped clicks" framing — from testing, clicks are not actually dropped: stationary units always select. The user-visible issue is a consistent delay between the mouse click and when the game acts on it; moving units only appear to drop because they move off the clicked spot during that delay. Critically, keyboard input has no such delay (control groups select instantly), which points at something specific to the mouse-event path rather than the shared message/logic pipeline. Full problem definition is in the updated #231 body.

Happy to test any follow-up.

@fbraz3 fbraz3 closed this Jul 24, 2026
@fbraz3
fbraz3 deleted the fix/issue-231-sdl3mouse-odr-violation branch July 24, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[macOS] Mouse input is delayed (keyboard is instant) — moving units unselectable, drag-box draws late

2 participants