Savegame: removed unused game_display references from various classes
No idea when these became unused, though. Doesn't seem to be by CVideo argument cleanup.
This commit is contained in:
parent
bf9cac173d
commit
583670ac2b
5 changed files with 18 additions and 27 deletions
|
@ -823,7 +823,7 @@ void play_controller::save_game()
|
|||
if(save_blocker::try_block()) {
|
||||
save_blocker::save_unblocker unblocker;
|
||||
scoped_savegame_snapshot snapshot(*this);
|
||||
savegame::ingame_savegame save(saved_game_, *gui_, preferences::save_compression_format());
|
||||
savegame::ingame_savegame save(saved_game_, preferences::save_compression_format());
|
||||
save.save_game_interactive("", savegame::savegame::OK_CANCEL);
|
||||
} else {
|
||||
save_blocker::on_unblock(this,&play_controller::save_game);
|
||||
|
@ -836,7 +836,7 @@ void play_controller::save_game_auto(const std::string& filename)
|
|||
save_blocker::save_unblocker unblocker;
|
||||
|
||||
scoped_savegame_snapshot snapshot(*this);
|
||||
savegame::ingame_savegame save(saved_game_, *gui_, preferences::save_compression_format());
|
||||
savegame::ingame_savegame save(saved_game_, preferences::save_compression_format());
|
||||
save.save_game_automatic(false, filename);
|
||||
}
|
||||
}
|
||||
|
@ -984,7 +984,7 @@ void play_controller::process_oos(const std::string& msg) const
|
|||
message << "\n\n" << _("Error details:") << "\n\n" << msg;
|
||||
|
||||
scoped_savegame_snapshot snapshot(*this);
|
||||
savegame::oos_savegame save(saved_game_, *gui_, ignore_replay_errors_);
|
||||
savegame::oos_savegame save(saved_game_, ignore_replay_errors_);
|
||||
save.save_game_interactive(message.str(), savegame::savegame::YES_NO); // can throw quit_game_exception
|
||||
}
|
||||
|
||||
|
@ -998,14 +998,14 @@ void play_controller::update_gui_to_player(const int team_index, const bool obse
|
|||
void play_controller::do_autosave()
|
||||
{
|
||||
scoped_savegame_snapshot snapshot(*this);
|
||||
savegame::autosave_savegame save(saved_game_, *gui_, preferences::save_compression_format());
|
||||
savegame::autosave_savegame save(saved_game_, preferences::save_compression_format());
|
||||
save.autosave(false, preferences::autosavemax(), preferences::INFINITE_AUTO_SAVES);
|
||||
}
|
||||
|
||||
void play_controller::do_consolesave(const std::string& filename)
|
||||
{
|
||||
scoped_savegame_snapshot snapshot(*this);
|
||||
savegame::ingame_savegame save(saved_game_, *gui_, preferences::save_compression_format());
|
||||
savegame::ingame_savegame save(saved_game_, preferences::save_compression_format());
|
||||
save.save_game_automatic(true, filename);
|
||||
}
|
||||
|
||||
|
|
|
@ -371,7 +371,7 @@ void playmp_controller::process_oos(const std::string& err_msg) const {
|
|||
temp_buf << " \n";
|
||||
}
|
||||
scoped_savegame_snapshot snapshot(*this);
|
||||
savegame::oos_savegame save(saved_game_, *gui_, ignore_replay_errors_);
|
||||
savegame::oos_savegame save(saved_game_, ignore_replay_errors_);
|
||||
save.save_game_interactive(temp_buf.str(), savegame::savegame::YES_NO);
|
||||
}
|
||||
|
||||
|
|
|
@ -347,7 +347,7 @@ LEVEL_RESULT playsingle_controller::play_scenario(const config& level)
|
|||
} catch(wesnothd_error& e) {
|
||||
|
||||
scoped_savegame_snapshot snapshot(*this);
|
||||
savegame::ingame_savegame save(saved_game_, *gui_, preferences::save_compression_format());
|
||||
savegame::ingame_savegame save(saved_game_, preferences::save_compression_format());
|
||||
save.save_game_interactive(_("A network disconnection has occurred, and the game cannot continue. Do you want to save the game?"), savegame::savegame::YES_NO);
|
||||
if(dynamic_cast<ingame_wesnothd_error*>(&e)) {
|
||||
return LEVEL_RESULT::QUIT;
|
||||
|
@ -423,7 +423,7 @@ void playsingle_controller::before_human_turn()
|
|||
|
||||
if(init_side_done_now_) {
|
||||
scoped_savegame_snapshot snapshot(*this);
|
||||
savegame::autosave_savegame save(saved_game_, *gui_, preferences::save_compression_format());
|
||||
savegame::autosave_savegame save(saved_game_, preferences::save_compression_format());
|
||||
save.autosave(game_config::disable_autosave, preferences::autosavemax(), preferences::INFINITE_AUTO_SAVES);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "format_time_summary.hpp"
|
||||
#include "formatter.hpp"
|
||||
#include "formula/string_utils.hpp"
|
||||
#include "game_display.hpp"
|
||||
#include "game_end_exceptions.hpp"
|
||||
#include "game_errors.hpp"
|
||||
#include "preferences/game.hpp"
|
||||
|
@ -43,6 +42,7 @@
|
|||
#include "serialization/parser.hpp"
|
||||
#include "statistics.hpp"
|
||||
#include "version.hpp"
|
||||
#include "video.hpp"
|
||||
|
||||
static lg::log_domain log_engine("engine");
|
||||
#define LOG_SAVE LOG_STREAM(info, log_engine)
|
||||
|
@ -570,9 +570,8 @@ void replay_savegame::write_game(config_writer &out) {
|
|||
|
||||
}
|
||||
|
||||
autosave_savegame::autosave_savegame(saved_game &gamestate,
|
||||
game_display& gui, const compression::format compress_saves)
|
||||
: ingame_savegame(gamestate, gui, compress_saves)
|
||||
autosave_savegame::autosave_savegame(saved_game &gamestate, const compression::format compress_saves)
|
||||
: ingame_savegame(gamestate, compress_saves)
|
||||
{
|
||||
set_error_message(_("Could not auto save the game. Please save the game manually."));
|
||||
}
|
||||
|
@ -598,8 +597,8 @@ void autosave_savegame::create_filename()
|
|||
set_filename(filename);
|
||||
}
|
||||
|
||||
oos_savegame::oos_savegame(saved_game& gamestate, game_display& gui, bool& ignore)
|
||||
: ingame_savegame(gamestate, gui, preferences::save_compression_format())
|
||||
oos_savegame::oos_savegame(saved_game& gamestate, bool& ignore)
|
||||
: ingame_savegame(gamestate, preferences::save_compression_format())
|
||||
, ignore_(ignore)
|
||||
{}
|
||||
|
||||
|
@ -624,10 +623,8 @@ int oos_savegame::show_save_dialog(const std::string& message, DIALOG_TYPE /*dia
|
|||
return res;
|
||||
}
|
||||
|
||||
ingame_savegame::ingame_savegame(saved_game &gamestate,
|
||||
game_display& gui, const compression::format compress_saves)
|
||||
: savegame(gamestate, compress_saves, _("Save Game")),
|
||||
gui_(gui)
|
||||
ingame_savegame::ingame_savegame(saved_game &gamestate, const compression::format compress_saves)
|
||||
: savegame(gamestate, compress_saves, _("Save Game"))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include <exception>
|
||||
|
||||
class config_writer;
|
||||
class game_display;
|
||||
class saved_game;
|
||||
class version_info;
|
||||
|
||||
|
@ -236,8 +235,7 @@ private:
|
|||
class ingame_savegame : public savegame
|
||||
{
|
||||
public:
|
||||
ingame_savegame(saved_game& gamestate,
|
||||
game_display& gui, const compression::format compress_saves);
|
||||
ingame_savegame(saved_game& gamestate, const compression::format compress_saves);
|
||||
|
||||
private:
|
||||
/** Create a filename for automatic saves */
|
||||
|
@ -245,9 +243,6 @@ private:
|
|||
|
||||
|
||||
void write_game(config_writer &out) override;
|
||||
|
||||
protected:
|
||||
game_display& gui_;
|
||||
};
|
||||
|
||||
/** Class for replay saves (either manually or automatically). */
|
||||
|
@ -267,8 +262,7 @@ private:
|
|||
class autosave_savegame : public ingame_savegame
|
||||
{
|
||||
public:
|
||||
autosave_savegame(saved_game &gamestate,
|
||||
game_display& gui, const compression::format compress_saves);
|
||||
autosave_savegame(saved_game &gamestate, const compression::format compress_saves);
|
||||
|
||||
void autosave(const bool disable_autosave, const int autosave_max, const int infinite_autosaves);
|
||||
private:
|
||||
|
@ -279,7 +273,7 @@ private:
|
|||
class oos_savegame : public ingame_savegame
|
||||
{
|
||||
public:
|
||||
oos_savegame(saved_game& gamestate, game_display& gui, bool& ignore);
|
||||
oos_savegame(saved_game& gamestate, bool& ignore);
|
||||
|
||||
private:
|
||||
/** Display the save game dialog. */
|
||||
|
|
Loading…
Add table
Reference in a new issue