[Commits] [wesnoth/wesnoth] 354673: Clarify implicit cast to boolean

GitHub noreply at github.com
Fri Sep 25 11:59:51 UTC 2015


  Branch: refs/heads/sdl2
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 354673875050dbc78b72546999fb43199be998f4
      https://github.com/wesnoth/wesnoth/commit/354673875050dbc78b72546999fb43199be998f4
  Author: Wedge009 <wedge009 at wedge009.net>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M src/joystick.cpp

  Log Message:
  -----------
  Clarify implicit cast to boolean

Should not really assume that SDL_JoystickGetAttached() will return a non-zero value as 'true'. Some functions return 0 as 'success'.


  Commit: 0ba49fae04aff732847a987007bb63b4b2e04eef
      https://github.com/wesnoth/wesnoth/commit/0ba49fae04aff732847a987007bb63b4b2e04eef
  Author: Wedge009 <wedge009 at wedge009.net>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M src/attack_prediction_display.cpp
    M src/display.cpp
    M src/display_chat_manager.cpp
    M src/game_initialization/multiplayer.cpp
    M src/game_initialization/multiplayer_create.cpp
    M src/gui/widgets/window.cpp
    M src/image_modifications.cpp
    M src/marked-up_text.cpp
    M src/minimap.cpp
    M src/playmp_controller.cpp
    M src/sdl/rect.hpp
    M src/sdl/utils.cpp
    M src/sdl/utils.hpp
    M src/storyscreen/render.cpp
    M src/tests/test_image_modifications.cpp

  Log Message:
  -----------
  Replace 255 with SDL_ALPHA_OPAQUE where appropriate.

This is an extension of the previous correction to alpha values in attack_prediction_display.cpp.
For clarity and compatibility, use the SDL_ALPHA_OPAQUE definition instead of assuming hard-coded 255. This is defined in both SDL 1.2 and 2.0.
Where there are mathematical operations on alpha channel which assumes a value of 255, leave alpha as hard-coded 255.
Old versions of SDL treated 255 as transparent and 0 as opaque - there are still instances where alpha is 0 in a non-transparency situation, but these seem okay. Possibly because there is no alpha blending involved.


  Commit: 1181a401edc3ec1910d1c97bb61f3de8303edf6f
      https://github.com/wesnoth/wesnoth/commit/1181a401edc3ec1910d1c97bb61f3de8303edf6f
  Author: Andreas <andreas at alternating.net>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M src/attack_prediction_display.cpp
    M src/display.cpp
    M src/display_chat_manager.cpp
    M src/game_initialization/multiplayer.cpp
    M src/game_initialization/multiplayer_create.cpp
    M src/gui/widgets/window.cpp
    M src/image_modifications.cpp
    M src/joystick.cpp
    M src/marked-up_text.cpp
    M src/minimap.cpp
    M src/playmp_controller.cpp
    M src/sdl/rect.hpp
    M src/sdl/utils.cpp
    M src/sdl/utils.hpp
    M src/storyscreen/render.cpp
    M src/tests/test_image_modifications.cpp

  Log Message:
  -----------
  Merge pull request #503 from Wedge009/sdl2_minor_changes

SDL2 Minor Changes


Compare: https://github.com/wesnoth/wesnoth/compare/96dd2980bcfc...1181a401edc3


More information about the Commits mailing list