From 0052edae47d1e6ae613497c524719eff5838f52a Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 18 Feb 2022 23:54:30 +0100 Subject: Switched to use GetIntance for Game instead of static methods --- Stars45/Contact.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Stars45/Contact.cpp') diff --git a/Stars45/Contact.cpp b/Stars45/Contact.cpp index d1920b6..97cba6a 100644 --- a/Stars45/Contact.cpp +++ b/Stars45/Contact.cpp @@ -34,14 +34,14 @@ Contact::Contact() : ship(0), shot(0), d_pas(0.0f), d_act(0.0f), track(0), ntrack(0), time(0), track_time(0), probe(false) { - acquire_time = Game::GameTime(); + acquire_time = Game::GetInstance()->GameTime(); } Contact::Contact(Ship* s, float p, float a) : ship(s), shot(0), d_pas(p), d_act(a), track(0), ntrack(0), time(0), track_time(0), probe(false) { - acquire_time = Game::GameTime(); + acquire_time = Game::GetInstance()->GameTime(); Observe(ship); } @@ -49,7 +49,7 @@ Contact::Contact(Shot* s, float p, float a) : ship(0), shot(s), d_pas(p), d_act(a), track(0), ntrack(0), time(0), track_time(0), probe(false) { - acquire_time = Game::GameTime(); + acquire_time = Game::GetInstance()->GameTime(); Observe(shot); } @@ -116,7 +116,7 @@ Contact::Age() const if (!ship && !shot) return age; - double seconds = (Game::GameTime() - time) / 1000.0; + double seconds = (Game::GetInstance()->GameTime() - time) / 1000.0; age = 1.0 - seconds/DEFAULT_TRACK_AGE; @@ -293,9 +293,9 @@ Contact::Visible(const Ship* observer) const void Contact::Reset() { - if (Game::Paused()) return; + if (Game::GetInstance()->Paused()) return; - float step_down = (float) (Game::FrameTime() / 10); + float step_down = (float) (Game::GetInstance()->FrameTime() / 10); if (d_pas > 0) d_pas -= step_down; @@ -327,7 +327,7 @@ Contact::ClearTrack() void Contact::UpdateTrack() { - time = Game::GameTime(); + time = Game::GetInstance()->GameTime(); if (shot || (ship && ship->IsGroundUnit())) return; -- cgit v1.1