summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/include/kurator/engine/Clock.h8
-rw-r--r--engine/src/Clock.cpp19
2 files changed, 12 insertions, 15 deletions
diff --git a/engine/include/kurator/engine/Clock.h b/engine/include/kurator/engine/Clock.h
index 4e5e7b1..6b66ab3 100644
--- a/engine/include/kurator/engine/Clock.h
+++ b/engine/include/kurator/engine/Clock.h
@@ -9,10 +9,12 @@ namespace engine
struct Clock
{
+ Clock();
+ void update();
+ float dt;
+ float ui;
+ float game = 0.0f;
float time_factor = 1.0f;
- float dt() const;
- float ui() const;
- operator float() const;
};
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;
}