aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2016-08-26 20:06:00 -0500
committerColin Snover2016-09-29 19:39:16 -0500
commit3cf16c0a7f9731a88914531392628b2dc599d787 (patch)
tree1aa980305f0ca7d0c817dc34ffe9216428bb9093 /engines
parentd0517f515eb7f36ec7222f3d50f4917fbd7df5e7 (diff)
downloadscummvm-rg350-3cf16c0a7f9731a88914531392628b2dc599d787.tar.gz
scummvm-rg350-3cf16c0a7f9731a88914531392628b2dc599d787.tar.bz2
scummvm-rg350-3cf16c0a7f9731a88914531392628b2dc599d787.zip
SCI32: Explicitly instantiate MIN/MAX templates
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kvideo.cpp8
-rw-r--r--engines/sci/graphics/paint32.cpp2
-rw-r--r--engines/sci/graphics/video32.cpp6
-rw-r--r--engines/sci/sound/audio32.cpp2
4 files changed, 9 insertions, 9 deletions
diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp
index b539c84f5d..46829cceef 100644
--- a/engines/sci/engine/kvideo.cpp
+++ b/engines/sci/engine/kvideo.cpp
@@ -446,10 +446,10 @@ reg_t kPlayVMDSetBlackoutArea(EngineState *s, int argc, reg_t *argv) {
const int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
Common::Rect blackoutArea;
- blackoutArea.left = MAX((int16)0, argv[0].toSint16());
- blackoutArea.top = MAX((int16)0, argv[1].toSint16());
- blackoutArea.right = MIN(scriptWidth, (int16)(argv[2].toSint16() + 1));
- blackoutArea.bottom = MIN(scriptHeight, (int16)(argv[3].toSint16() + 1));
+ blackoutArea.left = MAX<int16>(0, argv[0].toSint16());
+ blackoutArea.top = MAX<int16>(0, argv[1].toSint16());
+ blackoutArea.right = MIN<int16>(scriptWidth, argv[2].toSint16() + 1);
+ blackoutArea.bottom = MIN<int16>(scriptHeight, argv[3].toSint16() + 1);
g_sci->_video32->getVMDPlayer().setBlackoutArea(blackoutArea);
return s->r_acc;
}
diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp
index 338b70901e..509df7c8b2 100644
--- a/engines/sci/graphics/paint32.cpp
+++ b/engines/sci/graphics/paint32.cpp
@@ -121,7 +121,7 @@ reg_t GfxPaint32::makeLineBitmap(const Common::Point &startPoint, const Common::
const uint8 skipColor = color != kDefaultSkipColor ? kDefaultSkipColor : 0;
// Thickness is expected to be 2n+1
- thickness = ((MAX((uint8)1, thickness) - 1) | 1);
+ thickness = ((MAX<uint8>(1, thickness) - 1) | 1);
const uint8 halfThickness = thickness >> 1;
outRect.left = (startPoint.x < endPoint.x ? startPoint.x : endPoint.x) - halfThickness;
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index 8b1d4ef32b..ab32a11f81 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -635,7 +635,7 @@ VMDPlayer::EventFlags VMDPlayer::kernelPlayUntilEvent(const EventFlags flags, co
const int32 maxFrameNo = (int32)(_decoder->getFrameCount() - 1);
if ((flags & kEventFlagToFrame) && lastFrameNo > 0) {
- _decoder->setEndFrame(MIN((int32)lastFrameNo, maxFrameNo));
+ _decoder->setEndFrame(MIN<int32>(lastFrameNo, maxFrameNo));
} else {
_decoder->setEndFrame(maxFrameNo);
}
@@ -645,7 +645,7 @@ VMDPlayer::EventFlags VMDPlayer::kernelPlayUntilEvent(const EventFlags flags, co
if (yieldInterval == -1 && !(flags & kEventFlagToFrame)) {
_yieldInterval = lastFrameNo;
} else if (yieldInterval != -1) {
- _yieldInterval = MIN((int32)yieldInterval, maxFrameNo);
+ _yieldInterval = MIN<int32>(yieldInterval, maxFrameNo);
}
} else {
_yieldInterval = maxFrameNo;
@@ -891,7 +891,7 @@ void VMDPlayer::restrictPalette(const uint8 startColor, const int16 endColor) {
// At least GK2 sends 256 as the end color, which is wrong,
// but works in the original engine as the storage size is 4 bytes
// and used values are clamped to 0-255
- _endColor = MIN((int16)255, endColor);
+ _endColor = MIN<int16>(255, endColor);
}
} // End of namespace Sci
diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp
index 43c21939fa..659a5265d4 100644
--- a/engines/sci/sound/audio32.cpp
+++ b/engines/sci/sound/audio32.cpp
@@ -1027,7 +1027,7 @@ int16 Audio32::getVolume(const int16 channelIndex) const {
}
void Audio32::setVolume(const int16 channelIndex, int16 volume) {
- volume = MIN((int16)kMaxVolume, volume);
+ volume = MIN<int16>(kMaxVolume, volume);
if (channelIndex == kAllChannels) {
ConfMan.setInt("sfx_volume", volume * Audio::Mixer::kMaxChannelVolume / kMaxVolume);
ConfMan.setInt("speech_volume", volume * Audio::Mixer::kMaxChannelVolume / kMaxVolume);