[Commits] [wesnoth/wesnoth] 60eef0: Correct Surface Alpha Blending in SDL2

GitHub noreply at github.com
Sun Sep 13 10:28:27 UTC 2015


  Branch: refs/heads/sdl2
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 60eef087e9439b0aac9ad2ee7ce3f12d566c7fa8
      https://github.com/wesnoth/wesnoth/commit/60eef087e9439b0aac9ad2ee7ce3f12d566c7fa8
  Author: Wedge009 <wedge009 at wedge009.net>
  Date:   2015-09-12 (Sat, 12 Sep 2015)

  Changed paths:
    M src/sdl/alpha.cpp

  Log Message:
  -----------
  Correct Surface Alpha Blending in SDL2

alpha.cpp was apparently written as a compatibility wrapper for SDL2, as SDL_SetAlpha() has been replaced with other functions in SDL2. As it currently stands, it neglects to set the alpha blend mode which is now required when in SDL2.

A quick check of the code indicates that in most places where SDL_SetAlpha() is called, the alpha parameter is only set as SDL_ALPHA_OPAQUE, or the flag input parameter does not include SDL_SRCALPHA. So in either case there is no alpha blending anyway and so this omission didn't make a difference anyway.

However, alpha blending *is* used in fill_rect_alpha of rect.cpp. This is most noticeable in dialogues with sorted lists, such as the hot-key bindings in the preferences, where the background colour of the headings turns opaque white instead of the alpha-blended grey that it is in an SDL1.2 build. There is at least one graphical blending issue resolved with this change as well - it's possible others may be included with this.


  Commit: 13dd8d40fb371e25625f1af8cbd523c59452074a
      https://github.com/wesnoth/wesnoth/commit/13dd8d40fb371e25625f1af8cbd523c59452074a
  Author: Andreas <andreas at alternating.net>
  Date:   2015-09-13 (Sun, 13 Sep 2015)

  Changed paths:
    M src/sdl/alpha.cpp

  Log Message:
  -----------
  Merge pull request #489 from Wedge009/SDL2_surface_blending_correction

Correct Surface Alpha Blending in SDL2


Compare: https://github.com/wesnoth/wesnoth/compare/22cff55dc875...13dd8d40fb37


More information about the Commits mailing list