[Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.214,1.215 script_v8.cpp,2.286,2.287
kirben
kirben at users.sourceforge.net
Fri Apr 1 01:55:46 CEST 2005
- Previous message: [Scummvm-cvs-logs] CVS: scummvm TODO,1.255,1.256
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.410,2.411 script_v100he.cpp,2.107,2.108 script_v90he.cpp,2.205,2.206 sprite_he.cpp,1.114,1.115 sprite_he.h,1.30,1.31 wiz_he.cpp,2.34,2.35 wiz_he.h,2.14,2.15
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31990/scumm
Modified Files:
object.cpp script_v8.cpp
Log Message:
A random object state is possible in scumm7 too.
Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -d -r1.214 -r1.215
--- object.cpp 31 Mar 2005 21:38:33 -0000 1.214
+++ object.cpp 1 Apr 2005 09:55:16 -0000 1.215
@@ -183,10 +183,13 @@
if (!imhd)
return 0;
- if (_version == 8)
+ if (_version == 8) {
return (READ_LE_UINT32(&imhd->v8.image_count));
- else
+ } else if (_version == 7) {
+ return(READ_LE_UINT16(&imhd->v7.image_count));
+ } else {
return (READ_LE_UINT16(&imhd->old.image_count));
+ }
}
int ScummEngine::whereIsObject(int object) const {
@@ -1373,12 +1376,27 @@
return;
}
- if (x != -1) {
+ if (x != -1 && x != 0x7FFFFFFF) {
_objs[i].x_pos = x * 8;
_objs[i].y_pos = y * 8;
}
addObjectToDrawQue(i);
+ if (_version >= 7) {
+ int imagecount;
+ if (state == 0xFF) {
+ state = getState(obj);
+ imagecount = getObjectImageCount(obj);
+
+ if (state < imagecount)
+ state++;
+ else
+ state = 1;
+ }
+
+ if (state == 0xFE)
+ state = _rnd.getRandomNumber(getObjectImageCount(obj));
+ }
putState(obj, state);
}
Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.286
retrieving revision 2.287
diff -u -d -r2.286 -r2.287
--- script_v8.cpp 31 Mar 2005 21:38:59 -0000 2.286
+++ script_v8.cpp 1 Apr 2005 09:55:17 -0000 2.287
@@ -1501,35 +1501,7 @@
int y = pop();
int x = pop();
int obj = pop();
- int objnum = getObjectIndex(obj);
- int imagecount;
- ObjectData *od;
-
- if (objnum == -1)
- return;
-
- od = &_objs[objnum];
- if (x != 0x7FFFFFFF) {
- od->x_pos = x;
- od->y_pos = y;
- }
-
- addObjectToDrawQue(objnum);
-
- if (state == 0xFF) {
- state = getState(obj);
- imagecount = getObjectImageCount(obj);
-
- if (state < imagecount)
- state++;
- else
- state = 1;
- }
-
- if (state == 0xFE)
- state = _rnd.getRandomNumber(getObjectImageCount(obj));
-
- putState(obj, state);
+ setObjectState(obj, state, x, y);
}
} // End of namespace Scumm
- Previous message: [Scummvm-cvs-logs] CVS: scummvm TODO,1.255,1.256
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.410,2.411 script_v100he.cpp,2.107,2.108 script_v90he.cpp,2.205,2.206 sprite_he.cpp,1.114,1.115 sprite_he.h,1.30,1.31 wiz_he.cpp,2.34,2.35 wiz_he.h,2.14,2.15
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list