Browse Source

Rename setSmoothBrightness() to setBrightnessSmooth() but leave an alias.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
1092799270
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      include/engine/Light.hpp

+ 7
- 3
include/engine/Light.hpp View File

@@ -22,7 +22,7 @@ struct Light {
}

/** Emulates light decay with slow fall but immediate rise. */
void setSmoothBrightness(float brightness, float deltaTime) {
void setBrightnessSmooth(float brightness, float deltaTime) {
if (brightness < value) {
// Fade out light
const float lambda = 30.f;
@@ -33,9 +33,13 @@ struct Light {
value = brightness;
}
}
/** Alias for setBrightnessSmooth() */
void setSmoothBrightness(float brightness, float deltaTime) {
setBrightnessSmooth(brightness, deltaTime);
}

/** Use `setSmoothBrightness(brightness, sampleTime * frames)` instead. */
DEPRECATED void setBrightnessSmooth(float brightness, float frames = 1.f) {
/** Use `setBrightnessSmooth(brightness, sampleTime * frames)` instead. */
DEPRECATED void setBrightnessSmooth(float brightness, int frames = 1) {
setSmoothBrightness(brightness, frames / 44100.f);
}
};


Loading…
Cancel
Save