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/scumm/actor.cpp | |
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/scumm/actor.cpp')
-rw-r--r-- | engines/scumm/actor.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 70dc9a2316..fb89554247 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -22,6 +22,7 @@ */ #include "common/stdafx.h" +#include "common/system.h" // for setFocusRectangle/clearFocusRectangle #include "scumm/scumm.h" #include "scumm/actor.h" #include "scumm/akos.h" @@ -844,6 +845,20 @@ int ScummEngine::getTalkingActor() { } void ScummEngine::setTalkingActor(int value) { + + if (value == 255) { + _system->clearFocusRectangle(); + } else { + // Work out the screen co-ordinates of the actor + int x = _actors[value]._pos.x - (camera._cur.x - (_screenWidth >> 1)); + int y = _actors[value]._top - (camera._cur.y - (_screenHeight >> 1)); + + // 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); + } + if (_game.id == GID_MANIAC && _game.version <= 1 && !(_game.platform == Common::kPlatformNES)) _V1TalkingActor = value; else |