summaryrefslogtreecommitdiffhomepage
path: root/Stars45/Mfd.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-03-23 22:57:42 +0100
committerAki <please@ignore.pl>2022-03-23 22:57:42 +0100
commit6b2a17a2ccb1a0d45489208f7f23b9d6a65b110d (patch)
tree0c0c86871cdd51462617a946a9f35fe3501bd6a7 /Stars45/Mfd.cpp
parent9f9f2456d5ee0091bf171fae3ad321f82e5f2ca4 (diff)
downloadstarshatter-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/Mfd.cpp')
-rw-r--r--Stars45/Mfd.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/Stars45/Mfd.cpp b/Stars45/Mfd.cpp
index cf50bd9..849c151 100644
--- a/Stars45/Mfd.cpp
+++ b/Stars45/Mfd.cpp
@@ -48,6 +48,7 @@
#include "Keyboard.h"
#include "Mouse.h"
#include "Game.h"
+#include "Clock.h"
#include "ContentBundle.h"
static Bitmap sensor_fov;
@@ -1087,7 +1088,7 @@ MFD::DrawGameMFD()
int t = 0;
if (!HUDView::IsArcade() && HUDView::ShowFPS()) {
- sprintf_s(txt, "FPS: %6.2f", Game::GetInstance()->GetClock()->Rate());
+ sprintf_s(txt, "FPS: %6.2f", Clock::GetInstance()->Rate());
DrawMFDText(t++, txt, txt_rect, DT_LEFT);
txt_rect.y += 10;
@@ -1106,9 +1107,9 @@ MFD::DrawGameMFD()
if (lines <= 2) return;
- int hours = (Game::GetInstance()->GetClock()->GameTime() / 3600000) ;
- int minutes = (Game::GetInstance()->GetClock()->GameTime() / 60000) % 60;
- int seconds = (Game::GetInstance()->GetClock()->GameTime() / 1000) % 60;
+ int hours = (Clock::GetInstance()->GameTime() / 3600000) ;
+ int minutes = (Clock::GetInstance()->GameTime() / 60000) % 60;
+ int seconds = (Clock::GetInstance()->GameTime() / 1000) % 60;
if (ship) {
DWORD clock = ship->MissionClock();
@@ -1118,8 +1119,8 @@ MFD::DrawGameMFD()
seconds = (clock / 1000) % 60;
}
- if (static_cast<int>(Game::GetInstance()->GetClock()->TimeCompression()) != 1)
- sprintf_s(txt, "%02d:%02d:%02d x%.1f", hours, minutes, seconds, Game::GetInstance()->GetClock()->TimeCompression()); //-V576
+ if (static_cast<int>(Clock::GetInstance()->TimeCompression()) != 1)
+ sprintf_s(txt, "%02d:%02d:%02d x%.1f", hours, minutes, seconds, Clock::GetInstance()->TimeCompression()); //-V576
else
sprintf_s(txt, "%02d:%02d:%02d", hours, minutes, seconds);
@@ -1282,7 +1283,7 @@ MFD::DrawStatusMFD()
sprintf_s(txt, "%s %d", ContentBundle::GetInstance()->GetText("MFD.status.MODE").data(), ship->GetEMCON());
if (!sensor->IsPowerOn() || sensor->GetEnergy() == 0) {
- if (!Game::GetInstance()->Paused() && (Game::GetInstance()->GetClock()->RealTime()/1000) & 2)
+ if (!Game::GetInstance()->Paused() && (Clock::GetInstance()->RealTime()/1000) & 2)
strcpy_s(txt, ContentBundle::GetInstance()->GetText("MFD.status.SENSOR-OFF").data());
}