Author: jhinrichs
Date: Fri Mar 27 00:19:32 2009
New Revision: 34169
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34169&view=rev
Log:
Some little savegame refactoring: Remove function parameter from deprecated
write_game function, as this parameter is always the same for all calls.
Modified:
trunk/src/gamestatus.cpp
trunk/src/gamestatus.hpp
trunk/src/menu_events.cpp
trunk/src/playcampaign.cpp
Modified: trunk/src/gamestatus.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gamestatus.cpp?rev=34169&r1=34168&r2=34169&view=diff
==============================================================================
--- trunk/src/gamestatus.cpp (original)
+++ trunk/src/gamestatus.cpp Fri Mar 27 00:19:32 2009
@@ -641,7 +641,7 @@
}
/** @deprecated, use other write_game below. */
-void write_game(const game_state& gamestate, config& cfg, WRITE_GAME_MODE mode)
+void write_game(const game_state& gamestate, config& cfg)
{
log_scope("write_game");
cfg["label"] = gamestate.label;
@@ -694,16 +694,6 @@
write_player(i->second, new_cfg);
new_cfg["save_id"]=i->first;
cfg.add_child("player", new_cfg);
- }
-
- if(mode == WRITE_FULL_GAME) {
- if(gamestate.replay_data.child("replay") == NULL) {
- cfg.add_child("replay",gamestate.replay_data);
- }
-
- cfg.add_child("snapshot",gamestate.snapshot);
- cfg.add_child("replay_start",gamestate.starting_pos);
- cfg.add_child("statistics",statistics::write_stats());
}
}
Modified: trunk/src/gamestatus.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gamestatus.hpp?rev=34169&r1=34168&r2=34169&view=diff
==============================================================================
--- trunk/src/gamestatus.hpp (original)
+++ trunk/src/gamestatus.hpp Fri Mar 27 00:19:32 2009
@@ -317,7 +317,7 @@
void read_save_file(const std::string& name, config& cfg, std::string*
error_log);
void write_players(game_state& gamestate, config& cfg);
-void write_game(const game_state& gamestate, config& cfg, WRITE_GAME_MODE
mode=WRITE_FULL_GAME);
+void write_game(const game_state& gamestate, config& cfg);
void write_game(config_writer &out, const game_state& gamestate,
WRITE_GAME_MODE mode=WRITE_FULL_GAME);
/** Returns true iff there is already a savegame with that name. */
Modified: trunk/src/menu_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/menu_events.cpp?rev=34169&r1=34168&r2=34169&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Fri Mar 27 00:19:32 2009
@@ -713,7 +713,7 @@
sound::write_music_play_list(start);
- write_game(gamestate_, start, WRITE_SNAPSHOT_ONLY);
+ write_game(gamestate_, start);
start["completion"] = gamestate_.completion;
//write out the current state of the map
Modified: trunk/src/playcampaign.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playcampaign.cpp?rev=34169&r1=34168&r2=34169&view=diff
==============================================================================
--- trunk/src/playcampaign.cpp (original)
+++ trunk/src/playcampaign.cpp Fri Mar 27 00:19:32 2009
@@ -545,7 +545,7 @@
// Adds player information, and other state
// information, to the configuration object
assert(cfg.child("store_next_scenario") !=
NULL);
- write_game(gamestate,
*cfg.child("store_next_scenario"), WRITE_SNAPSHOT_ONLY);
+ write_game(gamestate,
*cfg.child("store_next_scenario"));
network::send_data(cfg, 0, true);
}
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits