aboutsummaryrefslogtreecommitdiff
path: root/src/client/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r--src/client/game.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index c34e3a415..0e86de496 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -502,7 +502,7 @@ public:
float clr[4] = {star_color.r, star_color.g, star_color.b, star_color.a};
m_star_color.set(clr, services);
- u32 animation_timer = porting::getTimeMs() % 1000000;
+ u32 animation_timer = m_client->getEnv().getFrameTime() % 1000000;
float animation_timer_f = (float)animation_timer / 100000.f;
m_animation_timer_vertex.set(&animation_timer_f, services);
m_animation_timer_pixel.set(&animation_timer_f, services);
@@ -3275,7 +3275,7 @@ PointedThing Game::updatePointedThing(
final_color_blend(&c, light_level, daynight_ratio);
// Modify final color a bit with time
- u32 timer = porting::getTimeMs() % 5000;
+ u32 timer = client->getEnv().getFrameTime() % 5000;
float timerf = (float) (irr::core::PI * ((timer / 2500.0) - 0.5));
float sin_r = 0.08f * std::sin(timerf);
float sin_g = 0.08f * std::sin(timerf + irr::core::PI * 0.5f);
@@ -3748,6 +3748,12 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
LocalPlayer *player = client->getEnv().getLocalPlayer();
/*
+ Frame time
+ */
+
+ client->getEnv().updateFrameTime();
+
+ /*
Fog range
*/