aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/actor.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2007-12-20 19:00:10 +0000
committerFilippos Karapetis2007-12-20 19:00:10 +0000
commit335e9da41dfe5f019c83478f8ffe95b0a8807dd4 (patch)
treefa820c30901978a5543560d87bc16517be470a1a /engines/saga/actor.cpp
parent0e744e491b785a8983fc5f4ab35d7ec644caa45e (diff)
downloadscummvm-rg350-335e9da41dfe5f019c83478f8ffe95b0a8807dd4.tar.gz
scummvm-rg350-335e9da41dfe5f019c83478f8ffe95b0a8807dd4.tar.bz2
scummvm-rg350-335e9da41dfe5f019c83478f8ffe95b0a8807dd4.zip
Removed clamp() and used the common CLIP template instead
svn-id: r29927
Diffstat (limited to 'engines/saga/actor.cpp')
-rw-r--r--engines/saga/actor.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp
index 8e289ae4b6..93e0297343 100644
--- a/engines/saga/actor.cpp
+++ b/engines/saga/actor.cpp
@@ -1102,12 +1102,12 @@ void Actor::drawSpeech(void) {
actor = getActor(_activeSpeech.actorIds[i]);
calcScreenPosition(actor);
- textPoint.x = clamp(10, actor->_screenPosition.x - width / 2, _vm->getDisplayWidth() - 10 - width);
+ textPoint.x = CLIP(actor->_screenPosition.x - width / 2, 10, _vm->getDisplayWidth() - 10 - width);
if (_vm->getGameType() == GType_ITE)
- textPoint.y = clamp(10, actor->_screenPosition.y - 58, _vm->_scene->getHeight(true) - 10 - height);
+ textPoint.y = CLIP(actor->_screenPosition.y - 58, 10, _vm->_scene->getHeight(true) - 10 - height);
else if (_vm->getGameType() == GType_IHNM)
- textPoint.y = 10; // clamp(10, actor->_screenPosition.y - 160, _vm->_scene->getHeight(true) - 10 - height);
+ textPoint.y = 10; // CLIP(actor->_screenPosition.y - 160, 10, _vm->_scene->getHeight(true) - 10 - height);
_vm->_font->textDraw(kKnownFontScript, backBuffer, outputString, textPoint,
_activeSpeech.speechColor[i], _activeSpeech.outlineColor[i], _activeSpeech.getFontFlags(i));
@@ -1144,9 +1144,9 @@ void Actor::actorSpeech(uint16 actorId, const char **strings, int stringsCount,
dist = MIN(actor->_screenPosition.x - 10, _vm->getDisplayWidth() - 10 - actor->_screenPosition.x);
if (_vm->getGameType() == GType_ITE)
- dist = clamp(60, dist, 150);
+ dist = CLIP<int16>(dist, 60, 150);
else
- dist = clamp(120, dist, 300);
+ dist = CLIP<int16>(dist, 120, 300);
_activeSpeech.speechBox.left = actor->_screenPosition.x - dist;
_activeSpeech.speechBox.right = actor->_screenPosition.x + dist;