~zbigniew-chyla/widelands/use-sdl-color-cursor

  • Committer: Zbigniew Chyla
  • Date: 2018-09-06 13:03:36 UTC
  • Revision ID: zbigniew.chyla@gmail.com-20180906130336-5ch3yabz1n6o0nfv
Use color SDL cursor if possible (with fallback to old approach)

Currently Widelands paints mouse cursor manually which is bad for user
experience - at 25 FPS the cursor lags behind the actual mouse position
and the user gets impression that there's "something wrong" with the
mouse.

SDL since v2 supports color cursors (SDL_CreateColorCursor) so we can
paint our custom (color) hand using SDL cursor.

Use SDL cursor in WLApplication by:
 - creating SDL_Cursor for both states (normal/clicked) on startup,
 - switching between cursors on button up/down events.
To avoid regressions on systems/setups that don't support our color
cursors keep the old code as a fallback, i.e. if SDL_CreateColorCursor
fails, disable SDL cursor and paint cursor manually.
Filename Latest Rev Last Changed Committer Comment Size
..
Aquila.wmf 8063.2.1 7 years ago Holger Rapp Add test case of a really old map. Diff
expedition.wmf 6689.1.12 10 years ago Holger Rapp Intermediate commit: Added a regression test for e Diff
lua_persistence.wmf 6689.1.1 10 years ago Holger Rapp First unfinished version of a regression test suit Diff
lua_testsuite.wmf 6689.1.1 10 years ago Holger Rapp First unfinished version of a regression test suit Diff
market_trading.wmf 8452.1.2 6 years ago Holger Rapp Add a test that a market can be build and make it Diff
plain.wmf 6992 9 years ago Holger Rapp Fixed parsing of duration in animation programs. Diff
port_space.wmf 7801.1.2 8 years ago Holger Rapp - Only allow building a port if all fields can be Diff
ship_transportation.wmf 6820.2.8 10 years ago Holger Rapp Some renaming of tests and speed up one test. Diff
two_ponds.wmf 8477.2.1 6 years ago GunChleoc Split new function cleanup_portspaces() from allow Diff