Skip to content

Commit

Permalink
Removed external calls to display::redraw_everything()
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Aug 12, 2017
1 parent fd745b8 commit f47dac3
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 30 deletions.
3 changes: 0 additions & 3 deletions src/editor/controller/editor_controller.cpp
Expand Up @@ -88,7 +88,6 @@ editor_controller::editor_controller(const config &game_config, CVideo& video)
join();

gui().create_buttons();
gui().redraw_everything();
}

void editor_controller::init_gui()
Expand Down Expand Up @@ -1097,8 +1096,6 @@ void editor_controller::preferences()
{
gui_->video().clear_all_help_strings();
gui2::dialogs::preferences_dialog::display(gui_->video(), game_config_);

gui_->redraw_everything();
}

void editor_controller::toggle_grid()
Expand Down
3 changes: 0 additions & 3 deletions src/menu_events.cpp
Expand Up @@ -196,8 +196,6 @@ void menu_handler::save_map()
void menu_handler::preferences()
{
gui2::dialogs::preferences_dialog::display(gui_->video(), game_config_);
// Needed after changing fullscreen/windowed mode or display resolution
gui_->redraw_everything();
}

void menu_handler::show_chat_log()
Expand Down Expand Up @@ -1387,7 +1385,6 @@ void console_handler::do_refresh()
image::flush_cache();

menu_handler_.gui_->create_buttons();
menu_handler_.gui_->redraw_everything();
}

void console_handler::do_droid()
Expand Down
3 changes: 0 additions & 3 deletions src/playmp_controller.cpp
Expand Up @@ -94,7 +94,6 @@ void playmp_controller::remove_blindfold() {
if (gui_->is_blindfolded()) {
blindfold_.unblind();
LOG_NG << "Taking off the blindfold now " << std::endl;
gui_->redraw_everything();
}
}

Expand Down Expand Up @@ -219,15 +218,13 @@ void playmp_controller::set_end_scenario_button()
}
gui_->get_theme().refresh_title2("button-endturn", "title2");
gui_->invalidate_theme();
gui_->redraw_everything();
}

void playmp_controller::reset_end_scenario_button()
{
// revert the end-turn button text to its normal label
gui_->get_theme().refresh_title2("button-endturn", "title");
gui_->invalidate_theme();
gui_->redraw_everything();
gui_->set_game_mode(game_display::RUNNING);
}

Expand Down
3 changes: 0 additions & 3 deletions src/playsingle_controller.cpp
Expand Up @@ -440,7 +440,6 @@ void playsingle_controller::before_human_turn()
void playsingle_controller::show_turn_dialog(){
if(preferences::turn_dialog() && !is_regular_game_end() ) {
blindfold b(*gui_, true); //apply a blindfold for the duration of this dialog
gui_->redraw_everything();
gui_->recalculate_minimap();
std::string message = _("It is now $name|’s turn");
utils::string_map symbols;
Expand Down Expand Up @@ -492,7 +491,6 @@ void playsingle_controller::linger()
// change the end-turn button text to its alternate label
gui_->get_theme().refresh_title2("button-endturn", "title2");
gui_->invalidate_theme();
gui_->redraw_everything();

// End all unit moves
gamestate().board_.set_all_units_user_end_turn();
Expand All @@ -513,7 +511,6 @@ void playsingle_controller::linger()
// revert the end-turn button text to its normal label
gui_->get_theme().refresh_title2("button-endturn", "title");
gui_->invalidate_theme();
gui_->redraw_everything();
gui_->set_game_mode(game_display::RUNNING);

LOG_NG << "ending end-of-scenario linger\n";
Expand Down
2 changes: 0 additions & 2 deletions src/playturn.cpp
Expand Up @@ -188,11 +188,9 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg

if (resources::gameboard->is_observer() || (resources::gameboard->teams())[resources::screen->playing_team()].is_local_human()) {
resources::screen->set_team(resources::screen->playing_team());
resources::screen->redraw_everything();
resources::screen->recalculate_minimap();
} else if (tm.is_local_human()) {
resources::screen->set_team(side - 1);
resources::screen->redraw_everything();
resources::screen->recalculate_minimap();
}

Expand Down
2 changes: 0 additions & 2 deletions src/replay_controller.cpp
Expand Up @@ -76,7 +76,6 @@ replay_controller::replay_controller(play_controller& controller, bool control_v
}
controller_.get_display().get_theme().theme_reset_event().attach_handler(this);
controller_.get_display().create_buttons();
controller_.get_display().redraw_everything();
}
replay_controller::~replay_controller()
{
Expand All @@ -85,7 +84,6 @@ replay_controller::~replay_controller()
}
controller_.get_display().get_theme().theme_reset_event().detach_handler(this);
controller_.get_display().create_buttons();
controller_.get_display().redraw_everything();
controller_.get_display().create_buttons();
}
void replay_controller::add_replay_theme()
Expand Down
6 changes: 0 additions & 6 deletions src/synced_commands.cpp
Expand Up @@ -570,7 +570,6 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_turn_limit, child, use_undo, /*show*/, /*e
debug_notification(":turn_limit debug command was used during turn of $player");

resources::tod_manager->set_number_of_turns(child["turn_limit"].to_int(-1));
resources::screen->redraw_everything();
return true;
}

Expand All @@ -585,7 +584,6 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_turn, child, use_undo, /*show*/, /*error_h
resources::tod_manager->set_turn(child["turn"].to_int(1), resources::gamedata);

resources::screen->new_turn();
resources::screen->redraw_everything();

return true;
}
Expand Down Expand Up @@ -617,7 +615,6 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_gold, child, use_undo, /*show*/, /*error_h
debug_notification(":gold debug command was used during turn of $player");

resources::controller->current_team().spend_gold(-child["gold"].to_int(0));
resources::screen->redraw_everything();
return true;
}

Expand All @@ -631,7 +628,6 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_event, child, use_undo, /*show*/, /*error_
debug_notification(":throw debug command was used during turn of $player");

resources::controller->pump().fire(child["eventname"]);
resources::screen->redraw_everything();

return true;
}
Expand All @@ -650,7 +646,6 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_fog, /*child*/, use_undo, /*show*/, /*erro
actions::recalculate_fog(current_team.side());

resources::screen->recalculate_minimap();
resources::screen->redraw_everything();

return true;
}
Expand All @@ -669,7 +664,6 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_shroud, /*child*/, use_undo, /*show*/, /*e
actions::clear_shroud(current_team.side());

resources::screen->recalculate_minimap();
resources::screen->redraw_everything();

return true;
}
Expand Down
8 changes: 0 additions & 8 deletions src/video.cpp
Expand Up @@ -507,10 +507,6 @@ void CVideo::set_fullscreen(bool ison)
}

setMode(res.first, res.second, mode);

if(display::get_singleton()) {
display::get_singleton()->redraw_everything();
}
}

// Change the config value.
Expand All @@ -532,10 +528,6 @@ void CVideo::set_resolution(const unsigned width, const unsigned height)

setMode(width, height, TO_RES);

if(display::get_singleton()) {
display::get_singleton()->redraw_everything();
}

// Change the config values.
preferences::_set_resolution(std::make_pair(width, height));
preferences::_set_maximized(false);
Expand Down

0 comments on commit f47dac3

Please sign in to comment.