[Commits] [wesnoth/wesnoth] 55ba8c: Cleaned up handling of basic alpha setting

GitHub noreply at github.com
Sat Sep 24 06:31:56 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 55ba8c95bcc4812847671a981cecda14fb62a628
      https://github.com/wesnoth/wesnoth/commit/55ba8c95bcc4812847671a981cecda14fb62a628
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2016-09-24 (Sat, 24 Sep 2016)

  Changed paths:
    M projectfiles/CodeBlocks/wesnoth.cbp
    M src/CMakeLists.txt
    M src/SConscript
    M src/attack_prediction_display.cpp
    M src/display.cpp
    M src/editor/action/mouse/mouse_action.cpp
    M src/editor/action/mouse/mouse_action_item.cpp
    M src/editor/action/mouse/mouse_action_map_label.cpp
    M src/editor/action/mouse/mouse_action_select.cpp
    M src/editor/action/mouse/mouse_action_unit.cpp
    M src/editor/action/mouse/mouse_action_village.cpp
    M src/editor/palette/tristate_button.cpp
    M src/floating_label.cpp
    M src/font.cpp
    M src/game_display.cpp
    M src/image_modifications.cpp
    R src/sdl/alpha.cpp
    R src/sdl/alpha.hpp
    M src/sdl/rect.cpp
    M src/sdl/utils.cpp
    M src/sdl/utils.hpp
    M src/widgets/textbox.cpp

  Log Message:
  -----------
  Cleaned up handling of basic alpha setting

This does a few things:
* Refactored adjust_surface_alpha to use SDL_SetSurfaceAlphaMod
* Made all uses of the legacy SDL_SetAlpha use adjust_surface_alpha
* Made adjust_surface_alpha now take a non-const reference and perform the operation on the surface directly.


  Commit: ff6cbf9329a00faed6fc731306d39067ddb01246
      https://github.com/wesnoth/wesnoth/commit/ff6cbf9329a00faed6fc731306d39067ddb01246
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2016-09-24 (Sat, 24 Sep 2016)

  Changed paths:
    M src/sdl/utils.cpp

  Log Message:
  -----------
  Removed old Pandora compatibility code


  Commit: 51fd200ac441fda3baea4e9ae9e34f1bd5415220
      https://github.com/wesnoth/wesnoth/commit/51fd200ac441fda3baea4e9ae9e34f1bd5415220
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2016-09-24 (Sat, 24 Sep 2016)

  Changed paths:
    M src/floating_label.cpp
    M src/image.cpp
    M src/image_modifications.cpp
    M src/sdl/utils.cpp
    M src/sdl/utils.hpp

  Log Message:
  -----------
  Refactored out create_optimized_surface

Instead, we simply call adjust_surface_alpha directly. This removes the creation of another temporary surface.
This also removes cases when it's called after creating a surface with create_neutral_surface, since that
function should produce the same result.


  Commit: fe934c60a7dbab19ca9e96945db1591c7888f924
      https://github.com/wesnoth/wesnoth/commit/fe934c60a7dbab19ca9e96945db1591c7888f924
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2016-09-24 (Sat, 24 Sep 2016)

  Changed paths:
    M src/sdl/utils.hpp

  Log Message:
  -----------
  Refactored use of util::scoped_resource out of surface struct (now class)

util::scoped_resource is likely going to be removed soon and replaced with std::unique_ptr. However,
due to the custom refcounting done on the SDL_Surfaces, here, we cannot use unique_ptr or shared_ptr.
Therefor, we simply add the functionality manually.


Compare: https://github.com/wesnoth/wesnoth/compare/5857098ab7d6...fe934c60a7db


More information about the Commits mailing list