mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-21 19:51:49 +00:00
Fixed struct RoomHeader for v7 implementation
svn-id: r3650
This commit is contained in:
parent
5eb73a9af4
commit
6387020fd9
@ -404,11 +404,10 @@ void Scumm::fixActorDirection(Actor *a, int direction) {
|
||||
vald = a->cost.frame[i];
|
||||
if (vald==0xFFFF)
|
||||
continue;
|
||||
#if !defined(FULL_THROTTLE)
|
||||
cost_decodeData(a, vald, mask);
|
||||
#else
|
||||
if(_features & GF_AFTER_V7)
|
||||
akos_decodeData(a, vald, mask);
|
||||
#endif
|
||||
else
|
||||
cost_decodeData(a, vald, mask);
|
||||
}
|
||||
|
||||
a->needRedraw = true;
|
||||
|
14
object.cpp
14
object.cpp
@ -354,7 +354,10 @@ void Scumm::loadRoomObjects() {
|
||||
room = getResourceAddress(rtRoom, _roomResource);
|
||||
roomhdr = (RoomHeader*)findResourceData(MKID('RMHD'), room);
|
||||
|
||||
_numObjectsInRoom = READ_LE_UINT16(&roomhdr->numObjects);
|
||||
if(_features & GF_AFTER_V7)
|
||||
_numObjectsInRoom = READ_LE_UINT16(&(roomhdr->v7.numObjects));
|
||||
else
|
||||
_numObjectsInRoom = READ_LE_UINT16(&(roomhdr->old.numObjects));
|
||||
|
||||
if (_numObjectsInRoom == 0)
|
||||
return;
|
||||
@ -420,7 +423,7 @@ void Scumm::loadRoomObjectsSmall() {
|
||||
room = getResourceAddress(rtRoom, _roomResource);
|
||||
roomhdr = (RoomHeader*)findResourceData(MKID('RMHD'), room);
|
||||
|
||||
_numObjectsInRoom = READ_LE_UINT16(&roomhdr->numObjects);
|
||||
_numObjectsInRoom = READ_LE_UINT16(&(roomhdr->old.numObjects));
|
||||
|
||||
if (_numObjectsInRoom == 0)
|
||||
return;
|
||||
@ -747,7 +750,12 @@ void Scumm::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint
|
||||
|
||||
fo->roomptr = roomptr = getResourceAddress(rtRoom, room);
|
||||
roomhdr = (RoomHeader*)findResourceData(MKID('RMHD'), roomptr);
|
||||
numobj = READ_LE_UINT16(&roomhdr->numObjects);
|
||||
|
||||
if(_features & GF_AFTER_V7)
|
||||
numobj = READ_LE_UINT16(&(roomhdr->v7.numObjects));
|
||||
else
|
||||
numobj = READ_LE_UINT16(&(roomhdr->old.numObjects));
|
||||
|
||||
if (numobj==0)
|
||||
error("findObjectInRoom: No object found in room %d", room);
|
||||
if (numobj > _numLocalObjects)
|
||||
|
@ -1179,13 +1179,13 @@ void Scumm::o6_stopObjectScript() {
|
||||
}
|
||||
|
||||
void Scumm::o6_panCameraTo() {
|
||||
#if defined(FULL_THROTTLE)
|
||||
int y = pop();
|
||||
int x = pop();
|
||||
panCameraTo(x,y);
|
||||
#else
|
||||
panCameraTo(pop(), 0);
|
||||
#endif
|
||||
if(_features & GF_AFTER_V7) {
|
||||
int y = pop();
|
||||
int x = pop();
|
||||
panCameraTo(x,y);
|
||||
} else {
|
||||
panCameraTo(pop(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Scumm::o6_actorFollowCamera() {
|
||||
|
16
scumm.h
16
scumm.h
@ -75,11 +75,17 @@ struct ResHdr {
|
||||
|
||||
|
||||
struct RoomHeader {
|
||||
#ifdef FULL_THROTTLE
|
||||
uint32 version;
|
||||
#endif
|
||||
uint16 width,height;
|
||||
uint16 numObjects;
|
||||
union {
|
||||
struct {
|
||||
uint32 version;
|
||||
uint16 width,height;
|
||||
uint16 numObjects;
|
||||
} v7;
|
||||
struct {
|
||||
uint16 width,height;
|
||||
uint16 numObjects;
|
||||
} old;
|
||||
};
|
||||
} GCC_PACK;
|
||||
|
||||
struct BompHeader {
|
||||
|
11
scummvm.cpp
11
scummvm.cpp
@ -681,8 +681,15 @@ void Scumm::initRoomSubBlocks() {
|
||||
roomptr = getResourceAddress(rtRoom, _roomResource);
|
||||
|
||||
rmhd = (RoomHeader*)findResourceData(MKID('RMHD'), roomptr);
|
||||
_scrWidth = READ_LE_UINT16(&rmhd->width);
|
||||
_scrHeight = READ_LE_UINT16(&rmhd->height);
|
||||
|
||||
if(_features & GF_AFTER_V7) {
|
||||
_scrWidth = READ_LE_UINT16(&(rmhd->v7.width));
|
||||
_scrHeight = READ_LE_UINT16(&(rmhd->v7.height));
|
||||
} else {
|
||||
_scrWidth = READ_LE_UINT16(&(rmhd->old.width));
|
||||
_scrHeight = READ_LE_UINT16(&(rmhd->old.height));
|
||||
}
|
||||
|
||||
|
||||
if( _features & GF_SMALL_HEADER)
|
||||
_IM00_offs = findResourceData(MKID('IM00'), roomptr) - roomptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user