Author: esr
Date: Wed May 20 04:37:34 2009
New Revision: 35764
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35764&view=rev
Log:
Add parent field to ganestate structure; marshal it to and from cfgs.
This is about a third of the infrastructure required for save threading, but
does not yet touch the actual savegame code.
Modified:
trunk/src/gamestatus.cpp
trunk/src/gamestatus.hpp
Modified: trunk/src/gamestatus.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gamestatus.cpp?rev=35764&r1=35763&r2=35764&view=diff
==============================================================================
--- trunk/src/gamestatus.cpp (original)
+++ trunk/src/gamestatus.cpp Wed May 20 04:37:34 2009
@@ -367,6 +367,7 @@
game_state::game_state() :
label(),
+ parent(),
version(),
campaign_type(),
campaign_define(),
@@ -444,6 +445,7 @@
game_state::game_state(const config& cfg, bool show_replay) :
label(cfg["label"]),
+ parent(cfg["parent"]),
version(cfg["version"]),
campaign_type(cfg["campaign_type"]),
campaign_define(cfg["campaign_define"]),
@@ -545,6 +547,7 @@
{
log_scope("write_game");
cfg["label"] = label;
+ cfg["parent"] = parent;
cfg["history"] = history;
cfg["abbrev"] = abbrev;
cfg["version"] = game_config::version;
@@ -608,6 +611,7 @@
cfg_summary["snapshot"] = has_snapshot ? "yes" : "no";
cfg_summary["label"] = cfg_save["label"];
+ cfg_summary["parent"] = cfg_save["parent"];
cfg_summary["campaign_type"] = cfg_save["campaign_type"];
cfg_summary["scenario"] = cfg_save["scenario"];
cfg_summary["campaign"] = cfg_save["campaign"];
@@ -762,6 +766,7 @@
/* default construct everything to silence compiler warnings. */
variable_set(),
label(),
+ parent(),
version(),
campaign_type(),
campaign_define(),
@@ -799,6 +804,7 @@
history = state.history;
abbrev = state.abbrev;
label = state.label;
+ parent = state.parent;
version = state.version;
campaign_type = state.campaign_type;
campaign_define = state.campaign_define;
Modified: trunk/src/gamestatus.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gamestatus.hpp?rev=35764&r1=35763&r2=35764&view=diff
==============================================================================
--- trunk/src/gamestatus.hpp (original)
+++ trunk/src/gamestatus.hpp Wed May 20 04:37:34 2009
@@ -70,6 +70,7 @@
~game_state();
game_state& operator=(const game_state& state);
std::string label; /**< Name of the game
(e.g. name of save file). */
+ std::string parent; /**< Parent of the
game (for save-threading purposes). */
std::string version; /**< Version game was
created with. */
std::string campaign_type; /**< Type of the game
- campaign, multiplayer etc. */
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits