From a34df6e72d298ecccdaaf881809184fc4b3f0623 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Fri, 7 Dec 2007 20:53:06 +0000 Subject: add Common::Rect::center (handy for ::setFocusRectangle()) svn-id: r29751 --- engines/scumm/actor.cpp | 3 +-- engines/sky/logic.cpp | 3 +-- engines/sword2/function.cpp | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index fd330c02bc..8e3526f9f6 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -1827,8 +1827,7 @@ void ScummEngine::setTalkingActor(int i) { // Set the focus area to the calculated position // TODO: Make the size adjust depending on what it's focusing on. - Common::Rect rect(x - 96, y - 64, x + 96, y + 64); - _system->setFocusRectangle(rect); + _system->setFocusRectangle(Common::Rect::center(x, y, 192, 128)); } if (_game.id == GID_MANIAC && _game.version <= 1 && !(_game.platform == Common::kPlatformNES)) diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp index 773e64ae97..0242b2a99e 100644 --- a/engines/sky/logic.cpp +++ b/engines/sky/logic.cpp @@ -2525,8 +2525,7 @@ void Logic::stdSpeak(Compact *target, uint32 textNum, uint32 animNum, uint32 bas int x = target->xcood - TOP_LEFT_X; int y = target->ycood - TOP_LEFT_Y; // TODO: Make the box size change based on the object that has the focus - Common::Rect rect(x - 96, y - 64, x + 96, y + 64); - _skyScreen->setFocusRectangle(rect); + _skyScreen->setFocusRectangle(Common::Rect::center(x, y, 192, 128)); if ((SkyEngine::_systemVars.systemFlags & SF_ALLOW_TEXT) || !speechFileFound) { diff --git a/engines/sword2/function.cpp b/engines/sword2/function.cpp index f09ca0cd1b..99211c3ece 100644 --- a/engines/sword2/function.cpp +++ b/engines/sword2/function.cpp @@ -925,8 +925,7 @@ int32 Logic::fnISpeak(int32 *params) { // position. if (_animId) { - Common::Rect rect(_textX - 96, _textY - 64, _textX + 96, _textY + 64); - _vm->_system->setFocusRectangle(rect); + _vm->_system->setFocusRectangle(Common::Rect::center(_textX, _textY, 192, 128)); } // Is it to be speech or subtitles or both? -- cgit v1.2.3