fixes for v3 broken by v2
svn-id: r7057
This commit is contained in:
parent
d7c0a9b68a
commit
48ad5199ff
2 changed files with 8 additions and 8 deletions
|
@ -637,7 +637,7 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room, byte *searchptr) {
|
||||||
|
|
||||||
od->parent = *(ptr + 12);
|
od->parent = *(ptr + 12);
|
||||||
|
|
||||||
if (_features & GF_AFTER_V3) {
|
if (_features & GF_AFTER_V2) {
|
||||||
od->walk_x = *(ptr + 13);
|
od->walk_x = *(ptr + 13);
|
||||||
od->walk_y = *(ptr + 14);
|
od->walk_y = *(ptr + 14);
|
||||||
od->actordir = (*(ptr + 15)) & 7;
|
od->actordir = (*(ptr + 15)) & 7;
|
||||||
|
|
|
@ -905,7 +905,7 @@ void Scumm::initRoomSubBlocks() {
|
||||||
//
|
//
|
||||||
// Find the room image data
|
// Find the room image data
|
||||||
//
|
//
|
||||||
if (_features & GF_AFTER_V2)
|
if (_features & GF_OLD_BUNDLE)
|
||||||
_IM00_offs = READ_LE_UINT16(roomptr + 0x0A);
|
_IM00_offs = READ_LE_UINT16(roomptr + 0x0A);
|
||||||
else if (_features & GF_SMALL_HEADER)
|
else if (_features & GF_SMALL_HEADER)
|
||||||
_IM00_offs = findResourceData(MKID('IM00'), roomptr) - roomptr;
|
_IM00_offs = findResourceData(MKID('IM00'), roomptr) - roomptr;
|
||||||
|
@ -928,7 +928,7 @@ void Scumm::initRoomSubBlocks() {
|
||||||
//
|
//
|
||||||
if (_features & GF_AFTER_V2)
|
if (_features & GF_AFTER_V2)
|
||||||
_EXCD_offs = READ_LE_UINT16(roomptr + 0x18);
|
_EXCD_offs = READ_LE_UINT16(roomptr + 0x18);
|
||||||
else if (_features & GF_OLD_BUNDLE)
|
else if (_features & GF_AFTER_V3)
|
||||||
_EXCD_offs = READ_LE_UINT16(roomptr + 0x19);
|
_EXCD_offs = READ_LE_UINT16(roomptr + 0x19);
|
||||||
else {
|
else {
|
||||||
ptr = findResourceData(MKID('EXCD'), roomResPtr);
|
ptr = findResourceData(MKID('EXCD'), roomResPtr);
|
||||||
|
@ -943,7 +943,7 @@ void Scumm::initRoomSubBlocks() {
|
||||||
//
|
//
|
||||||
if (_features & GF_AFTER_V2)
|
if (_features & GF_AFTER_V2)
|
||||||
_ENCD_offs = READ_LE_UINT16(roomptr + 0x1C);
|
_ENCD_offs = READ_LE_UINT16(roomptr + 0x1C);
|
||||||
else if (_features & GF_OLD_BUNDLE)
|
else if (_features & GF_AFTER_V3)
|
||||||
_ENCD_offs = READ_LE_UINT16(roomptr + 0x1B);
|
_ENCD_offs = READ_LE_UINT16(roomptr + 0x1B);
|
||||||
else {
|
else {
|
||||||
ptr = findResourceData(MKID('ENCD'), roomResPtr);
|
ptr = findResourceData(MKID('ENCD'), roomResPtr);
|
||||||
|
@ -959,14 +959,14 @@ void Scumm::initRoomSubBlocks() {
|
||||||
if (_features & GF_SMALL_HEADER) {
|
if (_features & GF_SMALL_HEADER) {
|
||||||
if (_features & GF_AFTER_V2)
|
if (_features & GF_AFTER_V2)
|
||||||
ptr = roomptr + *(roomptr + 0x15);
|
ptr = roomptr + *(roomptr + 0x15);
|
||||||
else if (_features & GF_OLD_BUNDLE)
|
else if (_features & GF_AFTER_V3)
|
||||||
ptr = roomptr + READ_LE_UINT16(roomptr + 0x15);
|
ptr = roomptr + READ_LE_UINT16(roomptr + 0x15);
|
||||||
else
|
else
|
||||||
ptr = findResourceData(MKID('BOXD'), roomptr);
|
ptr = findResourceData(MKID('BOXD'), roomptr);
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
byte numOfBoxes = *ptr;
|
byte numOfBoxes = *ptr;
|
||||||
int size;
|
int size;
|
||||||
if (_features & GF_AFTER_V3) // GF_OLD256 or GF_AFTER_V3 ?
|
if (_features & GF_OLD_BUNDLE)
|
||||||
size = numOfBoxes * (SIZEOF_BOX - 2) + 1;
|
size = numOfBoxes * (SIZEOF_BOX - 2) + 1;
|
||||||
else
|
else
|
||||||
size = numOfBoxes * SIZEOF_BOX + 1;
|
size = numOfBoxes * SIZEOF_BOX + 1;
|
||||||
|
@ -976,7 +976,7 @@ void Scumm::initRoomSubBlocks() {
|
||||||
ptr += size;
|
ptr += size;
|
||||||
if (_features & GF_AFTER_V2)
|
if (_features & GF_AFTER_V2)
|
||||||
size = (READ_LE_UINT16(roomptr + 0x0A) - *(roomptr + 0x15)) - size;
|
size = (READ_LE_UINT16(roomptr + 0x0A) - *(roomptr + 0x15)) - size;
|
||||||
else if (_features & GF_OLD_BUNDLE)
|
else if (_features & GF_AFTER_V3)
|
||||||
// FIXME. This is an evil HACK!!!
|
// FIXME. This is an evil HACK!!!
|
||||||
size = (READ_LE_UINT16(roomptr + 0x0A) - READ_LE_UINT16(roomptr + 0x15)) - size;
|
size = (READ_LE_UINT16(roomptr + 0x0A) - READ_LE_UINT16(roomptr + 0x15)) - size;
|
||||||
else
|
else
|
||||||
|
@ -1064,7 +1064,7 @@ void Scumm::initRoomSubBlocks() {
|
||||||
loadResource(rtScript, *ptr++);
|
loadResource(rtScript, *ptr++);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(_features & GF_AFTER_V2)) {
|
if (_features & GF_AFTER_V3) {
|
||||||
num_sounds = *(roomResPtr + 23);
|
num_sounds = *(roomResPtr + 23);
|
||||||
num_scripts = *(roomResPtr + 24);
|
num_scripts = *(roomResPtr + 24);
|
||||||
ptr = roomptr + 29 + num_objects * 4 + num_sounds + num_scripts;
|
ptr = roomptr + 29 + num_objects * 4 + num_sounds + num_scripts;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue