Author: euschn
Date: Thu Jun 25 16:24:34 2009
New Revision: 36405

URL: http://svn.gna.org/viewcvs/wesnoth?rev=36405&view=rev
Log:
added a parameter to supply a snapshot config to the game_savegame ctor

Modified:
    trunk/src/play_controller.cpp
    trunk/src/playmp_controller.cpp
    trunk/src/playsingle_controller.cpp
    trunk/src/savegame.cpp
    trunk/src/savegame.hpp

Modified: trunk/src/play_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/play_controller.cpp?rev=36405&r1=36404&r2=36405&view=diff
==============================================================================
--- trunk/src/play_controller.cpp (original)
+++ trunk/src/play_controller.cpp Thu Jun 25 16:24:34 2009
@@ -294,7 +294,7 @@
 void play_controller::save_game(){
        if(save_blocker::try_block()) {
                save_blocker::save_unblocker unblocker;
-               game_savegame save(gamestate_, level_, *gui_, teams_, units_, 
tod_manager_, map_, preferences::compress_saves());
+               game_savegame save(gamestate_, level_, *gui_, teams_, units_, 
tod_manager_, map_, config(), preferences::compress_saves());
                save.save_game_interactive((*gui_).video(), "", gui::OK_CANCEL);
        } else {
                save_blocker::on_unblock(this,&play_controller::save_game);

Modified: trunk/src/playmp_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playmp_controller.cpp?rev=36405&r1=36404&r2=36405&view=diff
==============================================================================
--- trunk/src/playmp_controller.cpp (original)
+++ trunk/src/playmp_controller.cpp Thu Jun 25 16:24:34 2009
@@ -547,7 +547,7 @@
                temp_buf << " \n";
        }
 
-       oos_savegame save(gamestate_, level_, *gui_, teams_, units_, 
tod_manager_, map_, preferences::compress_saves());
+       oos_savegame save(gamestate_, level_, *gui_, teams_, units_, 
tod_manager_, map_, config(), preferences::compress_saves());
        save.save_game_interactive((*gui_).video(), temp_buf.str(), 
gui::YES_NO);
 }
 

Modified: trunk/src/playsingle_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playsingle_controller.cpp?rev=36405&r1=36404&r2=36405&view=diff
==============================================================================
--- trunk/src/playsingle_controller.cpp (original)
+++ trunk/src/playsingle_controller.cpp Thu Jun 25 16:24:34 2009
@@ -513,7 +513,7 @@
                        disconnect = true;
                }
 
-               game_savegame save(gamestate_, level_, *gui_, teams_, units_, 
tod_manager_, map_, preferences::compress_saves());
+               game_savegame save(gamestate_, level_, *gui_, teams_, units_, 
tod_manager_, map_, config(), preferences::compress_saves());
                save.save_game_interactive((*gui_).video(), _("A network 
disconnection has occurred, and the game\ncannot continue. Do you want to save 
the game?"), gui::YES_NO);
                if(disconnect) {
                        throw network::error();
@@ -681,7 +681,7 @@
        gui_->draw(true,true);
 
        if (save) {
-               autosave_savegame save(gamestate_, level_, *gui_, teams_, 
units_, tod_manager_, map_, preferences::compress_saves());
+               autosave_savegame save(gamestate_, level_, *gui_, teams_, 
units_, tod_manager_, map_, config(), preferences::compress_saves());
                save.autosave(game_config::disable_autosave, 
preferences::autosavemax(), preferences::INFINITE_AUTO_SAVES);
        }
 

Modified: trunk/src/savegame.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/savegame.cpp?rev=36405&r1=36404&r2=36405&view=diff
==============================================================================
--- trunk/src/savegame.cpp (original)
+++ trunk/src/savegame.cpp Thu Jun 25 16:24:34 2009
@@ -866,8 +866,8 @@
 autosave_savegame::autosave_savegame(game_state &gamestate, const config& 
level_cfg,
                                                         game_display& gui, 
const std::vector<team>& teams,
                                                         const unit_map& units, 
const tod_manager& tod_mng,
-                                                        const gamemap& map, 
const bool compress_saves)
-       : game_savegame(gamestate, level_cfg, gui, teams, units, tod_mng, map, 
compress_saves)
+                                                        const gamemap& map, 
const config& snapshot_cfg, const bool compress_saves)
+       : game_savegame(gamestate, level_cfg, gui, teams, units, tod_mng, map, 
snapshot_cfg, compress_saves)
 {
        set_error_message(_("Could not auto save the game. Please save the game 
manually."));
 }
@@ -896,8 +896,8 @@
 oos_savegame::oos_savegame(game_state &gamestate, const config& level_cfg,
                                                         game_display& gui, 
const std::vector<team>& teams,
                                                         const unit_map& units, 
const tod_manager& tod_mng,
-                                                        const gamemap& map, 
const bool compress_saves)
-       : game_savegame(gamestate, level_cfg, gui, teams, units, tod_mng, map, 
compress_saves)
+                                                        const gamemap& map, 
const config& snapshot_cfg, const bool compress_saves)
+       : game_savegame(gamestate, level_cfg, gui, teams, units, tod_mng, map, 
snapshot_cfg, compress_saves)
 {}
 
 int oos_savegame::show_save_dialog(CVideo& video, const std::string& message, 
const gui::DIALOG_TYPE /*dialog_type*/)
@@ -924,12 +924,14 @@
 game_savegame::game_savegame(game_state &gamestate, const config& level_cfg,
                                                         game_display& gui, 
const std::vector<team>& teams,
                                                         const unit_map& units, 
const tod_manager& tod_mng,
-                                                        const gamemap& map, 
const bool compress_saves)
+                                                        const gamemap& map, 
const config& snapshot_cfg, const bool compress_saves)
        : savegame(gamestate, compress_saves, _("Save Game")),
        level_cfg_(level_cfg), gui_(gui),
        teams_(teams), units_(units),
        tod_manager_(tod_mng), map_(map)
-{}
+{
+       snapshot().merge_with(snapshot_cfg);
+}
 
 void game_savegame::create_filename()
 {

Modified: trunk/src/savegame.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/savegame.hpp?rev=36405&r1=36404&r2=36405&view=diff
==============================================================================
--- trunk/src/savegame.hpp (original)
+++ trunk/src/savegame.hpp Thu Jun 25 16:24:34 2009
@@ -229,7 +229,7 @@
        game_savegame(game_state& gamestate, const config& level_cfg,
                game_display& gui, const std::vector<team>& teams,
                const unit_map& units, const tod_manager& tod_mng,
-               const gamemap& map, const bool compress_saves);
+               const gamemap& map, const config& snapshot_cfg, const bool 
compress_saves);
 
 private:
        /** Create a filename for automatic saves */
@@ -268,7 +268,7 @@
        autosave_savegame(game_state &gamestate, const config& level_cfg,
                                         game_display& gui, const 
std::vector<team>& teams,
                                         const unit_map& units, const 
tod_manager& tod_mng,
-                                        const gamemap& map, const bool 
compress_saves);
+                                        const gamemap& map, const config& 
snapshot_cfg, const bool compress_saves);
 
        void autosave(const bool disable_autosave, const int autosave_max, 
const int infinite_autosaves);
 private:
@@ -282,7 +282,7 @@
        oos_savegame(game_state &gamestate, const config& level_cfg,
                                 game_display& gui, const std::vector<team>& 
teams,
                                 const unit_map& units, const tod_manager& 
tod_mng,
-                                const gamemap& map, const bool compress_saves);
+                                const gamemap& map, const config& 
snapshot_cfg, const bool compress_saves);
 
 private:
        /** Display the save game dialog. */


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to