diff options
author | Max Horn | 2006-07-09 09:40:44 +0000 |
---|---|---|
committer | Max Horn | 2006-07-09 09:40:44 +0000 |
commit | eaff9344a457d14a90175d8fe613d0cd952290f9 (patch) | |
tree | 6ee5944ab74184e1dbd26c8716e1c88b46278f42 /engines/sky | |
parent | b3f2d299fef43460f9297c28c37d2749fdd2712a (diff) | |
download | scummvm-rg350-eaff9344a457d14a90175d8fe613d0cd952290f9.tar.gz scummvm-rg350-eaff9344a457d14a90175d8fe613d0cd952290f9.tar.bz2 scummvm-rg350-eaff9344a457d14a90175d8fe613d0cd952290f9.zip |
Added OSystem::setFocusRectangle (first part of Nintendo DS patch)
svn-id: r23449
Diffstat (limited to 'engines/sky')
-rw-r--r-- | engines/sky/logic.cpp | 12 | ||||
-rw-r--r-- | engines/sky/screen.cpp | 4 | ||||
-rw-r--r-- | engines/sky/screen.h | 4 |
3 files changed, 20 insertions, 0 deletions
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 diff --git a/engines/sky/screen.cpp b/engines/sky/screen.cpp index 1b262f5659..3cf545b001 100644 --- a/engines/sky/screen.cpp +++ b/engines/sky/screen.cpp @@ -105,6 +105,10 @@ void Screen::clearScreen(void) { _system->updateScreen(); } +void Screen::setFocusRectangle(const Common::Rect& rect) { + _system->setFocusRectangle(rect); +} + //set a new palette, pal is a pointer to dos vga rgb components 0..63 void Screen::setPalette(uint8 *pal) { diff --git a/engines/sky/screen.h b/engines/sky/screen.h index c1e504a87f..f412d31c4c 100644 --- a/engines/sky/screen.h +++ b/engines/sky/screen.h @@ -28,6 +28,9 @@ #include "sky/skydefs.h" class OSystem; +namespace Common { + struct Rect; +} namespace Sky { @@ -80,6 +83,7 @@ public: void fnFadeDown(uint32 scroll); void fnDrawScreen(uint32 palette, uint32 scroll); void clearScreen(void); + void setFocusRectangle(const Common::Rect& rect); void recreate(void); void flip(bool doUpdate = true); |