diff options
author | Aki <please@ignore.pl> | 2022-03-23 22:57:42 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-03-23 22:57:42 +0100 |
commit | 6b2a17a2ccb1a0d45489208f7f23b9d6a65b110d (patch) | |
tree | 0c0c86871cdd51462617a946a9f35fe3501bd6a7 /Stars45/StarServer.cpp | |
parent | 9f9f2456d5ee0091bf171fae3ad321f82e5f2ca4 (diff) | |
download | starshatter-6b2a17a2ccb1a0d45489208f7f23b9d6a65b110d.zip starshatter-6b2a17a2ccb1a0d45489208f7f23b9d6a65b110d.tar.gz starshatter-6b2a17a2ccb1a0d45489208f7f23b9d6a65b110d.tar.bz2 |
Removed Clock from Game for now
While testing waters around exporting things out from Game to
GameWinDX9 I noticed that if both ContentBundle and Clock (primarily)
are removed from it, then the WinDX9 will be almost equivalent to base.
This is worrying mainly because I'm only fortified in seeing deep
relationships between various classes sadly including Video.
Diffstat (limited to 'Stars45/StarServer.cpp')
-rw-r--r-- | Stars45/StarServer.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Stars45/StarServer.cpp b/Stars45/StarServer.cpp index 98b1287..5385a6b 100644 --- a/Stars45/StarServer.cpp +++ b/Stars45/StarServer.cpp @@ -45,6 +45,7 @@ #include "MachineInfo.h" #include "Game.h" #include "GameWinDX9.h" +#include "Clock.h" #include "ContentBundle.h" #include "Keyboard.h" #include "Mouse.h" @@ -169,7 +170,7 @@ StarServer::InitGame() Shot::Initialize(); RadioTraffic::Initialize(); - time_mark = Game::GetInstance()->GetClock()->GameTime(); + time_mark = Clock::GetInstance()->GameTime(); minutes = 0; NetServerConfig* server_config = NetServerConfig::GetInstance(); @@ -221,7 +222,7 @@ StarServer::SetGameMode(int m) // stand alone server should wait for players to connect // before unpausing the simulation... - clock.SetTimeCompression(1.0); + Clock::GetInstance()->SetTimeCompression(1.0); Pause(true); } @@ -336,12 +337,12 @@ StarServer::UpdateWorld() Drive::StartFrame(); if (world) - world->ExecFrame(clock.Delta()); + world->ExecFrame(Clock::GetInstance()->Delta()); } static DWORD refresh_time = 0; - if (clock.RealTime() - refresh_time > 1000) { - refresh_time = clock.RealTime(); + if (Clock::GetInstance()->RealTime() - refresh_time > 1000) { + refresh_time = Clock::GetInstance()->RealTime(); RedrawWindow(hwnd, 0, 0, RDW_ERASE|RDW_INVALIDATE); } } @@ -370,8 +371,8 @@ StarServer::GameState() } else if (game_mode == PLAY_MODE) { - if (Game::GetInstance()->GetClock()->GameTime() - time_mark > 60000) { - time_mark = Game::GetInstance()->GetClock()->GameTime(); + if (Clock::GetInstance()->GameTime() - time_mark > 60000) { + time_mark = Clock::GetInstance()->GameTime(); minutes++; if (minutes > 60) Print(" TIME %2d:%02d:00\n", minutes/60, minutes%60); |