summaryrefslogtreecommitdiffstats
path: root/src/render/Glass.cpp
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2020-10-18 19:57:39 +0200
committerFilip Gawin <filip.gawin@zoho.com>2020-10-18 19:57:39 +0200
commit7ae25761d5f60c78631bfafa3fc10ac7199f3039 (patch)
treecc3a451fa9a274aeda6860861a4482f32df078bd /src/render/Glass.cpp
parentFix build (diff)
downloadre3-7ae25761d5f60c78631bfafa3fc10ac7199f3039.tar
re3-7ae25761d5f60c78631bfafa3fc10ac7199f3039.tar.gz
re3-7ae25761d5f60c78631bfafa3fc10ac7199f3039.tar.bz2
re3-7ae25761d5f60c78631bfafa3fc10ac7199f3039.tar.lz
re3-7ae25761d5f60c78631bfafa3fc10ac7199f3039.tar.xz
re3-7ae25761d5f60c78631bfafa3fc10ac7199f3039.tar.zst
re3-7ae25761d5f60c78631bfafa3fc10ac7199f3039.zip
Diffstat (limited to 'src/render/Glass.cpp')
-rw-r--r--src/render/Glass.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp
index aabb6e52..0b25525e 100644
--- a/src/render/Glass.cpp
+++ b/src/render/Glass.cpp
@@ -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) );