From 9ec9f8b32c33538040f815309abf7d5c1db81d7a Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Sun, 9 Jul 2017 23:27:24 +1100 Subject: [PATCH] Use CVideo singleton instead of resources::screen->video() --- src/actions/advancement.cpp | 4 ++-- src/formula/debugger.cpp | 2 +- src/game_events/action_wml.cpp | 4 ++-- src/game_events/pump.cpp | 2 +- src/playturn.cpp | 2 +- src/replay.cpp | 2 +- src/synced_user_choice.cpp | 2 +- src/whiteboard/manager.cpp | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/actions/advancement.cpp b/src/actions/advancement.cpp index fb1a611fd14dd..1718bd2c88c20 100644 --- a/src/actions/advancement.cpp +++ b/src/actions/advancement.cpp @@ -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); @@ -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(); diff --git a/src/formula/debugger.cpp b/src/formula/debugger.cpp index c41aef1d9fce8..69bd439e78f20 100644 --- a/src/formula/debugger.cpp +++ b/src/formula/debugger.cpp @@ -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; } diff --git a/src/game_events/action_wml.cpp b/src/game_events/action_wml.cpp index 6e6a1a8d95e0c..e3edfdbfbf738 100644 --- a/src/game_events/action_wml.cpp +++ b/src/game_events/action_wml.cpp @@ -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; } @@ -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; } diff --git a/src/game_events/pump.cpp b/src/game_events/pump.cpp index 1412a97ab40df..f07ea6dbd1890 100644 --- a/src/game_events/pump.cpp +++ b/src/game_events/pump.cpp @@ -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(); } diff --git a/src/playturn.cpp b/src/playturn.cpp index 42c0a17c82da6..5cb398690a69e 100644 --- a/src/playturn.cpp +++ b/src/playturn.cpp @@ -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 diff --git a/src/replay.cpp b/src/replay.cpp index 6ea703aca9213..ed679fa080dea 100644 --- a/src/replay.cpp +++ b/src/replay.cpp @@ -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); } /** diff --git a/src/synced_user_choice.cpp b/src/synced_user_choice.cpp index 0a9e90072eeaf..01b9c62f36414 100644 --- a/src/synced_user_choice.cpp +++ b/src/synced_user_choice.cpp @@ -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 user_choice_manager::get_user_choice_internal(const std::string &name, const mp_sync::user_choice &uch, const std::set& sides) diff --git a/src/whiteboard/manager.cpp b/src/whiteboard/manager.cpp index be25a5fea13bf..feaa7b9d1557c 100644 --- a/src/whiteboard/manager.cpp +++ b/src/whiteboard/manager.cpp @@ -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)