mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-07 02:35:20 +01:00
Fix last performance-type-promotion-in-math-fn problems
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user