summaryrefslogtreecommitdiffstats
path: root/src/render/Glass.cpp
diff options
context:
space:
mode:
authorNikolay <nickvnuk@gmail.com>2020-12-19 17:15:52 +0100
committerGitHub <noreply@github.com>2020-12-19 17:15:52 +0100
commit867133e93d57dba5319bb13abeeb3f73bbaf6ae1 (patch)
treee16891b3bd62f38bc959c295ebeca1aa6b9952d7 /src/render/Glass.cpp
parentsilly mistake (diff)
parentfixed cmakelists (diff)
downloadre3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.gz
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.bz2
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.lz
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.xz
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.zst
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.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 536d94e0..a11495a9 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"
@@ -150,7 +150,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) );