aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/actor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/actor.cpp')
-rw-r--r--engines/scumm/actor.cpp15
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