Updated some code... for perfect transition
This commit is contained in:
parent
8a549c3fbe
commit
ff7108389b
1 changed files with 4 additions and 7 deletions
|
@ -173,13 +173,10 @@ void UpdateTransition(void)
|
||||||
{
|
{
|
||||||
transAlpha += 0.05f;
|
transAlpha += 0.05f;
|
||||||
|
|
||||||
printf("transAlpha: %f\n", transAlpha);
|
// 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
|
||||||
// TODO: Investigate this! SO WEIRD! Comparing with 1.0f does not work! Compiler optimization???
|
if (transAlpha > 1.01f)
|
||||||
if (transAlpha > 1.00001f) // Make sure alpha is greater than 1.0, to avoid last frame loading stop
|
|
||||||
{
|
{
|
||||||
printf("alpha on change: %e\n", transAlpha);
|
|
||||||
|
|
||||||
transAlpha = 1.0f;
|
transAlpha = 1.0f;
|
||||||
|
|
||||||
// Unload current screen
|
// Unload current screen
|
||||||
|
@ -272,7 +269,7 @@ void UpdateDrawFrame(void)
|
||||||
}
|
}
|
||||||
else UpdateTransition(); // Update transition (fade-in, fade-out)
|
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);
|
if (currentScreen != ENDING) UpdateMusicStream(music);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue