From e0dd50e4314a36fd99da0a7342b5ad88f449d33e Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 9 Mar 2022 20:29:54 +0100 Subject: Changed to access Pause through Game rather than derived classes --- Stars45/GameScreen.cpp | 20 ++++++++++---------- Stars45/NetGameServer.cpp | 7 +++---- Stars45/QuitView.cpp | 4 ++-- 3 files changed, 15 insertions(+), 16 deletions(-) (limited to 'Stars45') diff --git a/Stars45/GameScreen.cpp b/Stars45/GameScreen.cpp index 60382b1..353db2d 100644 --- a/Stars45/GameScreen.cpp +++ b/Stars45/GameScreen.cpp @@ -817,7 +817,7 @@ GameScreen::ShowAudDlg() if (auddlg) { if (quit_view) { quit_view->CloseMenu(); - Starshatter::GetInstance()->Pause(true); + Game::GetInstance()->Pause(true); } HideAll(); @@ -865,7 +865,7 @@ GameScreen::ShowVidDlg() if (viddlg) { if (quit_view) { quit_view->CloseMenu(); - Starshatter::GetInstance()->Pause(true); + Game::GetInstance()->Pause(true); } HideAll(); @@ -913,7 +913,7 @@ GameScreen::ShowOptDlg() if (optdlg) { if (quit_view) { quit_view->CloseMenu(); - Starshatter::GetInstance()->Pause(true); + Game::GetInstance()->Pause(true); } HideAll(); @@ -961,7 +961,7 @@ GameScreen::ShowModDlg() if (moddlg) { if (quit_view) { quit_view->CloseMenu(); - Starshatter::GetInstance()->Pause(true); + Game::GetInstance()->Pause(true); } HideAll(); @@ -1009,7 +1009,7 @@ GameScreen::ShowModInfoDlg() if (moddlg && modInfoDlg) { if (quit_view) { quit_view->CloseMenu(); - Starshatter::GetInstance()->Pause(true); + Game::GetInstance()->Pause(true); } HideAll(); @@ -1053,7 +1053,7 @@ GameScreen::ShowCtlDlg() if (ctldlg) { if (quit_view) { quit_view->CloseMenu(); - Starshatter::GetInstance()->Pause(true); + Game::GetInstance()->Pause(true); } HideAll(); @@ -1101,7 +1101,7 @@ GameScreen::ShowKeyDlg() if (keydlg) { if (quit_view) { quit_view->CloseMenu(); - Starshatter::GetInstance()->Pause(true); + Game::GetInstance()->Pause(true); } HideAll(); @@ -1137,7 +1137,7 @@ GameScreen::ShowJoyDlg() if (joydlg) { if (quit_view) { quit_view->CloseMenu(); - Starshatter::GetInstance()->Pause(true); + Game::GetInstance()->Pause(true); } HideAll(); @@ -1224,7 +1224,7 @@ GameScreen::ApplyOptions() Mouse::Show(false); screen->AddWindow(gamewin); - Starshatter::GetInstance()->Pause(false); + Game::GetInstance()->Pause(false); } void @@ -1248,5 +1248,5 @@ GameScreen::CancelOptions() Mouse::Show(false); screen->AddWindow(gamewin); - Starshatter::GetInstance()->Pause(false); + Game::GetInstance()->Pause(false); } diff --git a/Stars45/NetGameServer.cpp b/Stars45/NetGameServer.cpp index fe53515..9170a46 100644 --- a/Stars45/NetGameServer.cpp +++ b/Stars45/NetGameServer.cpp @@ -19,7 +19,6 @@ #include "NetUser.h" #include "NetMsg.h" #include "NetData.h" -#include "StarServer.h" #include "Ship.h" #include "ShipDesign.h" #include "Shield.h" @@ -345,9 +344,9 @@ NetGameServer::DoJoinRequest(NetMsg* msg) } if (unpause) { - StarServer* s = StarServer::GetInstance(); - if (s) - s->Pause(false); + auto game = Game::GetInstance(); + if (game) + game->Pause(false); } } } diff --git a/Stars45/QuitView.cpp b/Stars45/QuitView.cpp index bc0b348..eaebce5 100644 --- a/Stars45/QuitView.cpp +++ b/Stars45/QuitView.cpp @@ -282,7 +282,7 @@ QuitView::ShowMenu() } Button::PlaySound(Button::SND_CONFIRM); - Starshatter::GetInstance()->Pause(true); + Game::GetInstance()->Pause(true); if (mouse_con) { mouse_active = mouse_con->Active(); @@ -295,7 +295,7 @@ void QuitView::CloseMenu() { show_menu = false; - Starshatter::GetInstance()->Pause(false); + Game::GetInstance()->Pause(false); if (mouse_con) mouse_con->SetActive(mouse_active); -- cgit v1.1