[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.10,2.11 object.cpp,1.38,1.39 scummvm.cpp,2.23,2.24
Max Horn
fingolfin at users.sourceforge.net
Mon Dec 30 19:27:02 CET 2002
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.37,1.38 resource.cpp,1.46,1.47 scumm.h,1.121,1.122 scummvm.cpp,2.22,2.23
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.39,1.40 scummvm.cpp,2.24,2.25 verbs.cpp,1.16,1.17
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv9954
Modified Files:
gfx.cpp object.cpp scummvm.cpp
Log Message:
implemented object drawing (still somewhat broken, we get a 'green screen' effetc :-). Oh yes, this probably breaks save game compatibility for COMI. Oh yeah. As if I would care <g>
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.10
retrieving revision 2.11
diff -u -d -r2.10 -r2.11
--- gfx.cpp 30 Dec 2002 14:23:04 -0000 2.10
+++ gfx.cpp 31 Dec 2002 03:26:02 -0000 2.11
@@ -62,14 +62,6 @@
0, 1 * 2, 2 * 2, 1 * 2, 0 * 2, 2 * 2, 3 * 2, 1 * 2
};
-static const uint32 zplane_tags[] = {
- MKID('ZP00'),
- MKID('ZP01'),
- MKID('ZP02'),
- MKID('ZP03'),
- MKID('ZP04')
-};
-
static const int8 screen_eff7_table1[4][16] = {
{ 1, 1, -1, 1, -1, 1, -1, -1,
1, -1, -1, -1, 1, 1, 1, -1},
@@ -805,6 +797,8 @@
CHECK_HEAP;
if (_vm->_features & GF_SMALL_HEADER)
smap_ptr = ptr;
+ else if (_vm->_features & GF_AFTER_V8)
+ smap_ptr = ptr;
else
smap_ptr = findResource(MKID('SMAP'), ptr);
@@ -845,6 +839,14 @@
// A small hack to skip to the BSTR->WRAP->OFFS chunk
smap_ptr += 24;
} else {
+ const uint32 zplane_tags[] = {
+ MKID('ZP00'),
+ MKID('ZP01'),
+ MKID('ZP02'),
+ MKID('ZP03'),
+ MKID('ZP04')
+ };
+
for (i = 1; i < numzbuf; i++) {
zplane_list[i] = findResource(zplane_tags[i], ptr);
}
Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- object.cpp 31 Dec 2002 02:09:56 -0000 1.38
+++ object.cpp 31 Dec 2002 03:26:02 -0000 1.39
@@ -359,7 +359,18 @@
if (_features & GF_SMALL_HEADER)
ptr += 8;
- else
+ else if (_features & GF_AFTER_V8) {
+ ptr = findResource(MKID('IMAG'), ptr);
+ if (!ptr)
+ return;
+
+ ptr = findResource(MKID('WRAP'), ptr);
+ assert(ptr);
+ ptr = findResource(MKID('OFFS'), ptr);
+ assert(ptr);
+ // Get the address of the specified SMAP (corresponding to IMxx)
+ ptr += READ_LE_UINT32(ptr + 4 + 4*getState(od->obj_nr));
+ } else
ptr = findResource(IMxx_tags[getState(od->obj_nr)], ptr);
if (!ptr)
return;
@@ -1273,7 +1284,7 @@
void Scumm::drawBlastObject(BlastObject *eo)
{
VirtScreen *vs;
- byte *bomp, *ptr, *img;
+ byte *bomp, *ptr;
int idx;
BompDrawData bdd;
@@ -1299,18 +1310,16 @@
// an OFFS chunk and multiple BOMP chunks. To find the right BOMP, we can
// either use the offsets in the OFFS chunk, or iterate over all BOMPs we find.
// Here we use the first method.
- img = findResource(MKID('IMAG'), ptr);
- assert(img);
-
- img = findResource(MKID('WRAP'), img);
- assert(img);
-
- img = findResource(MKID('OFFS'), img);
- assert(img);
-
- bomp = img + READ_LE_UINT32(img + 4 + 4*eo->image) + 8;
+ ptr = findResource(MKID('IMAG'), ptr);
+ assert(ptr);
+ ptr = findResource(MKID('WRAP'), ptr);
+ assert(ptr);
+ ptr = findResource(MKID('OFFS'), ptr);
+ assert(ptr);
+ // Get the address of the specified BOMP (we really should verify it's a BOMP and not a SMAP
+ bomp = ptr + READ_LE_UINT32(ptr + 4 + 4*eo->image) + 8;
} else {
- img = findResource(IMxx_tags[eo->image], ptr);
+ byte *img = findResource(IMxx_tags[eo->image], ptr);
if (!img)
img = findResource(IMxx_tags[1], ptr); // Backward compatibility with samnmax blast objects
Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.23
retrieving revision 2.24
diff -u -d -r2.23 -r2.24
--- scummvm.cpp 31 Dec 2002 02:09:57 -0000 2.23
+++ scummvm.cpp 31 Dec 2002 03:26:02 -0000 2.24
@@ -745,9 +745,17 @@
if (_features & GF_SMALL_HEADER)
_IM00_offs = findResourceData(MKID('IM00'), roomptr) - roomptr;
- else if (_features & GF_AFTER_V8)
- _IM00_offs = findResourceData(MKID('IMAG'), roomptr) - roomptr;
- else
+ else if (_features & GF_AFTER_V8) {
+ ptr = findResource(MKID('IMAG'), roomptr);
+ assert(ptr);
+ ptr = findResource(MKID('WRAP'), ptr);
+ assert(ptr);
+ ptr = findResource(MKID('OFFS'), ptr);
+ assert(ptr);
+ // Get the first SMAP resource (corresponds to IM00)
+ ptr += READ_LE_UINT32(ptr + 8);
+ _IM00_offs = ptr - roomptr;
+ } else
_IM00_offs =
findResource(MKID('IM00'),
findResource(MKID('RMIM'), roomptr)) - roomptr;
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.37,1.38 resource.cpp,1.46,1.47 scumm.h,1.121,1.122 scummvm.cpp,2.22,2.23
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.39,1.40 scummvm.cpp,2.24,2.25 verbs.cpp,1.16,1.17
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list