diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2018-04-04 07:42:40 +0200 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2018-04-04 07:42:40 +0200 |
commit | 8e0b80aa369df7d1142053f077df928106c6ce8c (patch) | |
tree | 7f12869eef1a18364be9d8db67e01d060bc11d60 /src/game.cpp | |
parent | a90d27e1e23fa1c369c05a4d9c6083aa86ef7f52 (diff) | |
download | minetest-8e0b80aa369df7d1142053f077df928106c6ce8c.tar.gz minetest-8e0b80aa369df7d1142053f077df928106c6ce8c.tar.bz2 minetest-8e0b80aa369df7d1142053f077df928106c6ce8c.zip |
Fix last performance-type-promotion-in-math-fn problems
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp index 9a7f4e6d7..3d11ddbaa 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3131,9 +3131,9 @@ PointedThing Game::updatePointedThing( // Modify final color a bit with time u32 timer = porting::getTimeMs() % 5000; float timerf = (float) (irr::core::PI * ((timer / 2500.0) - 0.5)); - float sin_r = 0.08 * sin(timerf); - float sin_g = 0.08 * sin(timerf + irr::core::PI * 0.5); - float sin_b = 0.08 * sin(timerf + irr::core::PI); + float sin_r = 0.08f * std::sin(timerf); + float sin_g = 0.08f * std::sin(timerf + irr::core::PI * 0.5f); + float sin_b = 0.08f * std::sin(timerf + irr::core::PI); c.setRed(core::clamp(core::round32(c.getRed() * (0.8 + sin_r)), 0, 255)); c.setGreen(core::clamp(core::round32(c.getGreen() * (0.8 + sin_g)), 0, 255)); c.setBlue(core::clamp(core::round32(c.getBlue() * (0.8 + sin_b)), 0, 255)); |