Tweak comparison in CFallingGlassPane::Render

This commit is contained in:
Filip Gawin 2020-10-18 19:57:39 +02:00
parent 0eb4aca1d6
commit 7ae25761d5
1 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"
#include "Glass.h"
#include "Timer.h"
@ -138,7 +138,11 @@ CFallingGlassPane::Render(void)
fwdNorm.Normalise();
uint8 alpha = CGlass::CalcAlphaWithNormal(&fwdNorm);
int32 time = clamp(CTimer::GetTimeInMilliseconds() - m_nTimer, 0, 500);
#ifdef FIX_BUGS
uint16 time = clamp(CTimer::GetTimeInMilliseconds() > m_nTimer ? CTimer::GetTimeInMilliseconds() - m_nTimer : 0u, 0u, 500u);
#else
uint16 time = clamp(CTimer::GetTimeInMilliseconds() - m_nTimer, 0, 500);
#endif
uint8 color = int32( float(alpha) * (float(time) / 500) );