From 6b2a17a2ccb1a0d45489208f7f23b9d6a65b110d Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 23 Mar 2022 22:57:42 +0100 Subject: 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. --- Stars45/Sim.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Stars45/Sim.cpp') diff --git a/Stars45/Sim.cpp b/Stars45/Sim.cpp index 910a778..ccfab62 100644 --- a/Stars45/Sim.cpp +++ b/Stars45/Sim.cpp @@ -65,6 +65,7 @@ #include "NetData.h" #include "Game.h" +#include "Clock.h" #include "ContentBundle.h" #include "Sound.h" #include "Bolt.h" @@ -395,7 +396,7 @@ Sim::ExecMission() } first_frame = true; - start_time = Game::GetInstance()->GetClock()->GameTime(); + start_time = Clock::GetInstance()->GameTime(); AudioConfig::SetTraining(mission->Type() == Mission::TRAINING); } @@ -1896,7 +1897,7 @@ Sim::ProcessEventTrigger(int type, int event_id, const char* ship, int param) double Sim::MissionClock() const { - return (Game::GetInstance()->GetClock()->GameTime() - start_time) / 1000.0; + return (Clock::GetInstance()->GameTime() - start_time) / 1000.0; } // +--------------------------------------------------------------------+ @@ -1933,7 +1934,7 @@ Sim::SkipCutscene() double skip_time = end_time - MissionClock(); if (skip_time > 0) { - Game::GetInstance()->GetClock()->SkipGameTime(skip_time); + Clock::GetInstance()->SkipGameTime(skip_time); } } } @@ -1987,7 +1988,7 @@ Sim::ResolveTimeSkip(double seconds) player_ship->SetControls(0); } - Game::GetInstance()->GetClock()->SkipGameTime(skipped); + Clock::GetInstance()->SkipGameTime(skipped); CameraDirector::SetCameraMode(CameraDirector::MODE_COCKPIT); } @@ -2510,7 +2511,7 @@ SimRegion::ExecFrame(double secs) // DON'T REALLY KNOW WHAT PURPOSE THIS SERVES.... if (!active) { double max_frame = 3 * Game::GetInstance()->GetMaxFrameLength(); - long new_time = Game::GetInstance()->GetClock()->GameTime(); + long new_time = Clock::GetInstance()->GameTime(); double delta = new_time - sim_time; seconds = delta / 1000.0; @@ -2518,7 +2519,7 @@ SimRegion::ExecFrame(double secs) seconds = max_frame; } - sim_time = Game::GetInstance()->GetClock()->GameTime(); + sim_time = Clock::GetInstance()->GameTime(); if (orbital_region) location = orbital_region->Location(); @@ -3798,7 +3799,7 @@ const char* FormatGameTime() { static char txt[64]; - int t = Game::GetInstance()->GetClock()->GameTime(); + int t = Clock::GetInstance()->GameTime(); int h = ( t / 3600000); int m = ((t - h*3600000) / 60000); -- cgit v1.1