summaryrefslogtreecommitdiff
path: root/engine/src
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-02-11 00:54:15 +0100
committerAki <please@ignore.pl>2023-02-11 00:54:15 +0100
commitf9269a45b82f637173e30760e1f4febc7ccb2b3e (patch)
tree8077af07826bedf693aac744de15b6b5b4c87ab3 /engine/src
parent29e18d3d2918f7b1668c2bfb7d708c60aceea4bf (diff)
downloadkurator-f9269a45b82f637173e30760e1f4febc7ccb2b3e.zip
kurator-f9269a45b82f637173e30760e1f4febc7ccb2b3e.tar.gz
kurator-f9269a45b82f637173e30760e1f4febc7ccb2b3e.tar.bz2
Clock now tracks seconds since creation
Diffstat (limited to 'engine/src')
-rw-r--r--engine/src/Clock.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/engine/src/Clock.cpp b/engine/src/Clock.cpp
index 5261603..956f9c4 100644
--- a/engine/src/Clock.cpp
+++ b/engine/src/Clock.cpp
@@ -9,23 +9,18 @@ namespace engine
{
-float
-Clock::dt() const
+Clock::Clock()
{
- return GetFrameTime() * time_factor;
+ update();
}
-float
-Clock::ui() const
+void
+Clock::update()
{
- return GetFrameTime();
-}
-
-
-Clock::operator float() const
-{
- return dt();
+ ui = GetFrameTime();
+ dt = ui * time_factor;
+ game += dt;
}