Skip to content

Commit e583d99

Browse files
committed
Slight tweaks
1 parent 89a29af commit e583d99

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Source/Entities/MovableObject.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,27 +395,27 @@ namespace RTE {
395395

396396
/// Gets the starting strength of this MovableObject's effect as a float.
397397
/// @return The starting strength of the effect, 0.0-1.0.
398-
float GetEffectStartStrengthFloat() const { return (float)m_EffectStartStrength / 255.0f; }
398+
float GetEffectStartStrengthFloat() const { return static_cast<float>(m_EffectStartStrength) / 255.0f; }
399399

400400
/// Sets the starting strength of this MovableObject's effect.
401401
/// @param strength The new starting strength of the effect, 0.0-1.0.
402-
void SetEffectStartStrengthFloat(float strength) { m_EffectStartStrength = std::floor((float)255 * strength); }
402+
void SetEffectStartStrengthFloat(float strength) { m_EffectStartStrength = std::floor(255.0F * strength); }
403403

404404
/// Gets the stopping strength of this MovableObject's effect.
405405
/// @return The stopping strength of the effect, 0-255.
406406
int GetEffectStopStrength() const { return m_EffectStopStrength; }
407407

408408
/// Gets the stopping strength of this MovableObject's effect as a float.
409409
/// @return The stopping strength of the effect, 0.0-1.0.
410-
float GetEffectStopStrengthFloat() const { return (float)m_EffectStopStrength / 255.0f; }
410+
float GetEffectStopStrengthFloat() const { return static_cast<float>(m_EffectStopStrength) / 255.0f; }
411411

412412
/// Sets the stopping strength of this MovableObject's effect.
413413
/// @param strength The new stopping strength of the effect, 0.0-1.0.
414-
void SetEffectStopStrengthFloat(float strength) { m_EffectStopStrength = std::floor((float)255 * strength); }
414+
void SetEffectStopStrengthFloat(float strength) { m_EffectStopStrength = std::floor(255.0F * strength); }
415415

416416
/// Sets both strengths of this MovableObject's effect.
417417
/// @param strength The new strengths of the effect, 0.0-1.0.
418-
void SetEffectStrength(float strength) { m_EffectStartStrength = m_EffectStopStrength = std::floor((float)255 * strength); }
418+
void SetEffectStrength(float strength) { m_EffectStartStrength = m_EffectStopStrength = std::floor(255.0F * strength); }
419419

420420
/// Gets whether or not this MovableObject's effect is drawn every frame.
421421
/// @return Boolean indicating whether or not the effect is drawn.

0 commit comments

Comments
 (0)