[Scummvm-cvs-logs] SF.net SVN: scummvm:[53806] scummvm/trunk/engines/scumm
Kirben at users.sourceforge.net
Kirben at users.sourceforge.net
Mon Oct 25 10:03:57 CEST 2010
Revision: 53806
http://scummvm.svn.sourceforge.net/scummvm/?rev=53806&view=rev
Author: Kirben
Date: 2010-10-25 08:03:55 +0000 (Mon, 25 Oct 2010)
Log Message:
-----------
SCUMM: Add patch #3093541 - MMC64: Actor Walk / Object Fix.
Modified Paths:
--------------
scummvm/trunk/engines/scumm/actor.cpp
scummvm/trunk/engines/scumm/object.cpp
scummvm/trunk/engines/scumm/script_v0.cpp
scummvm/trunk/engines/scumm/script_v2.cpp
scummvm/trunk/engines/scumm/scumm.cpp
scummvm/trunk/engines/scumm/scumm.h
Modified: scummvm/trunk/engines/scumm/actor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/actor.cpp 2010-10-25 07:53:02 UTC (rev 53805)
+++ scummvm/trunk/engines/scumm/actor.cpp 2010-10-25 08:03:55 UTC (rev 53806)
@@ -1052,9 +1052,17 @@
// yDist must be divided by 4, as we are using 8x2 pixels
// blocks for actor coordinates).
int xDist = ABS(x - destX);
- int yDist = ABS(y - destY) / 4;
+ int yDist;
int dist;
+ // MM C64: This fixes the trunk bug (#3070065), as well
+ // as the fruit bowl, however im not sure if its
+ // the proper solution or not.
+ if( g_scumm->_game.version == 0 )
+ yDist = ABS(y - destY);
+ else
+ yDist = ABS(y - destY) / 4;
+
if (xDist < yDist)
dist = (xDist >> 1) + yDist;
else
@@ -1082,6 +1090,7 @@
abr.x = foundX;
abr.y = foundY;
abr.box = box;
+
break;
}
if (dist < bestDist) {
Modified: scummvm/trunk/engines/scumm/object.cpp
===================================================================
--- scummvm/trunk/engines/scumm/object.cpp 2010-10-25 07:53:02 UTC (rev 53805)
+++ scummvm/trunk/engines/scumm/object.cpp 2010-10-25 08:03:55 UTC (rev 53806)
@@ -315,6 +315,10 @@
return -1;
for (i = (_numLocalObjects-1); i > 0; i--) {
+ if (_game.version == 0 )
+ if( _objs[i].flags != _v0ObjectFlag )
+ continue;
+
if (_objs[i].obj_nr == object)
return i;
}
@@ -526,6 +530,9 @@
#endif
if (_objs[i].x_pos <= x && _objs[i].width + _objs[i].x_pos > x &&
_objs[i].y_pos <= y && _objs[i].height + _objs[i].y_pos > y) {
+ // MMC64: Set the object search flag
+ if (_game.version == 0)
+ _v0ObjectFlag = _objs[i].flags;
if (_game.version == 0 && _v0ObjectIndex)
return i;
else
Modified: scummvm/trunk/engines/scumm/script_v0.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v0.cpp 2010-10-25 07:53:02 UTC (rev 53805)
+++ scummvm/trunk/engines/scumm/script_v0.cpp 2010-10-25 08:03:55 UTC (rev 53806)
@@ -987,7 +987,10 @@
void ScummEngine_v0::resetSentence(bool walking) {
_activeVerb = 13;
- if (!walking) {
+ // If the actor is walking, or the screen is a keypad (no sentence verbs/objects are drawn)
+ // Then reset all active objects (stops the radio crash, bug #3077966)
+ if (!walking || !(_userState & 32)) {
+ _v0ObjectFlag = 0;
_activeInventory = 0;
_activeObject = 0;
_activeObject2 = 0;
Modified: scummvm/trunk/engines/scumm/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v2.cpp 2010-10-25 07:53:02 UTC (rev 53805)
+++ scummvm/trunk/engines/scumm/script_v2.cpp 2010-10-25 08:03:55 UTC (rev 53806)
@@ -1174,6 +1174,8 @@
int obj;
Actor *a;
+ _v0ObjectFlag = 0;
+
a = derefActor(getVarOrDirectByte(PARAM_1), "o2_walkActorToObject");
obj = getVarOrDirectWord(PARAM_2);
if (whereIsObject(obj) != WIO_NOT_FOUND) {
@@ -1182,6 +1184,7 @@
AdjustBoxResult r = a->adjustXYToBeInBox(x, y);
x = r.x;
y = r.y;
+
a->startWalkActor(x, y, dir);
}
}
Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp 2010-10-25 07:53:02 UTC (rev 53805)
+++ scummvm/trunk/engines/scumm/scumm.cpp 2010-10-25 08:03:55 UTC (rev 53806)
@@ -146,6 +146,7 @@
// Init all vars
_v0ObjectIndex = false;
_v0ObjectInInventory = false;
+ _v0ObjectFlag = 0;
_imuse = NULL;
_imuseDigital = NULL;
_musicEngine = NULL;
Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h 2010-10-25 07:53:02 UTC (rev 53805)
+++ scummvm/trunk/engines/scumm/scumm.h 2010-10-25 08:03:55 UTC (rev 53806)
@@ -593,6 +593,7 @@
bool _v0ObjectIndex; // V0 Use object index, instead of object number
bool _v0ObjectInInventory; // V0 Use object number from inventory
+ byte _v0ObjectFlag;
/* Global resource tables */
int _numVariables, _numBitVariables, _numLocalObjects;
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