[Commits] [wesnoth/wesnoth] ab62d9: split off terrain data caches from the gamemap obj...

GitHub noreply at github.com
Sat Nov 8 04:06:46 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: ab62d9c75e4c09b59c8869d7acc422ac2aa54a50
      https://github.com/wesnoth/wesnoth/commit/ab62d9c75e4c09b59c8869d7acc422ac2aa54a50
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-11-07 (Fri, 07 Nov 2014)

  Changed paths:
    M src/CMakeLists.txt
    M src/SConscript
    M src/dialogs.cpp
    M src/display.cpp
    M src/editor/map/editor_map.cpp
    M src/editor/map/map_context.cpp
    M src/game_board.cpp
    M src/game_board.hpp
    M src/game_config_manager.cpp
    M src/game_config_manager.hpp
    M src/game_display.cpp
    M src/game_events/action_wml.hpp
    M src/game_initialization/create_engine.cpp
    M src/game_initialization/multiplayer_lobby.cpp
    M src/game_state.cpp
    M src/game_state.hpp
    M src/gui/dialogs/lobby/lobby_data.cpp
    M src/gui/widgets/minimap.cpp
    M src/help.cpp
    M src/map.cpp
    M src/map.hpp
    M src/minimap.cpp
    M src/movetype.cpp
    M src/play_controller.cpp
    M src/scripting/lua.cpp
    A src/terrain_type_data.cpp
    A src/terrain_type_data.hpp
    M src/tests/utils/fake_display.cpp

  Log Message:
  -----------
  split off terrain data caches from the gamemap object

This commit splits some of the functionality of the gamemap object
into a new class, the "terrain_type_data" object. This class is
intended to hold a record of known terrains and the terrain code ->
terrain type map. It handles merging in new terrain definitions,
and it is shared between map objects. It is also cached by the game
config manager, so that we only recalculate this data when we
change configs.

There is in fact a *semantic* change going on here, which is that
when a scenario introduces a new terrain type by merging, this gets
added to the global cache. The alternative is to make a copy of the
global cache, only for the this scenario, as soon as we have to
dirty the cache. However since I didn't see any downside to putting
the merged terrains together and carrying them across scenarios,
I opted not to do that here.


  Commit: 2059c6729f43bd4aa1085336931c7d655578d309
      https://github.com/wesnoth/wesnoth/commit/2059c6729f43bd4aa1085336931c7d655578d309
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-11-07 (Fri, 07 Nov 2014)

  Changed paths:
    M src/game_initialization/multiplayer.cpp
    M src/game_initialization/playcampaign.cpp
    M src/game_initialization/playcampaign.hpp
    M src/game_launcher.cpp
    M src/play_controller.cpp
    M src/play_controller.hpp
    M src/playmp_controller.cpp
    M src/playmp_controller.hpp
    M src/playsingle_controller.cpp
    M src/playsingle_controller.hpp
    M src/replay_controller.cpp
    M src/replay_controller.hpp
    M src/tests/utils/play_scenario.cpp
    M src/tests/utils/play_scenario.hpp

  Log Message:
  -----------
  use the game config manager's terrain cache in play_controllers

this completes 1a4efb6b22aeb0742c9083a7d0515ebdef799078 by
passing a reference to global terrain data cache to these
functions


  Commit: 5e561b086ba2e26477010ed96abb1f7b9fe2b47f
      https://github.com/wesnoth/wesnoth/commit/5e561b086ba2e26477010ed96abb1f7b9fe2b47f
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-11-07 (Fri, 07 Nov 2014)

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

  Log Message:
  -----------
  lazy computation of terrain type data

This preserves the way it was done previously, where we wouldn't
scan for terrain data until we actually load a map. This reduces
the wait you must endure when you click "campaign" or "multiplayer"
at the titlescreen.


  Commit: 64536df6059ee6c5fb154a0c68c6be70f4b669a3
      https://github.com/wesnoth/wesnoth/commit/64536df6059ee6c5fb154a0c68c6be70f4b669a3
  Author: Chris Beck <beck.ct at gmail.com>
  Date:   2014-11-07 (Fri, 07 Nov 2014)

  Changed paths:
    M src/CMakeLists.txt
    M src/SConscript
    M src/dialogs.cpp
    M src/display.cpp
    M src/editor/map/editor_map.cpp
    M src/editor/map/map_context.cpp
    M src/game_board.cpp
    M src/game_board.hpp
    M src/game_config_manager.cpp
    M src/game_config_manager.hpp
    M src/game_display.cpp
    M src/game_events/action_wml.hpp
    M src/game_initialization/create_engine.cpp
    M src/game_initialization/multiplayer.cpp
    M src/game_initialization/multiplayer_lobby.cpp
    M src/game_initialization/playcampaign.cpp
    M src/game_initialization/playcampaign.hpp
    M src/game_launcher.cpp
    M src/game_state.cpp
    M src/game_state.hpp
    M src/gui/dialogs/lobby/lobby_data.cpp
    M src/gui/widgets/minimap.cpp
    M src/help.cpp
    M src/map.cpp
    M src/map.hpp
    M src/minimap.cpp
    M src/movetype.cpp
    M src/play_controller.cpp
    M src/play_controller.hpp
    M src/playmp_controller.cpp
    M src/playmp_controller.hpp
    M src/playsingle_controller.cpp
    M src/playsingle_controller.hpp
    M src/replay_controller.cpp
    M src/replay_controller.hpp
    M src/scripting/lua.cpp
    A src/terrain_type_data.cpp
    A src/terrain_type_data.hpp
    M src/tests/utils/fake_display.cpp
    M src/tests/utils/play_scenario.cpp
    M src/tests/utils/play_scenario.hpp

  Log Message:
  -----------
  Merge pull request #328 from cbeck88/fixup_terrain_caching

split off terrain data caches from the gamemap object


Compare: https://github.com/wesnoth/wesnoth/compare/2effae3f131f...64536df6059e


More information about the Commits mailing list