[Commits] [wesnoth/wesnoth] 0f8e25: Display Context: added write-access units() overlo...

GitHub noreply at github.com
Fri Jan 26 03:04:27 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 0f8e25f970ee9b8fba010c5ffa528aa6238d8900
      https://github.com/wesnoth/wesnoth/commit/0f8e25f970ee9b8fba010c5ffa528aa6238d8900
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-01-26 (Fri, 26 Jan 2018)

  Changed paths:
    M src/display_context.hpp
    M src/editor/editor_display.cpp
    M src/editor/map/map_context.hpp
    M src/pathfind/teleport.cpp

  Log Message:
  -----------
  Display Context: added write-access units() overload (pure virtual)


  Commit: 489dcebd0116c61ab25a65cbdcfa4df4394b53b6
      https://github.com/wesnoth/wesnoth/commit/489dcebd0116c61ab25a65cbdcfa4df4394b53b6
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-01-26 (Fri, 26 Jan 2018)

  Changed paths:
    M src/editor/action/action_unit.cpp
    M src/editor/action/mouse/mouse_action_unit.cpp
    M src/editor/controller/editor_controller.cpp
    M src/editor/map/context_manager.cpp
    M src/editor/map/map_context.hpp

  Log Message:
  -----------
  Editor/Map Context: removed get_units() functions in favor of display_context overrides


  Commit: 6a21fdc6750a8342846ef18248517808316c4118
      https://github.com/wesnoth/wesnoth/commit/6a21fdc6750a8342846ef18248517808316c4118
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-01-26 (Fri, 26 Jan 2018)

  Changed paths:
    M src/editor/controller/editor_controller.cpp
    M src/editor/map/context_manager.cpp
    M src/play_controller.cpp
    M src/resources.cpp
    M src/resources.hpp
    M src/units/abilities.cpp

  Log Message:
  -----------
  Removed resources::units once again

I had re-added it in a limited context in eaea9be1177398b2fe1 since I needed it to fix
(IIRC) a crash in the editor when adding units, since the editor didn't have a game_board.
However, looking at the code again, I realized that the display class (base of editor_display)
holds a pointer to a display_context object. map_context inherits from display_context, and
the editor sets the editor_display's display_context to the current map_context. Therefor, I
could just access the units needed via display::get_units, instead of needing a global pointer.


  Commit: 806e17674416b4b855b55015c4042f9fbf275291
      https://github.com/wesnoth/wesnoth/commit/806e17674416b4b855b55015c4042f9fbf275291
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-01-26 (Fri, 26 Jan 2018)

  Changed paths:
    M src/arrow.cpp

  Log Message:
  -----------
  Fixup c616d8274fcc (unused variable)


  Commit: de21ae13c56cab4245eff9b8e8bb44b8a1736fe1
      https://github.com/wesnoth/wesnoth/commit/de21ae13c56cab4245eff9b8e8bb44b8a1736fe1
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-01-26 (Fri, 26 Jan 2018)

  Changed paths:
    M src/display.cpp
    M src/editor/editor_display.cpp

  Log Message:
  -----------
  Display: allow actually passing a nullptr for the display_context arg

Avoids having to initially use a dummy context when initializing an editor_display.
The editor calls display::change_display_context later.


Compare: https://github.com/wesnoth/wesnoth/compare/f9238c015be8...de21ae13c56c


More information about the Commits mailing list