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/FighterAI.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Stars45/FighterAI.cpp') diff --git a/Stars45/FighterAI.cpp b/Stars45/FighterAI.cpp index 12f1746..c394cca 100644 --- a/Stars45/FighterAI.cpp +++ b/Stars45/FighterAI.cpp @@ -33,7 +33,7 @@ #include "RadioMessage.h" #include "RadioTraffic.h" -#include "Game.h" +#include "Clock.h" #include "ContentBundle.h" static const double TIME_TO_DOCK = 30; @@ -1563,8 +1563,8 @@ FighterAI::EvadeThreat() // jink for one second: else { - if (Game::GetInstance()->GetClock()->GameTime() - jink_time > 1500) { - jink_time = Game::GetInstance()->GetClock()->GameTime(); + if (Clock::GetInstance()->GameTime() - jink_time > 1500) { + jink_time = Clock::GetInstance()->GameTime(); jink = Point(rand() - 16384, rand() - 16384, rand() - 16384) * 15e3; @@ -1587,8 +1587,8 @@ FighterAI::EvadeThreat() // jink for one second: else { - if (Game::GetInstance()->GetClock()->GameTime() - jink_time > 1000) { - jink_time = Game::GetInstance()->GetClock()->GameTime(); + if (Clock::GetInstance()->GameTime() - jink_time > 1000) { + jink_time = Clock::GetInstance()->GameTime(); jink = Point(rand() - 16384, rand() - 16384, rand() - 16384); @@ -1647,8 +1647,8 @@ FighterAI::EvadeThreat() if (!target) { DWORD jink_rate = 400 + 200 * (3-ai_level); - if (Game::GetInstance()->GetClock()->GameTime() - jink_time > jink_rate) { - jink_time = Game::GetInstance()->GetClock()->GameTime(); + if (Clock::GetInstance()->GameTime() - jink_time > jink_rate) { + jink_time = Clock::GetInstance()->GameTime(); jink = Point(rand() - 16384, rand() - 16384, rand() - 16384) * 2000; @@ -1777,7 +1777,7 @@ FighterAI::FireControl() if (ship->FireSecondary()) { missile_time = secondary->Design()->salvo_delay + extra_time; - if (Game::GetInstance()->GetClock()->GameTime() - last_call_time > 6000) { + if (Clock::GetInstance()->GameTime() - last_call_time > 6000) { // call fox: int call = RadioMessage::FOX_3; // A2A @@ -1788,7 +1788,7 @@ FighterAI::FireControl() call = RadioMessage::FOX_2; RadioTraffic::SendQuickMessage(ship, call); - last_call_time = Game::GetInstance()->GetClock()->GameTime(); + last_call_time = Clock::GetInstance()->GameTime(); } } } -- cgit v1.1