aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/BFader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/BFader.cpp')
-rw-r--r--engines/wintermute/BFader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/wintermute/BFader.cpp b/engines/wintermute/BFader.cpp
index f64023a08d..955f0252f5 100644
--- a/engines/wintermute/BFader.cpp
+++ b/engines/wintermute/BFader.cpp
@@ -30,6 +30,7 @@
#include "BFader.h"
#include "BGame.h"
#include "PlatformSDL.h"
+#include "common/util.h"
namespace WinterMute {
@@ -73,7 +74,7 @@ HRESULT CBFader::Update() {
else {
m_CurrentAlpha = m_SourceAlpha + (float)time / (float)m_Duration * AlphaDelta;
}
- m_CurrentAlpha = MIN(255, std::max(m_CurrentAlpha, (byte )0));
+ m_CurrentAlpha = MIN((unsigned char)255, MAX(m_CurrentAlpha, (byte )0)); // TODO: clean
m_Ready = time >= m_Duration;
if (m_Ready && m_CurrentAlpha == 0x00) m_Active = false;