aboutsummaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2018-04-04 20:49:42 +0200
committerGitHub <noreply@github.com>2018-04-04 20:49:42 +0200
commit077f231111082272359a916c3e41049aaf699151 (patch)
treea4401f7b9571a8fbee9ecce185c31d18ff24a8a5 /src/game.cpp
parent392e80e3f13c977b5499eb424fa7d65085fb08f5 (diff)
downloadhax-minetest-server-077f231111082272359a916c3e41049aaf699151.tar.gz
hax-minetest-server-077f231111082272359a916c3e41049aaf699151.zip
[clang-tidy] Promote some performance-* as a coding error (#7194)
* Promote performance-type-promotion-in-math-fn as a coding error * Promote performance-faster-string-find too (which is not problematic currently) * Same for performance-implicit-cast-in-loop * Fix remaining tidy points
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 3d11ddbaa..4dfb46a12 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -3638,12 +3638,12 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
float time_of_day_smooth = runData.time_of_day_smooth;
float time_of_day = client->getEnv().getTimeOfDayF();
- static const float maxsm = 0.05;
- static const float todsm = 0.05;
+ static const float maxsm = 0.05f;
+ static const float todsm = 0.05f;
- if (fabs(time_of_day - time_of_day_smooth) > maxsm &&
- fabs(time_of_day - time_of_day_smooth + 1.0) > maxsm &&
- fabs(time_of_day - time_of_day_smooth - 1.0) > maxsm)
+ if (std::fabs(time_of_day - time_of_day_smooth) > maxsm &&
+ std::fabs(time_of_day - time_of_day_smooth + 1.0) > maxsm &&
+ std::fabs(time_of_day - time_of_day_smooth - 1.0) > maxsm)
time_of_day_smooth = time_of_day;
if (time_of_day_smooth > 0.8 && time_of_day < 0.2)
@@ -3715,7 +3715,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
video::EFT_FOG_LINEAR,
100000 * BS,
110000 * BS,
- 0.01,
+ 0.01f,
false, // pixel fog
false // range fog
);