[Scummvm-cvs-logs] SF.net SVN: scummvm: [24742] scummvm/trunk/engines/scumm
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sun Nov 19 01:39:49 CET 2006
Revision: 24742
http://svn.sourceforge.net/scummvm/?rev=24742&view=rev
Author: fingolfin
Date: 2006-11-18 16:39:48 -0800 (Sat, 18 Nov 2006)
Log Message:
-----------
* Made Actor::_pos protected, added public Actor::getPos() method
* Added default params to Actor::putActor()
* Removed Actor::getActorXYPos
Modified Paths:
--------------
scummvm/trunk/engines/scumm/actor.cpp
scummvm/trunk/engines/scumm/actor.h
scummvm/trunk/engines/scumm/camera.cpp
scummvm/trunk/engines/scumm/debugger.cpp
scummvm/trunk/engines/scumm/gfx.cpp
scummvm/trunk/engines/scumm/he/script_v100he.cpp
scummvm/trunk/engines/scumm/he/script_v60he.cpp
scummvm/trunk/engines/scumm/he/script_v72he.cpp
scummvm/trunk/engines/scumm/object.cpp
scummvm/trunk/engines/scumm/room.cpp
scummvm/trunk/engines/scumm/script_c64.cpp
scummvm/trunk/engines/scumm/script_v2.cpp
scummvm/trunk/engines/scumm/script_v5.cpp
scummvm/trunk/engines/scumm/script_v6.cpp
scummvm/trunk/engines/scumm/script_v8.cpp
scummvm/trunk/engines/scumm/string.cpp
Modified: scummvm/trunk/engines/scumm/actor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/actor.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/actor.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -873,11 +873,18 @@
for (i = 1; i < _numActors; i++) {
a = &_actors[i];
if (a && a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
}
}
-void Actor::putActor(int dstX, int dstY, byte newRoom) {
+void Actor::putActor(int dstX, int dstY, int newRoom) {
+ if (dstX == -1)
+ dstX = _pos.x;
+ if (dstY == -1)
+ dstY = _pos.y;
+ if (newRoom == -1)
+ newRoom = _room;
+
if (_visible && _vm->_currentRoom != newRoom && _vm->getTalkingActor() == _number) {
_vm->stopTalk();
}
@@ -917,15 +924,6 @@
}
}
-int Actor::getActorXYPos(int &xPos, int &yPos) const {
- if (!isInCurrentRoom())
- return -1;
-
- xPos = _pos.x;
- yPos = _pos.y;
- return 0;
-}
-
static bool inBoxQuickReject(const BoxCoords &box, int x, int y, int threshold) {
int t;
@@ -1080,7 +1078,7 @@
for (i = 1; i < _numActors; i++) {
if (testGfxUsageBit(x / 8, i) && !getClass(i, kObjectClassUntouchable)
&& y >= _actors[i]._top && y <= _actors[i]._bottom
- && (_actors[i]._pos.y > _actors[curActor]._pos.y || curActor == 0))
+ && (_actors[i].getPos().y > _actors[curActor].getPos().y || curActor == 0))
curActor = i;
}
@@ -1230,8 +1228,8 @@
if (_game.id == GID_SAMNMAX) {
for (int j = 0; j < numactors; ++j) {
for (int i = 0; i < numactors; ++i) {
- int sc_actor1 = _sortedActors[j]->_pos.y;
- int sc_actor2 = _sortedActors[i]->_pos.y;
+ int sc_actor1 = _sortedActors[j]->getPos().y;
+ int sc_actor2 = _sortedActors[i]->getPos().y;
if (sc_actor1 == sc_actor2) {
sc_actor1 += _sortedActors[j]->_number;
sc_actor2 += _sortedActors[i]->_number;
@@ -1244,8 +1242,8 @@
} else {
for (int j = 0; j < numactors; ++j) {
for (int i = 0; i < numactors; ++i) {
- int sc_actor1 = _sortedActors[j]->_pos.y - _sortedActors[j]->_layer * 2000;
- int sc_actor2 = _sortedActors[i]->_pos.y - _sortedActors[i]->_layer * 2000;
+ int sc_actor1 = _sortedActors[j]->getPos().y - _sortedActors[j]->_layer * 2000;
+ int sc_actor2 = _sortedActors[i]->getPos().y - _sortedActors[i]->_layer * 2000;
if (sc_actor1 < sc_actor2) {
SWAP(_sortedActors[i], _sortedActors[j]);
}
@@ -1712,7 +1710,7 @@
_system->clearFocusRectangle();
} else {
// Work out the screen co-ordinates of the actor
- int x = _actors[value]._pos.x - (camera._cur.x - (_screenWidth >> 1));
+ int x = _actors[value].getPos().x - (camera._cur.x - (_screenWidth >> 1));
int y = _actors[value]._top - (camera._cur.y - (_screenHeight >> 1));
// Set the focus area to the calculated position
@@ -2170,8 +2168,8 @@
if (ae->actorNum != -1) {
Actor *a = derefActor(ae->actorNum, "postProcessAuxQueue");
const uint8 *cost = getResourceAddress(rtCostume, a->_costume);
- int dy = a->_offsY + a->_pos.y - a->getElevation();
- int dx = a->_offsX + a->_pos.x;
+ int dy = a->_offsY + a->getPos().y - a->getElevation();
+ int dx = a->_offsX + a->getPos().x;
const uint8 *akax = findResource(MKID_BE('AKAX'), cost);
assert(akax);
Modified: scummvm/trunk/engines/scumm/actor.h
===================================================================
--- scummvm/trunk/engines/scumm/actor.h 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/actor.h 2006-11-19 00:39:48 UTC (rev 24742)
@@ -46,21 +46,6 @@
MF_FROZEN = 0x80
};
-struct ActorWalkData {
- Common::Point dest; // Final destination point
- byte destbox; // Final destination box
- int16 destdir; // Final destination, direction to face at
-
- Common::Point cur; // Last position
- byte curbox; // Last box
-
- Common::Point next; // Next position on our way to the destination, i.e. our intermediate destination
-
- Common::Point point3;
- int32 deltaXFactor, deltaYFactor;
- uint16 xfrac, yfrac;
-};
-
struct CostumeData {
byte active[16];
uint16 animCounter;
@@ -96,10 +81,11 @@
static void initActorClass(ScummEngine *scumm);
-public:
+protected:
/** The position of the actor inside the virtual screen. */
Common::Point _pos;
+public:
/** HE specific: This rect is used to clip actor drawing. */
Common::Rect _clipOverride;
@@ -109,6 +95,8 @@
byte _number;
uint16 _costume;
byte _room;
+
+public:
byte _talkColor;
int _talkFrequency;
byte _talkPan;
@@ -161,6 +149,22 @@
} _heTalkQueue[16];
protected:
+ struct ActorWalkData {
+ Common::Point dest; // Final destination point
+ byte destbox; // Final destination box
+ int16 destdir; // Final destination, direction to face at
+
+ Common::Point cur; // Last position
+ byte curbox; // Last box
+
+ Common::Point next; // Next position on our way to the destination, i.e. our intermediate destination
+
+ Common::Point point3;
+ int32 deltaXFactor, deltaYFactor;
+ uint16 xfrac, yfrac;
+ };
+
+
byte _palette[256];
int _elevation;
uint16 _facing;
@@ -182,7 +186,7 @@
void showActor();
void initActor(int mode);
- void putActor(int x, int y, byte room);
+ void putActor(int x = -1, int y = -1, int room = -1);
void setActorWalkSpeed(uint newSpeedX, uint newSpeedY);
protected:
int calcMovementFactor(const Common::Point& next);
@@ -229,7 +233,9 @@
return _room == _vm->_currentRoom;
}
- int getActorXYPos(int &x, int &y) const;
+ const Common::Point &getPos() const {
+ return _pos;
+ }
int getRoom() const {
return _room;
Modified: scummvm/trunk/engines/scumm/camera.cpp
===================================================================
--- scummvm/trunk/engines/scumm/camera.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/camera.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -69,14 +69,14 @@
if (!a->isInCurrentRoom()) {
startScene(a->getRoom(), 0, 0);
camera._mode = kFollowActorCameraMode;
- camera._cur.x = a->_pos.x;
+ camera._cur.x = a->getPos().x;
setCameraAt(camera._cur.x, 0);
}
- t = a->_pos.x / 8 - _screenStartStrip;
+ t = a->getPos().x / 8 - _screenStartStrip;
if (t < camera._leftTrigger || t > camera._rightTrigger || setCamera == true)
- setCameraAt(a->_pos.x, 0);
+ setCameraAt(a->getPos().x, 0);
for (i = 1; i < _numActors; i++) {
if (_actors[i].isInCurrentRoom())
@@ -101,7 +101,7 @@
void ScummEngine::moveCamera() {
int pos = camera._cur.x;
- int actorx, t;
+ int t;
Actor *a = NULL;
camera._cur.x &= 0xFFF8;
@@ -127,7 +127,7 @@
if (camera._mode == kFollowActorCameraMode) {
a = derefActor(camera._follows, "moveCamera");
- actorx = a->_pos.x;
+ int actorx = a->getPos().x;
t = actorx / 8 - _screenStartStrip;
if (t < camera._leftTrigger || t > camera._rightTrigger) {
@@ -143,7 +143,7 @@
if (camera._movingToActor) {
a = derefActor(camera._follows, "moveCamera(2)");
- camera._dest.x = a->_pos.x;
+ camera._dest.x = a->getPos().x;
}
if (VAR_CAMERA_MIN_X != 0xFF && camera._dest.x < VAR(VAR_CAMERA_MIN_X))
@@ -162,7 +162,7 @@
}
/* a is set a bit above */
- if (camera._movingToActor && (camera._cur.x / 8) == (a->_pos.x / 8)) {
+ if (camera._movingToActor && (camera._cur.x / 8) == (a->getPos().x / 8)) {
camera._movingToActor = false;
}
@@ -262,11 +262,11 @@
startScene(a->getRoom(), 0, 0);
}
- ax = ABS(a->_pos.x - camera._cur.x);
- ay = ABS(a->_pos.y - camera._cur.y);
+ ax = ABS(a->getPos().x - camera._cur.x);
+ ay = ABS(a->getPos().y - camera._cur.y);
if (ax > VAR(VAR_CAMERA_THRESHOLD_X) || ay > VAR(VAR_CAMERA_THRESHOLD_Y) || ax > (_screenWidth / 2) || ay > (_screenHeight / 2)) {
- setCameraAt(a->_pos.x, a->_pos.y);
+ setCameraAt(a->getPos().x, a->getPos().y);
}
if (a->_number != oldfollow)
@@ -279,13 +279,13 @@
if (camera._follows) {
a = derefActor(camera._follows, "moveCamera");
- if (ABS(camera._cur.x - a->_pos.x) > VAR(VAR_CAMERA_THRESHOLD_X) ||
- ABS(camera._cur.y - a->_pos.y) > VAR(VAR_CAMERA_THRESHOLD_Y)) {
+ if (ABS(camera._cur.x - a->getPos().x) > VAR(VAR_CAMERA_THRESHOLD_X) ||
+ ABS(camera._cur.y - a->getPos().y) > VAR(VAR_CAMERA_THRESHOLD_Y)) {
camera._movingToActor = true;
if (VAR(VAR_CAMERA_THRESHOLD_X) == 0)
- camera._cur.x = a->_pos.x;
+ camera._cur.x = a->getPos().x;
if (VAR(VAR_CAMERA_THRESHOLD_Y) == 0)
- camera._cur.y = a->_pos.y;
+ camera._cur.y = a->getPos().y;
clampCameraPos(&camera._cur);
}
} else {
@@ -293,8 +293,8 @@
}
if (camera._movingToActor) {
- VAR(VAR_CAMERA_DEST_X) = camera._dest.x = a->_pos.x;
- VAR(VAR_CAMERA_DEST_Y) = camera._dest.y = a->_pos.y;
+ VAR(VAR_CAMERA_DEST_X) = camera._dest.x = a->getPos().x;
+ VAR(VAR_CAMERA_DEST_Y) = camera._dest.y = a->getPos().y;
}
assert(camera._cur.x >= (_screenWidth / 2) && camera._cur.y >= (_screenHeight / 2));
Modified: scummvm/trunk/engines/scumm/debugger.cpp
===================================================================
--- scummvm/trunk/engines/scumm/debugger.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/debugger.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -383,12 +383,12 @@
a->_ignoreBoxes = (value > 0);
DebugPrintf("Actor[%d].ignoreBoxes = %d\n", actnum, a->_ignoreBoxes);
} else if (!strcmp(argv[2], "x")) {
- a->putActor(value, a->_pos.y, a->_room);
- DebugPrintf("Actor[%d].x = %d\n", actnum, a->_pos.x);
+ a->putActor(value, -1, -1);
+ DebugPrintf("Actor[%d].x = %d\n", actnum, a->getPos().x);
_vm->_fullRedraw = true;
} else if (!strcmp(argv[2], "y")) {
- a->putActor(a->_pos.x, value, a->_room);
- DebugPrintf("Actor[%d].y = %d\n", actnum, a->_pos.y);
+ a->putActor(-1, value, -1);
+ DebugPrintf("Actor[%d].y = %d\n", actnum, a->getPos().y);
_vm->_fullRedraw = true;
} else if (!strcmp(argv[2], "_elevation")) {
a->setElevation(value);
@@ -427,7 +427,7 @@
a = &_vm->_actors[i];
if (a->_visible)
DebugPrintf("|%2d|%4d|%4d|%3d|%4d|%3d|%3d|%3d|%3d|%3d|%3d|%3d|$%08x|\n",
- a->_number, a->_pos.x, a->_pos.y, a->_width, a->getElevation(),
+ a->_number, a->getPos().x, a->getPos().y, a->_width, a->getElevation(),
a->_costume, a->_walkbox, a->_moving, a->_forceClip, a->_frame,
a->_scalex, a->getFacing(), _vm->_classData[a->_number]);
}
Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/gfx.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -1181,8 +1181,8 @@
y = _mouse.y - vs->topline;
} else {
Actor *a = derefActor(VAR(VAR_EGO), "drawFlashlight");
- x = a->_pos.x;
- y = a->_pos.y;
+ x = a->getPos().x;
+ y = a->getPos().y;
}
_flashlight.w = _flashlight.xStrips * 8;
_flashlight.h = _flashlight.yStrips * 8;
Modified: scummvm/trunk/engines/scumm/he/script_v100he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v100he.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/he/script_v100he.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -410,7 +410,7 @@
case 6:
j = pop();
i = pop();
- a->putActor(i, j, a->_room);
+ a->putActor(i, j);
break;
case 8:
a->_drawToBackBuf = false;
@@ -418,7 +418,7 @@
a->_needBgReset = true;
break;
case 9:
- a->drawActorToBackBuf(a->_pos.x, a->_pos.y);
+ a->drawActorToBackBuf(a->getPos().x, a->getPos().y);
break;
case 14:
a->_charset = pop();
@@ -534,13 +534,13 @@
a->_ignoreBoxes = 0;
a->_forceClip = 0;
if (a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
break;
case 135: // SO_IGNORE_BOXES
a->_ignoreBoxes = 1;
a->_forceClip = 0;
if (a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
break;
case 136: // SO_ACTOR_IGNORE_TURNS_OFF
a->_ignoreTurns = false;
Modified: scummvm/trunk/engines/scumm/he/script_v60he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v60he.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/he/script_v60he.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -712,13 +712,13 @@
a->_ignoreBoxes = 1;
a->_forceClip = 0;
if (a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
break;
case 96: // SO_FOLLOW_BOXES
a->_ignoreBoxes = 0;
a->_forceClip = 0;
if (a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
break;
case 97: // SO_ANIMATION_SPEED
a->setAnimSpeed(pop());
@@ -748,7 +748,7 @@
a->initActor(2);
break;
case 218:
- a->drawActorToBackBuf(a->_pos.x, a->_pos.y);
+ a->drawActorToBackBuf(a->getPos().x, a->getPos().y);
break;
case 219:
a->_drawToBackBuf = false;
Modified: scummvm/trunk/engines/scumm/he/script_v72he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v72he.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/he/script_v72he.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -1123,7 +1123,7 @@
case 65: // HE 98+
j = pop();
i = pop();
- a->putActor(i, j, a->_room);
+ a->putActor(i, j);
break;
case 68: // HE 90+
k = pop();
@@ -1205,13 +1205,13 @@
a->_ignoreBoxes = 1;
a->_forceClip = 0;
if (a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
break;
case 96: // SO_FOLLOW_BOXES
a->_ignoreBoxes = 0;
a->_forceClip = 0;
if (a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
break;
case 97: // SO_ANIMATION_SPEED
a->setAnimSpeed(pop());
@@ -1245,7 +1245,7 @@
a->initActor(2);
break;
case 218:
- a->drawActorToBackBuf(a->_pos.x, a->_pos.y);
+ a->drawActorToBackBuf(a->getPos().x, a->getPos().y);
break;
case 219:
a->_drawToBackBuf = false;
Modified: scummvm/trunk/engines/scumm/object.cpp
===================================================================
--- scummvm/trunk/engines/scumm/object.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/object.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -335,11 +335,15 @@
}
int ScummEngine::getObjectOrActorXY(int object, int &x, int &y) {
+ Actor *act;
+
if (object < _numActors) {
- Actor *act = derefActorSafe(object, "getObjectOrActorXY");
- if (act)
- return act->getActorXYPos(x, y);
- else
+ act = derefActorSafe(object, "getObjectOrActorXY");
+ if (act && act->isInCurrentRoom()) {
+ x = act->getPos().x;
+ y = act->getPos().y;
+ return 0;
+ } else
return -1;
}
@@ -347,10 +351,15 @@
case WIO_NOT_FOUND:
return -1;
case WIO_INVENTORY:
- if (_objectOwnerTable[object] < _numActors)
- return derefActor(_objectOwnerTable[object], "getObjectOrActorXY(2)")->getActorXYPos(x, y);
- else
- return -1;
+ if (_objectOwnerTable[object] < _numActors) {
+ act = derefActor(_objectOwnerTable[object], "getObjectOrActorXY(2)");
+ if (act && act->isInCurrentRoom()) {
+ x = act->getPos().x;
+ y = act->getPos().y;
+ return 0;
+ }
+ }
+ return -1;
}
getObjectXYPos(object, x, y);
return 0;
@@ -1440,7 +1449,7 @@
if (obj < _numActors) {
if (obj < 1)
return 0; /* fix for indy4's map */
- return derefActor(obj, "getObjX")->_pos.x;
+ return derefActor(obj, "getObjX")->getPos().x;
} else {
if (whereIsObject(obj) == WIO_NOT_FOUND)
return -1;
@@ -1454,7 +1463,7 @@
if (obj < _numActors) {
if (obj < 1)
return 0; /* fix for indy4's map */
- return derefActor(obj, "getObjY")->_pos.y;
+ return derefActor(obj, "getObjY")->getPos().y;
} else {
if (whereIsObject(obj) == WIO_NOT_FOUND)
return -1;
Modified: scummvm/trunk/engines/scumm/room.cpp
===================================================================
--- scummvm/trunk/engines/scumm/room.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/room.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -185,8 +185,8 @@
a->setDirection(dir + 180);
a->stopActorMoving();
if (_game.id == GID_SAMNMAX) {
- camera._cur.x = camera._dest.x = a->_pos.x;
- setCameraAt(a->_pos.x, a->_pos.y);
+ camera._cur.x = camera._dest.x = a->getPos().x;
+ setCameraAt(a->getPos().x, a->getPos().y);
}
}
@@ -206,7 +206,7 @@
} else if (_game.version >= 7) {
if (camera._follows) {
a = derefActor(camera._follows, "startScene: follows");
- setCameraAt(a->_pos.x, a->_pos.y);
+ setCameraAt(a->getPos().x, a->getPos().y);
}
}
Modified: scummvm/trunk/engines/scumm/script_c64.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_c64.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/script_c64.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -650,8 +650,8 @@
a->putActor(x, y, _currentRoom);
a->setDirection(dir + 180);
- camera._dest.x = camera._cur.x = a->_pos.x;
- setCameraAt(a->_pos.x, a->_pos.y);
+ camera._dest.x = camera._cur.x = a->getPos().x;
+ setCameraAt(a->getPos().x, a->getPos().y);
setCameraFollows(a);
_fullRedraw = true;
@@ -749,7 +749,7 @@
y = 60;
}
- a->putActor(x, y, a->_room);
+ a->putActor(x, y);
}
void ScummEngine_c64::o_pickupObject() {
Modified: scummvm/trunk/engines/scumm/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v2.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/script_v2.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -1152,7 +1152,7 @@
if (_game.id == GID_MANIAC && _game.version <= 1 && _game.platform != Common::kPlatformNES)
a->setFacing(180);
- a->putActor(x, y, a->_room);
+ a->putActor(x, y);
}
void ScummEngine_v2::o2_startScript() {
@@ -1222,7 +1222,7 @@
y = 120;
}
- a->putActor(x, y, a->_room);
+ a->putActor(x, y);
}
void ScummEngine_v2::o2_putActorInRoom() {
@@ -1380,8 +1380,8 @@
a->putActor(x2, y2, _currentRoom);
a->setDirection(dir + 180);
- camera._dest.x = camera._cur.x = a->_pos.x;
- setCameraAt(a->_pos.x, a->_pos.y);
+ camera._dest.x = camera._cur.x = a->getPos().x;
+ setCameraAt(a->getPos().x, a->getPos().y);
setCameraFollows(a);
_fullRedraw = true;
Modified: scummvm/trunk/engines/scumm/script_v5.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v5.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/script_v5.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -499,7 +499,7 @@
a->_ignoreBoxes = !(_opcode & 1);
a->_forceClip = 0;
if (a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
break;
case 22: // SO_ANIMATION_SPEED
@@ -1316,7 +1316,7 @@
int box = getVarOrDirectByte(PARAM_2);
Actor *a = derefActor(act, "o5_isActorInBox");
- if (!checkXYInBoxBounds(box, a->_pos.x, a->_pos.y))
+ if (!checkXYInBoxBounds(box, a->getPos().x, a->getPos().y))
o5_jumpRelative();
else
ignoreScriptWord();
@@ -1475,7 +1475,7 @@
a = derefActor(VAR(VAR_EGO), "o5_loadRoomWithEgo");
- a->putActor(a->_pos.x, a->_pos.y, room);
+ a->putActor(a->getPos().x, a->getPos().y, room);
oldDir = a->getFacing();
_egoPositioned = false;
@@ -1499,9 +1499,9 @@
}
// This is based on disassembly
- camera._cur.x = camera._dest.x = a->_pos.x;
+ camera._cur.x = camera._dest.x = a->getPos().x;
if ((_game.id == GID_ZAK || _game.id == GID_LOOM) && (_game.platform == Common::kPlatformFMTowns)) {
- setCameraAt(a->_pos.x, a->_pos.y);
+ setCameraAt(a->getPos().x, a->getPos().y);
}
setCameraFollows(a);
@@ -1621,7 +1621,7 @@
a = derefActor(getVarOrDirectByte(PARAM_1), "o5_putActor");
x = getVarOrDirectWord(PARAM_2);
y = getVarOrDirectWord(PARAM_3);
- a->putActor(x, y, a->_room);
+ a->putActor(x, y);
}
void ScummEngine_v5::o5_putActorAtObject() {
@@ -1636,7 +1636,7 @@
x = 240;
y = 120;
}
- a->putActor(x, y, a->_room);
+ a->putActor(x, y);
}
void ScummEngine_v5::o5_putActorInRoom() {
@@ -2623,9 +2623,9 @@
dist = a->_scalex * a->_width / 0xFF;
dist += (a2->_scalex * a2->_width / 0xFF) / 2;
}
- x = a2->_pos.x;
- y = a2->_pos.y;
- if (x < a->_pos.x)
+ x = a2->getPos().x;
+ y = a2->getPos().y;
+ if (x < a->getPos().x)
x += dist;
else
x -= dist;
Modified: scummvm/trunk/engines/scumm/script_v6.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v6.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/script_v6.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -1204,9 +1204,9 @@
dist = a2->_scalex * a2->_width / 0xFF;
dist += dist / 2;
}
- x = a2->_pos.x;
- y = a2->_pos.y;
- if (x < a->_pos.x)
+ x = a2->getPos().x;
+ y = a2->getPos().y;
+ if (x < a->getPos().x)
x += dist;
else
x -= dist;
@@ -1349,7 +1349,7 @@
VAR(VAR_WALKTO_OBJ) = 0;
if (_game.version == 6) {
- camera._cur.x = camera._dest.x = a->_pos.x;
+ camera._cur.x = camera._dest.x = a->getPos().x;
setCameraFollows(a, (_game.heversion >= 60));
}
@@ -1455,7 +1455,7 @@
void ScummEngine_v6::o6_isActorInBox() {
int box = pop();
Actor *a = derefActor(pop(), "o6_isActorInBox");
- push(checkXYInBoxBounds(box, a->_pos.x, a->_pos.y));
+ push(checkXYInBoxBounds(box, a->getPos().x, a->getPos().y));
}
void ScummEngine_v6::o6_getActorLayer() {
@@ -1866,13 +1866,13 @@
a->_ignoreBoxes = 1;
a->_forceClip = (_game.version >= 7) ? 100 : 0;
if (a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
break;
case 96: // SO_FOLLOW_BOXES
a->_ignoreBoxes = 0;
a->_forceClip = (_game.version >= 7) ? 100 : 0;
if (a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
break;
case 97: // SO_ANIMATION_SPEED
a->setAnimSpeed(pop());
Modified: scummvm/trunk/engines/scumm/script_v8.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v8.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/script_v8.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -963,13 +963,13 @@
a->_ignoreBoxes = true;
a->_forceClip = 100;
if (a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
break;
case 0x77: // SO_ACTOR_FOLLOW_BOXES Make actor follow boxes
a->_ignoreBoxes = false;
a->_forceClip = 100;
if (a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->_room);
+ a->putActor();
break;
case 0x78: // SO_ACTOR_SPECIAL_DRAW
a->_shadowMode = pop();
Modified: scummvm/trunk/engines/scumm/string.cpp
===================================================================
--- scummvm/trunk/engines/scumm/string.cpp 2006-11-19 00:38:37 UTC (rev 24741)
+++ scummvm/trunk/engines/scumm/string.cpp 2006-11-19 00:39:48 UTC (rev 24742)
@@ -432,8 +432,8 @@
if (a && _string[0].overhead != 0) {
int s;
- _string[0].xpos = a->_pos.x - virtscr[0].xstart;
- _string[0].ypos = a->_pos.y - a->getElevation() - _screenTop;
+ _string[0].xpos = a->getPos().x - virtscr[0].xstart;
+ _string[0].ypos = a->getPos().y - a->getElevation() - _screenTop;
if (_game.version <= 5) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list