fixed lots of object problems in loomcd
svn-id: r3576
This commit is contained in:
parent
d9ddef19aa
commit
d59b949833
2 changed files with 38 additions and 15 deletions
45
object.cpp
45
object.cpp
|
@ -134,6 +134,7 @@ void Scumm::getObjectXYPos(int object) {
|
|||
ImageHeader *imhd;
|
||||
int x,y;
|
||||
AdjustBoxResult abr;
|
||||
|
||||
if(!(_features & GF_SMALL_HEADER)) {
|
||||
if (_features&GF_AFTER_V6) {
|
||||
state = getState(object)-1;
|
||||
|
@ -155,19 +156,24 @@ void Scumm::getObjectXYPos(int object) {
|
|||
x = (int16)READ_LE_UINT16(&od->walk_x);
|
||||
y = (int16)READ_LE_UINT16(&od->walk_y);
|
||||
}
|
||||
} else {
|
||||
x = (int16)READ_LE_UINT16(&od->x_pos);
|
||||
y = (int16)READ_LE_UINT16(&od->y_pos);
|
||||
_xPos = x;
|
||||
_yPos = y;
|
||||
_dir = oldDirToNewDir(od->actordir&3);
|
||||
} else {
|
||||
x = (int16)READ_LE_UINT32(&od->walk_x);
|
||||
y = (int16)READ_LE_UINT16(&od->walk_y);
|
||||
_xPos = x;
|
||||
_yPos = y;
|
||||
_dir= oldDirToNewDir(od->actordir&3);
|
||||
|
||||
}
|
||||
|
||||
// abr = adjustXYToBeInBox(0, x, y);
|
||||
// _xPos = abr.x;
|
||||
// _yPos = abr.y;
|
||||
_xPos = x;
|
||||
_yPos = y;
|
||||
_dir = oldDirToNewDir(od->actordir&3);
|
||||
// _xPos = x;
|
||||
// _yPos = y;
|
||||
// _dir = oldDirToNewDir(od->actordir&3);
|
||||
}
|
||||
|
||||
int Scumm::getObjActToObjActDist(int a, int b) {
|
||||
|
@ -483,19 +489,32 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room) {
|
|||
ImageHeader *imhd;
|
||||
|
||||
if(_features & GF_SMALL_HEADER) {
|
||||
byte *ptr = room + od->offs_obcd_to_room;
|
||||
od->obj_nr = READ_LE_UINT16(ptr+6);
|
||||
od->width = *(ptr+11)<<3;
|
||||
od->height = *(ptr+17);
|
||||
od->x_pos = *(ptr+9)<<3;
|
||||
od->y_pos = *(ptr+10)<<3;
|
||||
|
||||
if(*(ptr+10) == 0x80) {
|
||||
byte *ptr = room + od->offs_obcd_to_room;
|
||||
|
||||
od->obj_nr = READ_LE_UINT16(ptr+6); // ok
|
||||
|
||||
od->width = *(ptr+11)<<3; // ok
|
||||
od->x_pos = *(ptr+9)<<3; // ok
|
||||
|
||||
if(*(ptr+10) & 0x80) {
|
||||
od->parentstate = 1; // it's 0x10 in the original code
|
||||
} else {
|
||||
od->parentstate = 0;
|
||||
}
|
||||
|
||||
od->y_pos = ((*(ptr+10))&0x7F)<<3;
|
||||
|
||||
od->parent = *(ptr+12);
|
||||
od->walk_x = READ_LE_UINT16(ptr+13);
|
||||
|
||||
od->walk_y = READ_LE_UINT16(ptr+15);
|
||||
|
||||
od->actordir = (*(ptr+17))&7;
|
||||
od->height = *(ptr+17); // ok
|
||||
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1932,6 +1932,8 @@ void Scumm::o5_walkActorToActor() {
|
|||
Actor *a, *a2;
|
||||
int nr;
|
||||
|
||||
warning("walk actor to actor");
|
||||
|
||||
a = derefActorSafe(getVarOrDirectByte(0x80), "o5_walkActorToActor");
|
||||
if (a->room != _currentRoom) {
|
||||
getVarOrDirectByte(0x40);
|
||||
|
@ -1970,6 +1972,8 @@ void Scumm::o5_walkActorToObject() {
|
|||
int obj;
|
||||
Actor *a;
|
||||
|
||||
warning("walk object to object");
|
||||
|
||||
a = derefActorSafe(getVarOrDirectByte(0x80), "o5_walkActorToObject");
|
||||
obj = getVarOrDirectWord(0x40);
|
||||
if (whereIsObject(obj)!=WIO_NOT_FOUND) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue