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/HUDView.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'Stars45/HUDView.cpp') diff --git a/Stars45/HUDView.cpp b/Stars45/HUDView.cpp index f2b4b02..6846b09 100644 --- a/Stars45/HUDView.cpp +++ b/Stars45/HUDView.cpp @@ -62,6 +62,7 @@ #include "Polygon.h" #include "Sound.h" #include "Game.h" +#include "Clock.h" #include "GameWinDX9.h" #include "ContentBundle.h" #include "Window.h" @@ -864,7 +865,7 @@ HUDView::MarkerColor(Contact* contact) c = Ship::IFFColor(c_iff) * contact->Age(); if (contact->GetShot() && contact->Threat(ship)) { - if ((Game::GetInstance()->GetClock()->RealTime()/500) & 1) + if ((Clock::GetInstance()->RealTime()/500) & 1) c = c * 2; else c = c * 0.5; @@ -1464,7 +1465,7 @@ HUDView::DrawBars() else if (threat > 1) { threat_warn = ContentBundle::GetInstance()->GetText("HUDView.missile-warn"); - show_msg = ((Game::GetInstance()->GetClock()->RealTime()/500) & 1) != 0; + show_msg = ((Clock::GetInstance()->RealTime()/500) & 1) != 0; } if (show_msg) { @@ -2116,9 +2117,9 @@ HUDView::DrawTarget() System* sys = ship->GetSubTarget(); if (sys) { Color stat = hud_color; - static DWORD blink = Game::GetInstance()->GetClock()->RealTime(); + static DWORD blink = Clock::GetInstance()->RealTime(); - int blink_delta = Game::GetInstance()->GetClock()->RealTime() - blink; + int blink_delta = Clock::GetInstance()->RealTime() - blink; sprintf_s(txt, "%s %03d", sys->Abbreviation(), (int) sys->Availability()); switch (sys->Status()) { @@ -2132,7 +2133,7 @@ HUDView::DrawTarget() } if (blink_delta > 500) - blink = Game::GetInstance()->GetClock()->RealTime(); + blink = Clock::GetInstance()->RealTime(); range_rect.y += 10; DrawHUDText(TXT_TARGET_SUB, txt, range_rect, DT_RIGHT); @@ -2658,7 +2659,7 @@ HUDView::DrawWarningPanel() int y = cockpit_hud_texture ? 410 : height-97; int c = cockpit_hud_texture ? 3 : 4; - static DWORD blink = Game::GetInstance()->GetClock()->RealTime(); + static DWORD blink = Clock::GetInstance()->RealTime(); for (int index = 0; index < 12; index++) { int stat = -1; @@ -2699,7 +2700,7 @@ HUDView::DrawWarningPanel() Color tc = status_color; if (stat != System::NOMINAL) { - if (Game::GetInstance()->GetClock()->RealTime() - blink < 250) { + if (Clock::GetInstance()->RealTime() - blink < 250) { tc = cockpit_hud_texture ? txt_color : Color(8,8,8); } } @@ -2741,8 +2742,8 @@ HUDView::DrawWarningPanel() } } - if (Game::GetInstance()->GetClock()->RealTime() - blink > 500) - blink = Game::GetInstance()->GetClock()->RealTime(); + if (Clock::GetInstance()->RealTime() - blink > 500) + blink = Clock::GetInstance()->RealTime(); // reset for next time SetStatusColor(System::NOMINAL); @@ -2877,7 +2878,7 @@ HUDView::DrawMessages() // age messages: for (int i = 0; i < MAX_MSG; i++) { if (msg_time[i] > 0) { - msg_time[i] -= Game::GetInstance()->GetClock()->GuiDelta(); + msg_time[i] -= Clock::GetInstance()->GuiDelta(); if (msg_time[i] <= 0) { msg_time[i] = 0; -- cgit v1.1