diff options
author | Aki <please@ignore.pl> | 2022-03-08 19:33:59 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-03-08 19:33:59 +0100 |
commit | e472d9537ee7919630e5f6039f8425b06f6c4213 (patch) | |
tree | c146d59b532ec1ae248727faa182102cab6365e2 /Stars45/MouseController.cpp | |
parent | b563a07d9fcaa58514eeb3ec78438db56ecf2e63 (diff) | |
download | starshatter-e472d9537ee7919630e5f6039f8425b06f6c4213.zip starshatter-e472d9537ee7919630e5f6039f8425b06f6c4213.tar.gz starshatter-e472d9537ee7919630e5f6039f8425b06f6c4213.tar.bz2 |
Replaced time funcs from Game with Clock equivalents
This excludes time compression stuff, as it will need some more
attention due to casting.
I don't quite like the long invocations that go through game instance
first then get the clock. It looks bad. I'll need to rethink how
modules are being made available in the codebase.
Diffstat (limited to 'Stars45/MouseController.cpp')
-rw-r--r-- | Stars45/MouseController.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Stars45/MouseController.cpp b/Stars45/MouseController.cpp index 1cd9504..3234dfe 100644 --- a/Stars45/MouseController.cpp +++ b/Stars45/MouseController.cpp @@ -117,11 +117,11 @@ MouseController::Acquire() roll_enable = 1; if (!rbutton_latch) - rbutton_latch = Game::GetInstance()->RealTime(); + rbutton_latch = Game::GetInstance()->GetClock()->RealTime(); } else { if (rbutton_latch) { - rbutton_latch = Game::GetInstance()->RealTime() - rbutton_latch; + rbutton_latch = Game::GetInstance()->GetClock()->RealTime() - rbutton_latch; if (rbutton_latch < 250) action[1] = 1; } @@ -131,7 +131,7 @@ MouseController::Acquire() if (Mouse::MButton()) { if (!mbutton_latch) - mbutton_latch = Game::GetInstance()->RealTime(); + mbutton_latch = Game::GetInstance()->GetClock()->RealTime(); } else { if (mbutton_latch) { @@ -187,7 +187,7 @@ MouseController::Acquire() if (select == 1) { ::SetCursorPos(cx, cy); - double drain = cx * 4 * Game::GetInstance()->FrameTime(); + double drain = cx * 4 * Game::GetInstance()->GetClock()->Delta(); if (dx > drain) { dx -= drain; |