From eaff9344a457d14a90175d8fe613d0cd952290f9 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 9 Jul 2006 09:40:44 +0000 Subject: Added OSystem::setFocusRectangle (first part of Nintendo DS patch) svn-id: r23449 --- engines/sky/logic.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engines/sky/logic.cpp') diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp index 7d2d91f9b6..bbe01a5576 100644 --- a/engines/sky/logic.cpp +++ b/engines/sky/logic.cpp @@ -22,6 +22,7 @@ #include "common/stdafx.h" #include "common/endian.h" +#include "common/rect.h" #include "sky/autoroute.h" #include "sky/compact.h" @@ -2512,6 +2513,17 @@ void Logic::stdSpeak(Compact *target, uint32 textNum, uint32 animNum, uint32 bas if (SkyEngine::isCDVersion()) speechFileFound = _skySound->startSpeech((uint16)textNum); + + // Calculate the point where the character is + int x = (((uint32) (target->xcood)) * GAME_SCREEN_WIDTH) >> 9; + int y = ((((uint32) (target->ycood)) * GAME_SCREEN_HEIGHT) >> 9); + + // Set the focus region to that area + // 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); + + if ((SkyEngine::_systemVars.systemFlags & SF_ALLOW_TEXT) || !speechFileFound) { // form the text sprite, if player wants subtitles or // if we couldn't find the speech file -- cgit v1.2.3