diff options
| author | Ray <[email protected]> | 2017-01-25 00:44:04 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2017-01-25 00:44:04 +0100 |
| commit | ff7108389b61ff0f23303ee212f695fe61c42178 (patch) | |
| tree | 84c6f112a4011a6a20584ce920f656c4ec104448 /games | |
| parent | 8a549c3fbef95c0d66d98237f9ceeafea230e775 (diff) | |
| download | raylib-ff7108389b61ff0f23303ee212f695fe61c42178.tar.gz raylib-ff7108389b61ff0f23303ee212f695fe61c42178.zip | |
Updated some code... for perfect transition
Diffstat (limited to 'games')
| -rw-r--r-- | games/wave_collector/wave_collector.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/games/wave_collector/wave_collector.c b/games/wave_collector/wave_collector.c index d4707bed..76370319 100644 --- a/games/wave_collector/wave_collector.c +++ b/games/wave_collector/wave_collector.c @@ -173,13 +173,10 @@ void UpdateTransition(void) { transAlpha += 0.05f; - printf("transAlpha: %f\n", transAlpha); - - // TODO: Investigate this! SO WEIRD! Comparing with 1.0f does not work! Compiler optimization??? - if (transAlpha > 1.00001f) // Make sure alpha is greater than 1.0, to avoid last frame loading stop + // NOTE: Due to float internal representation, condition jumps on 1.0f instead of 1.05f + // For that reason we compare against 1.01f, to avoid last frame loading stop + if (transAlpha > 1.01f) { - printf("alpha on change: %e\n", transAlpha); - transAlpha = 1.0f; // Unload current screen @@ -272,7 +269,7 @@ void UpdateDrawFrame(void) } else UpdateTransition(); // Update transition (fade-in, fade-out) - // TODO: Review! It breaks the game sometimes!!! + // TODO: Review! It breaks the game... issues with audio buffering... if (currentScreen != ENDING) UpdateMusicStream(music); //---------------------------------------------------------------------------------- |
