fix: remove duplicate zone weather, consolidate RNG, name star constants

- weather: remove duplicate setZoneWeather(15) for Dustwallow Marsh —
  second call silently overwrote the first with different parameters
- weather: replace duplicate static RNG in getRandomPosition() with
  shared weatherRng() to avoid redundant generator state
- starfield: extract day/night cycle thresholds into named constants
  (kDuskStart/kNightStart/kDawnStart/kDawnEnd/kFadeDuration)
- skybox: replace while-loop time wrapping with std::fmod — avoids
  O(n) iterations on large time jumps
This commit is contained in:
Kelsi 2026-03-30 14:38:30 -07:00
parent 086f32174f
commit 74f0ba010a
3 changed files with 23 additions and 20 deletions

View file

@ -202,10 +202,9 @@ void Skybox::update(float deltaTime) {
}
void Skybox::setTimeOfDay(float time) {
// Clamp to 0-24 range
while (time < 0.0f) time += 24.0f;
while (time >= 24.0f) time -= 24.0f;
// Wrap to [0, 24) range using fmod instead of iterative subtraction
time = std::fmod(time, 24.0f);
if (time < 0.0f) time += 24.0f;
timeOfDay = time;
}