aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp19
-rw-r--r--scumm/script_v5.cpp4
-rw-r--r--scumm/script_v6.cpp1
3 files changed, 12 insertions, 12 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index ad9135d2d3..7c997d9b63 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -1958,6 +1958,8 @@ void Scumm::setCameraAt(int pos_x, int pos_y) {
clampCameraPos(&camera._cur);
camera._dest = camera._cur;
+ _vars[VAR_CAMERA_DEST_X] = camera._dest.x;
+ _vars[VAR_CAMERA_DEST_Y] = camera._dest.y;
assert(camera._cur.x >= (_realWidth / 2) && camera._cur.y >= (_realHeight / 2));
@@ -1996,6 +1998,7 @@ void Scumm::setCameraFollows(Actor *a) {
int ax, ay;
camera._follows = a->number;
+ _vars[VAR_CAMERA_FOLLOWED_ACTOR] = a->number;
if (!a->isInCurrentRoom()) {
startScene(a->getRoom(), 0, 0);
@@ -2072,8 +2075,8 @@ void Scumm::moveCamera() {
}
if (camera._movingToActor) {
- camera._dest.x = a->x;
- camera._dest.y = a->y;
+ _vars[VAR_CAMERA_DEST_X] = camera._dest.x = a->x;
+ _vars[VAR_CAMERA_DEST_Y] = camera._dest.y = a->y;
}
assert(camera._cur.x >= (_realWidth / 2) && camera._cur.y >= (_realHeight / 2));
@@ -2131,12 +2134,6 @@ void Scumm::moveCamera() {
_vars[VAR_CAMERA_POS_X] = camera._cur.x;
_vars[VAR_CAMERA_POS_Y] = camera._cur.y;
- _vars[VAR_CAMERA_DEST_X] = camera._dest.x;
-
- _vars[VAR_CAMERA_DEST_Y] = camera._dest.y;
-
- _vars[VAR_CAMERA_FOLLOWED_ACTOR] = camera._follows;
-
if (_vars[VAR_SCROLL_SCRIPT])
runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0);
}
@@ -2252,9 +2249,9 @@ void Scumm::cameraMoved() {
void Scumm::panCameraTo(int x, int y) {
if (_features & GF_AFTER_V7) {
- camera._follows = 0;
- camera._dest.x = x;
- camera._dest.y = y;
+ _vars[VAR_CAMERA_FOLLOWED_ACTOR] = camera._follows = 0;
+ _vars[VAR_CAMERA_DEST_X] = camera._dest.x = x;
+ _vars[VAR_CAMERA_DEST_Y] = camera._dest.y = y;
} else {
camera._dest.x = x;
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index 483885addb..30be92c18f 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -1348,7 +1348,9 @@ void Scumm_v5::o5_loadRoomWithEgo() {
startScene(a->room, a, obj);
_vars[VAR_WALKTO_OBJ] = 0;
- camera._dest.x = camera._cur.x = a->x;
+ // FIXME: Can this be removed?
+ camera._cur.x = a->x;
+
setCameraAt(a->x, a->y);
setCameraFollows(a);
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index a42397d740..6323a19352 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -953,6 +953,7 @@ void Scumm_v6::o6_setCameraAt() {
int x, y;
camera._follows = 0;
+ _vars[VAR_CAMERA_FOLLOWED_ACTOR] = 0;
y = pop();
x = pop();