Skip to content

[Linux][SDL3 Cursor] Default/action/attack cursors are not loaded and fallback to OS pointer #128

Description

@fbraz3

Summary

On Linux, the mouse cursors for default/selection, action, and attack are not shown using the game cursor assets and instead fallback to the operating system pointer.

Important note: other cursor states (e.g., capture/hover-over-unit) appear to work correctly.

Impact

  • Degraded gameplay UX (incorrect visual feedback for critical commands).
  • Tactical cursor states (action/attack) are not clearly represented.

Relevant Code Areas

  • SDL3 animated cursor pipeline:
    • GeneralsMD/Code/GameEngineDevice/Source/SDL3Device/GameClient/SDL3Mouse.cpp
    • Generals/Code/GameEngineDevice/Source/SDL3Device/GameClient/SDL3Mouse.cpp
  • Cursor resource load + fallback path:
    • SDL3Mouse::initCursorResources
    • SDL3Mouse::loadCursorFromFile
    • SDL3Mouse::setCursor
  • Initialization entry point:
    • GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp

Technical Context

  • Current code falls back to SDL/OS default cursor when a specific cursor is unavailable.
  • There are MissingCursor asserts/logs in cursor resource loading.
  • Recent SDL3 cursor-pipeline changes (including SDL_CreateAnimatedCursor) may be relevant.

Initial Hypotheses

  1. Path or case-sensitivity mismatch on Linux for a subset of ANI files (default/action/attack).
  2. Selective ANI parse/load failures for those cursor types causing fallback in setCursor.
  3. Visibility/current-cursor state transitions forcing fallback to NORMAL or OS cursor.
  4. Assets exist, but invalid hotspot/frame metadata causes SDL_CreateAnimatedCursor failure for those specific cursors.

Reproduction Steps

  1. Start a Linux match.
  2. Check neutral/default selection cursor state.
  3. Enter action context (move/command) and attack context.
  4. Compare with capture/hover-over-unit states (currently working).

Expected Result

Game-specific default/action/attack cursors should render on Linux, without fallback to OS pointer.

Current Result

Default/action/attack cursor states fallback to OS pointer; other cursor states still work.

Investigation Checklist

  • Log each resourcePath in initCursorResources for affected cursor types.
  • Verify file existence and exact case in Data/Cursors at Linux runtime.
  • Log loadCursorFromFile and SDL_CreateAnimatedCursor failures by cursor type.
  • Validate setCursor receives the expected enums for default/action/attack.
  • Compare working cursor assets/naming (capture/hover) versus failing ones.

Acceptance Criteria

  • Game default cursor is shown on Linux.
  • Game action cursor is shown on Linux.
  • Game attack cursor is shown on Linux.
  • No regression in already-working cursor states (capture/hover).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions