[Commits] [wesnoth/wesnoth] 5e4df2: Add a SDL2 compatibility wrapper.

GitHub noreply at github.com
Fri Mar 7 19:54:58 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 5e4df21fc649ccaf3319d2b10581de7f12d8fb65
      https://github.com/wesnoth/wesnoth/commit/5e4df21fc649ccaf3319d2b10581de7f12d8fb65
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-02-22 (Sat, 22 Feb 2014)

  Changed paths:
    M src/gui/auxiliary/event/dispatcher.hpp
    A src/sdl/compat.hpp
    M src/sdl_utils.hpp
    M src/tests/utils/fake_event_source.hpp

  Log Message:
  -----------
  Add a SDL2 compatibility wrapper.

This wrapper takes care of the renaming of some types done in SDL2. This
allows better compatibility between SDL 1.2 and 2.0 code.


  Commit: 255170017062f3772319661a5d0157e69b23721e
      https://github.com/wesnoth/wesnoth/commit/255170017062f3772319661a5d0157e69b23721e
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-02-22 (Sat, 22 Feb 2014)

  Changed paths:
    M src/sdl_utils.cpp
    M src/sdl_utils.hpp

  Log Message:
  -----------
  Rename a function parameter unused -> alpha.

The new name is more appropriate.


  Commit: 3d6b6b4945937b2963ca585b3f612892e3d44fe9
      https://github.com/wesnoth/wesnoth/commit/3d6b6b4945937b2963ca585b3f612892e3d44fe9
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-02-22 (Sat, 22 Feb 2014)

  Changed paths:
    M src/font.hpp
    M src/image_modifications.cpp
    M src/map_label.cpp
    M src/sdl_utils.cpp
    M src/tests/test_image_modifications.cpp

  Log Message:
  -----------
  Add a fix for the renamed field in SDL2.

The unused field in SDL_Color has been renamed to a.


  Commit: 2628c62122c1c29859c659f771dfdf18187f681a
      https://github.com/wesnoth/wesnoth/commit/2628c62122c1c29859c659f771dfdf18187f681a
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-02-23 (Sun, 23 Feb 2014)

  Changed paths:
    M src/sdl_utils.cpp

  Log Message:
  -----------
  Port sdl_keysym_from_name for SDL2 usage.

Use the SDL2 function SDL_GetKeyFromName.


  Commit: 131327d7edc47f083925004acb5a89bcee3033c0
      https://github.com/wesnoth/wesnoth/commit/131327d7edc47f083925004acb5a89bcee3033c0
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-02-23 (Sun, 23 Feb 2014)

  Changed paths:
    M src/CMakeLists.txt
    M src/SConscript
    M src/about.cpp
    M src/attack_prediction_display.cpp
    M src/editor/palette/tristate_button.cpp
    M src/font.cpp
    M src/image_modifications.cpp
    A src/sdl/alpha.cpp
    A src/sdl/alpha.hpp
    M src/sdl_utils.cpp

  Log Message:
  -----------
  Add a wrapper for SDL_SetAlpha when using SDL2.

The code is only compile-tested. Since there are more compilation issues
the code has not been tested at run-time.


  Commit: fd55e62c3e3b7dd48bf82b96be084d8949c1f746
      https://github.com/wesnoth/wesnoth/commit/fd55e62c3e3b7dd48bf82b96be084d8949c1f746
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-02-23 (Sun, 23 Feb 2014)

  Changed paths:
    M src/events.cpp
    M src/gui/auxiliary/event/handler.cpp
    M src/loadscreen.cpp

  Log Message:
  -----------
  Fix a several event handling loops.

Several events which were normal events in SDL1.2 have been moved as
subevents of the SDL_WINDOWEVENT in SDL2.0.


  Commit: b3c9db388ac925da04d5131a72fbfad981e933d4
      https://github.com/wesnoth/wesnoth/commit/b3c9db388ac925da04d5131a72fbfad981e933d4
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-01 (Sat, 01 Mar 2014)

  Changed paths:
    M src/sdl_utils.cpp

  Log Message:
  -----------
  Port SDL_SetPalette for SDL2 usage.


  Commit: e9475a351089c672fa10b7bff7854e6decb71627
      https://github.com/wesnoth/wesnoth/commit/e9475a351089c672fa10b7bff7854e6decb71627
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-01 (Sat, 01 Mar 2014)

  Changed paths:
    M src/key.cpp
    M src/sdl/compat.hpp

  Log Message:
  -----------
  Port SDL_GetKeyState for SDL2 usage.


  Commit: b400cc812fa7beee00f8cabb63e2858dfb835258
      https://github.com/wesnoth/wesnoth/commit/b400cc812fa7beee00f8cabb63e2858dfb835258
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-01 (Sat, 01 Mar 2014)

  Changed paths:
    M src/CMakeLists.txt
    M src/SConscript

  Log Message:
  -----------
  Fix linker issues with SDL2.

The compatiblity file sdl/alpha.cpp is now linked properly in CMake,
Scons has not been tested yet.


  Commit: 818656008479d3914d2c1f4b4587b3b461027259
      https://github.com/wesnoth/wesnoth/commit/818656008479d3914d2c1f4b4587b3b461027259
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-01 (Sat, 01 Mar 2014)

  Changed paths:
    M src/events.cpp

  Log Message:
  -----------
  Disable UNICODE setting for SDL2.

The calls for setting UNICODE are no longer used in SDL2.


  Commit: 687c186ac944b71ee07f612043e48f4afd2a22b7
      https://github.com/wesnoth/wesnoth/commit/687c186ac944b71ee07f612043e48f4afd2a22b7
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-01 (Sat, 01 Mar 2014)

  Changed paths:
    M src/events.cpp

  Log Message:
  -----------
  Remove the SDL_EnableKeyRepeat call for SDL2.

The function is no longer available.


  Commit: adac10f47736d5497fe0c1ec137e5d1f825fd604
      https://github.com/wesnoth/wesnoth/commit/adac10f47736d5497fe0c1ec137e5d1f825fd604
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-01 (Sat, 01 Mar 2014)

  Changed paths:
    M src/key.hpp

  Log Message:
  -----------
  Change a type to be SDL2 compatible.


  Commit: 9d8201e224a7cded0255ec63acf1057cff7fe66d
      https://github.com/wesnoth/wesnoth/commit/9d8201e224a7cded0255ec63acf1057cff7fe66d
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-01 (Sat, 01 Mar 2014)

  Changed paths:
    M src/gui/auxiliary/event/handler.cpp
    M src/hotkey/hotkey_item.cpp
    M src/hotkey/hotkey_preferences_display.cpp
    M src/tests/utils/fake_event_source.cpp

  Log Message:
  -----------
  Avoid using the unicode field in SDL2.

The unicode field in the SDL_keysym no longer exists in SDL2. Use the
scancode field instead. This needs to be evaluated later.


  Commit: c2c3029bb41ecf98faeef2353f9214434d72b656
      https://github.com/wesnoth/wesnoth/commit/c2c3029bb41ecf98faeef2353f9214434d72b656
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-01 (Sat, 01 Mar 2014)

  Changed paths:
    M src/sdl/compat.hpp

  Log Message:
  -----------
  Add a work-around for the META rename in SDL2.

Several foo_META constants have been renamed to foo_GUI in SDL2.


  Commit: 0bff213becdd0c55518a28edcf9962aef71c0b6f
      https://github.com/wesnoth/wesnoth/commit/0bff213becdd0c55518a28edcf9962aef71c0b6f
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-01 (Sat, 01 Mar 2014)

  Changed paths:
    M src/sdl/compat.hpp

  Log Message:
  -----------
  Add a SDL_FULLSCREEN work-around for SDL2.


  Commit: 8a079ba48838bd2314e056714345171db0e0ce0c
      https://github.com/wesnoth/wesnoth/commit/8a079ba48838bd2314e056714345171db0e0ce0c
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/sdl/compat.hpp

  Log Message:
  -----------
  Add a work-around for SDL_EVENTMASK in SDL2.


  Commit: 57432e805fa97d7173cb60054c4e660013c8b31c
      https://github.com/wesnoth/wesnoth/commit/57432e805fa97d7173cb60054c4e660013c8b31c
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/sdl/compat.hpp
    M src/video.cpp
    M src/video.hpp

  Log Message:
  -----------
  Add a work-around for SDL_GetAppState in SDL2.

The code only compiles, but never return a sensible value. This should
be done later.


  Commit: 49b2a04e3825d2827789c3b51fc141f61dd19b1f
      https://github.com/wesnoth/wesnoth/commit/49b2a04e3825d2827789c3b51fc141f61dd19b1f
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/controller_base.cpp

  Log Message:
  -----------
  Disable some code for SDL2.

The code doesn't compile for SDL2 and it seems a work-around for an
issue in SDL, so maybe it is no longer required with SDL2. This needs to
be tested later.


  Commit: 04eea89636af328ddb6362621964ef734ee4c790
      https://github.com/wesnoth/wesnoth/commit/04eea89636af328ddb6362621964ef734ee4c790
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/preferences_display.cpp
    M src/video.cpp
    M src/video.hpp

  Log Message:
  -----------
  Refactor show_video_mode_dialog.

Separated the dialog code from the resolution gathering code. This makes
it easier to port the code to SDL2.

This also changes the sorting of the resolutions, first width then
height instead of based on the area. Before a part of the list looked
like:
1280 x 720
1152 x 864
1280 x 960
1440 x 900
1282 x 1024
These now look like:
1152 x 864
1280 x 720
1280 x 960
1280 x 1024
1440 x 900
The new sorting makes more sense to me.


  Commit: d64e5fb98e211d7baff5054d0c6bf323ceb31bf1
      https://github.com/wesnoth/wesnoth/commit/d64e5fb98e211d7baff5054d0c6bf323ceb31bf1
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/events.cpp

  Log Message:
  -----------
  Fix another SDL_ACTIVEEVENT usage for SDL2.

Not sure whether this code is a work-around for somthing SDL1.2 specific
or is also required for SDL2.


  Commit: e2e029b6e065d59b23972fbb4c339eb311fe9c18
      https://github.com/wesnoth/wesnoth/commit/e2e029b6e065d59b23972fbb4c339eb311fe9c18
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/hotkey/hotkey_preferences_display.cpp

  Log Message:
  -----------
  Fix a typo in a previous SDL2 related commit.

The error avoided the code to be compiled, somehow got lost between all
the other compilation errors still around.


  Commit: a5ebded0cbb89741e75f164b6aba284c75fd169f
      https://github.com/wesnoth/wesnoth/commit/a5ebded0cbb89741e75f164b6aba284c75fd169f
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/preferences_display.cpp

  Log Message:
  -----------
  Disable code for SDL2 in detect_video_settings.

This part of the code probably needs to be rewritten for SDL2, so add a
small band-aid for now.


  Commit: a87046bff7e1e79ad352a06594fb0611fc1f5f7a
      https://github.com/wesnoth/wesnoth/commit/a87046bff7e1e79ad352a06594fb0611fc1f5f7a
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/gui/dialogs/lobby_main.cpp
    M src/gui/dialogs/title_screen.cpp

  Log Message:
  -----------
  Fix the fullscreen functions for SDL2.


  Commit: 07c8ae4d121ab8de5ae6bb4a85be16f7d774c292
      https://github.com/wesnoth/wesnoth/commit/07c8ae4d121ab8de5ae6bb4a85be16f7d774c292
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/font.hpp

  Log Message:
  -----------
  Make a subtle include order change for SDL2.

Instead of compiling Wesnoth cleanly with a lot of linker errors I run
again in a new set of compilation errors. (Well I still consider this
progress ;-))


  Commit: a65a86f71476985137e3ca2962c94fa6b764fd97
      https://github.com/wesnoth/wesnoth/commit/a65a86f71476985137e3ca2962c94fa6b764fd97
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/widgets/textbox.cpp

  Log Message:
  -----------
  Add an include for SDL_SetAlpha when using SDL2.


  Commit: c28579e1f120e6bf6afeceee9f45e649ac16da95
      https://github.com/wesnoth/wesnoth/commit/c28579e1f120e6bf6afeceee9f45e649ac16da95
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/game_controller.cpp
    M src/video.cpp
    M src/video.hpp

  Log Message:
  -----------
  Add a work-around for SDL_WM_SetCaption in SDL2.

The code compiles, but doesn't do anything useful at the moment.


  Commit: 08e717e4cd3bcdb5fcc5f13364aac216422fc6d3
      https://github.com/wesnoth/wesnoth/commit/08e717e4cd3bcdb5fcc5f13364aac216422fc6d3
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/game_controller.cpp
    M src/video.cpp
    M src/video.hpp

  Log Message:
  -----------
  Add a work-around for SDL_WM_SetIcon in SDL2.

The code compiles, but doesn't do anything useful at the moment.


  Commit: e3a2dcdaf6b2a6a0a061498da317678733f008a4
      https://github.com/wesnoth/wesnoth/commit/e3a2dcdaf6b2a6a0a061498da317678733f008a4
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/sdl/compat.hpp

  Log Message:
  -----------
  Add define for SDL_keysym when using SDL2.


  Commit: 41b316d071af26d38c1c7c712fcbef94ad4ae67f
      https://github.com/wesnoth/wesnoth/commit/41b316d071af26d38c1c7c712fcbef94ad4ae67f
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/video.cpp

  Log Message:
  -----------
  Make get_flags compile with SDL2.

Not entirely sure which hardware flags need to be used, so only handle
the resizeable flag.


  Commit: 80636afd0e7b0697e149611a975fa67cd4e7dde1
      https://github.com/wesnoth/wesnoth/commit/80636afd0e7b0697e149611a975fa67cd4e7dde1
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/font.cpp
    M src/video.cpp

  Log Message:
  -----------
  Add a work-around for SDL_GetVideoSurface in SDL2.

For now simply assume the surface returned is NULL and everything
compiles nicely.


  Commit: adf46e650df50b12077049eaf5ba2aa095a35bda
      https://github.com/wesnoth/wesnoth/commit/adf46e650df50b12077049eaf5ba2aa095a35bda
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/widgets/textbox.cpp

  Log Message:
  -----------
  Another SDL2 unicode to scancode conversion.


  Commit: 4d52cb9728e25b7e3f73e14ebf66ba2a03a44d4f
      https://github.com/wesnoth/wesnoth/commit/4d52cb9728e25b7e3f73e14ebf66ba2a03a44d4f
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/video.cpp

  Log Message:
  -----------
  Disable CVideo::flip in SDL2.

This function needs to be rewritten for SDL2, so disable it so
compilation doesn't fail.


  Commit: f8b01d3211b197328932c24cf02c94a6edc9f6fc
      https://github.com/wesnoth/wesnoth/commit/f8b01d3211b197328932c24cf02c94a6edc9f6fc
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/video.cpp

  Log Message:
  -----------
  Disable CVideo::modePossible in SDL2.

This function needs to be rewritten for SDL2, so disable it so
compilation doesn't fail.


  Commit: 1ad881dac3a1ed6380a51641b9b48b948b5c49a3
      https://github.com/wesnoth/wesnoth/commit/1ad881dac3a1ed6380a51641b9b48b948b5c49a3
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/video.cpp

  Log Message:
  -----------
  Disable CVideo::setMode in SDL2.

This function needs to be rewritten for SDL2, so disable it so
compilation doesn't fail.


  Commit: 1857ba5449847c6f9c919955b86e5869e4a54cac
      https://github.com/wesnoth/wesnoth/commit/1857ba5449847c6f9c919955b86e5869e4a54cac
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/video.cpp

  Log Message:
  -----------
  Port CVideo::get_available_resolutions to SDL2.

The code is only compiled, but probably also works.


  Commit: d03b9beb6a3988e369ccd2e45cc0f613d3a0f8fb
      https://github.com/wesnoth/wesnoth/commit/d03b9beb6a3988e369ccd2e45cc0f613d3a0f8fb
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/game.cpp

  Log Message:
  -----------
  Replace SDL_putenv with SDL_setenv for SDL2.

SDL_putenv no longer exists in SDL2, and SDL_setenv has been added as
its replacement.


  Commit: 857bf5a64a03b9e15bca374048e60509d5ab6bed
      https://github.com/wesnoth/wesnoth/commit/857bf5a64a03b9e15bca374048e60509d5ab6bed
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M src/tests/gui/test_save_dialog.cpp
    M src/tests/utils/fake_event_source.cpp
    M src/tests/utils/fake_event_source.hpp
    M src/tests/utils/play_scenario.cpp
    M src/tests/utils/play_scenario.hpp

  Log Message:
  -----------
  Disable several unit tests for SDL2.

The code will change enough to invalidate the tests, so don't bother to
get them working now.

With this commit Wesnoth compiles with SDL2 as long as strict
compilation is disabled. Running Wesnoth does not work at the moment.


  Commit: 13308d887e5a2bf80e8ad6aafefaf039694f01f7
      https://github.com/wesnoth/wesnoth/commit/13308d887e5a2bf80e8ad6aafefaf039694f01f7
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2014-03-07 (Fri, 07 Mar 2014)

  Changed paths:
    M src/CMakeLists.txt
    M src/SConscript
    M src/about.cpp
    M src/attack_prediction_display.cpp
    M src/controller_base.cpp
    M src/editor/palette/tristate_button.cpp
    M src/events.cpp
    M src/font.cpp
    M src/font.hpp
    M src/game.cpp
    M src/game_controller.cpp
    M src/gui/auxiliary/event/dispatcher.hpp
    M src/gui/auxiliary/event/handler.cpp
    M src/gui/dialogs/lobby_main.cpp
    M src/gui/dialogs/title_screen.cpp
    M src/hotkey/hotkey_item.cpp
    M src/hotkey/hotkey_preferences_display.cpp
    M src/image_modifications.cpp
    M src/key.cpp
    M src/key.hpp
    M src/loadscreen.cpp
    M src/map_label.cpp
    M src/preferences_display.cpp
    A src/sdl/alpha.cpp
    A src/sdl/alpha.hpp
    A src/sdl/compat.hpp
    M src/sdl_utils.cpp
    M src/sdl_utils.hpp
    M src/tests/gui/test_save_dialog.cpp
    M src/tests/test_image_modifications.cpp
    M src/tests/utils/fake_event_source.cpp
    M src/tests/utils/fake_event_source.hpp
    M src/tests/utils/play_scenario.cpp
    M src/tests/utils/play_scenario.hpp
    M src/video.cpp
    M src/video.hpp
    M src/widgets/textbox.cpp

  Log Message:
  -----------
  Merge branch 'SDL2_compilation_fixes'

This branch makes it possible to compile Wesnoth using SDL2. Running the
resulting binary will not work however, that will be worked upon later.

Note compilation with strict compilation fails and will for the near
future since some struct members changed signedness.


Compare: https://github.com/wesnoth/wesnoth/compare/006ba9f5c890...13308d887e5a


More information about the Commits mailing list