Skip to content

Commit

Permalink
Use CVideo singleton instead of resources::screen->video()
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Jul 26, 2017
1 parent 94e0c63 commit 9ec9f8b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/actions/advancement.cpp
Expand Up @@ -115,7 +115,7 @@ namespace
// When the unit advances, it fades to white, and then switches
// to the new unit, then fades back to the normal color

if (animate && !resources::screen->video().update_locked()) {
if (animate && !CVideo::get_singleton().update_locked()) {
unit_animator animator;
bool with_bars = true;
animator.add_animation(&*u, "levelout", u->get_location(), map_location(), 0, with_bars);
Expand All @@ -136,7 +136,7 @@ namespace
u = resources::gameboard->units().find(loc);
resources::screen->invalidate_unit();

if (animate && u != resources::gameboard->units().end() && !resources::screen->video().update_locked()) {
if (animate && u != resources::gameboard->units().end() && !CVideo::get_singleton().update_locked()) {
unit_animator animator;
animator.add_animation(&*u, "levelin", u->get_location(), map_location(), 0, true);
animator.start_animations();
Expand Down
2 changes: 1 addition & 1 deletion src/formula/debugger.cpp
Expand Up @@ -159,7 +159,7 @@ void formula_debugger::show_gui()
}
if (game_config::debug) {
gui2::dialogs::formula_debugger debug_dialog(*this);
debug_dialog.show(resources::screen->video());
debug_dialog.show(CVideo::get_singleton());
} else {
WRN_FDB << "do not showing debug window due to disabled --new-widgets"<< std::endl;
}
Expand Down
4 changes: 2 additions & 2 deletions src/game_events/action_wml.cpp
Expand Up @@ -582,7 +582,7 @@ WML_HANDLER_FUNCTION(replace_map,, cfg)
lg::wml_error() << "replace_map: Unable to load map " << log_map_name << std::endl;
return;
} catch(wml_exception& e) {
e.show(resources::screen->video());
e.show(CVideo::get_singleton());
return;
}

Expand Down Expand Up @@ -844,7 +844,7 @@ WML_HANDLER_FUNCTION(terrain_mask,, cfg)
ERR_NG << "terrain mask is in the incorrect format, and couldn't be applied" << std::endl;
return;
} catch(wml_exception& e) {
e.show(resources::screen->video());
e.show(CVideo::get_singleton());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/game_events/pump.cpp
Expand Up @@ -627,7 +627,7 @@ pump_result_t wml_event_pump::operator()()
void wml_event_pump::flush_messages()
{
// Dialogs can only be shown if the display is not locked
if(resources::screen && !resources::screen->video().update_locked()) {
if(resources::screen && !CVideo::get_singleton().update_locked()) {
show_wml_errors();
show_wml_messages();
}
Expand Down
2 changes: 1 addition & 1 deletion src/playturn.cpp
Expand Up @@ -281,7 +281,7 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg
const std::string gettext_message = vgettext("$player has left the game. What do you want to do?", t_vars);
gui2::dialogs::simple_item_selector dlg("", gettext_message, options);
dlg.set_single_button(true);
dlg.show(resources::screen->video());
dlg.show(CVideo::get_singleton());
action = dlg.selected_index();

// If esc was pressed, default to setting side to idle
Expand Down
2 changes: 1 addition & 1 deletion src/replay.cpp
Expand Up @@ -668,7 +668,7 @@ REPLAY_RETURN do_replay(bool one_move)
resources::screen->recalculate_minimap();
}

update_locker lock_update(resources::screen->video(), resources::controller->is_skipping_replay());
update_locker lock_update(CVideo::get_singleton(), resources::controller->is_skipping_replay());
return do_replay_handle(one_move);
}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/synced_user_choice.cpp
Expand Up @@ -395,7 +395,7 @@ static void wait_ingame(user_choice_manager& man)
static void wait_prestart(user_choice_manager& man)
{
gui2::dialogs::synched_choice_wait scw(man);
scw.show(resources::screen->video());
scw.show(CVideo::get_singleton());
}

std::map<int, config> user_choice_manager::get_user_choice_internal(const std::string &name, const mp_sync::user_choice &uch, const std::set<int>& sides)
Expand Down
2 changes: 1 addition & 1 deletion src/whiteboard/manager.cpp
Expand Up @@ -1090,7 +1090,7 @@ void manager::options_dlg()
}

gui2::dialogs::simple_item_selector dlg("", _("Whiteboard Options"), options);
dlg.show(resources::screen->video());
dlg.show(CVideo::get_singleton());
selection = dlg.selected_index();

if(selection == -1)
Expand Down

0 comments on commit 9ec9f8b

Please sign in to comment.