mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-26 13:13:50 +00:00
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:
parent
086f32174f
commit
74f0ba010a
3 changed files with 23 additions and 20 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue