mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 08:25:35 +00:00
Fixed struct ImageHeader for v7 implementation
svn-id: r3652
This commit is contained in:
parent
c0b0afa68a
commit
09ff3af07f
33
object.cpp
33
object.cpp
@ -149,8 +149,13 @@ void Scumm::getObjectXYPos(int object) {
|
|||||||
}
|
}
|
||||||
assert(ptr);
|
assert(ptr);
|
||||||
imhd = (ImageHeader*)findResourceData(MKID('IMHD'), ptr);
|
imhd = (ImageHeader*)findResourceData(MKID('IMHD'), ptr);
|
||||||
x = od->x_pos + (int16)READ_LE_UINT16(&imhd->hotspot[state].x);
|
if( _features & GF_AFTER_V7) {
|
||||||
y = od->y_pos + (int16)READ_LE_UINT16(&imhd->hotspot[state].y);
|
x = od->x_pos + (int16)READ_LE_UINT16(&imhd->v7.hotspot[state].x);
|
||||||
|
y = od->y_pos + (int16)READ_LE_UINT16(&imhd->v7.hotspot[state].y);
|
||||||
|
} else {
|
||||||
|
x = od->x_pos + (int16)READ_LE_UINT16(&imhd->old.hotspot[state].x);
|
||||||
|
y = od->y_pos + (int16)READ_LE_UINT16(&imhd->old.hotspot[state].y);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
x = (int16)READ_LE_UINT16(&od->walk_x);
|
x = (int16)READ_LE_UINT16(&od->walk_x);
|
||||||
y = (int16)READ_LE_UINT16(&od->walk_y);
|
y = (int16)READ_LE_UINT16(&od->walk_y);
|
||||||
@ -400,7 +405,10 @@ void Scumm::loadRoomObjects() {
|
|||||||
error("Room %d missing image blocks(s)", _roomResource);
|
error("Room %d missing image blocks(s)", _roomResource);
|
||||||
|
|
||||||
imhd = (ImageHeader*)findResourceData(MKID('IMHD'), ptr);
|
imhd = (ImageHeader*)findResourceData(MKID('IMHD'), ptr);
|
||||||
obim_id = READ_LE_UINT16(&imhd->obj_id);
|
if (_features & GF_AFTER_V7)
|
||||||
|
obim_id = READ_LE_UINT16(&imhd->v7.obj_id);
|
||||||
|
else
|
||||||
|
obim_id = READ_LE_UINT16(&imhd->old.obj_id);
|
||||||
|
|
||||||
for(j=1; j<=_numObjectsInRoom; j++) {
|
for(j=1; j<=_numObjectsInRoom; j++) {
|
||||||
if (_objs[j].obj_nr==obim_id)
|
if (_objs[j].obj_nr==obim_id)
|
||||||
@ -752,6 +760,7 @@ void Scumm::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint
|
|||||||
RoomHeader *roomhdr;
|
RoomHeader *roomhdr;
|
||||||
ImageHeader *imhd;
|
ImageHeader *imhd;
|
||||||
int id2;
|
int id2;
|
||||||
|
int id3;
|
||||||
|
|
||||||
if (findWhat&foCheckAlreadyLoaded && getObjectIndex(id) != -1) {
|
if (findWhat&foCheckAlreadyLoaded && getObjectIndex(id) != -1) {
|
||||||
fo->obcd = obcdptr = getOBCDFromObject(id);
|
fo->obcd = obcdptr = getOBCDFromObject(id);
|
||||||
@ -829,7 +838,11 @@ void Scumm::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (READ_LE_UINT16(&imhd->obj_id) == (uint16)id) {
|
if(_features & GF_AFTER_V7)
|
||||||
|
id3 = READ_LE_UINT16(&imhd->v7.obj_id);
|
||||||
|
else
|
||||||
|
id3 = READ_LE_UINT16(&imhd->old.obj_id);
|
||||||
|
if (id3 == (uint16)id) {
|
||||||
fo->obim = obimptr;
|
fo->obim = obimptr;
|
||||||
fo->imhd = imhd;
|
fo->imhd = imhd;
|
||||||
break;
|
break;
|
||||||
@ -1022,9 +1035,15 @@ void Scumm::setCursorImg(uint img, uint room, uint imgindex) {
|
|||||||
|
|
||||||
findObjectInRoom(&foir, foCodeHeader | foImageHeader | foCheckAlreadyLoaded, img, room);
|
findObjectInRoom(&foir, foCodeHeader | foImageHeader | foCheckAlreadyLoaded, img, room);
|
||||||
|
|
||||||
setCursorHotspot2(
|
if(_features & GF_AFTER_V7)
|
||||||
READ_LE_UINT16(&foir.imhd->hotspot[0].x),
|
setCursorHotspot2(
|
||||||
READ_LE_UINT16(&foir.imhd->hotspot[0].y));
|
READ_LE_UINT16(&foir.imhd->v7.hotspot[0].x),
|
||||||
|
READ_LE_UINT16(&foir.imhd->v7.hotspot[0].y));
|
||||||
|
else
|
||||||
|
setCursorHotspot2(
|
||||||
|
READ_LE_UINT16(&foir.imhd->old.hotspot[0].x),
|
||||||
|
READ_LE_UINT16(&foir.imhd->old.hotspot[0].y));
|
||||||
|
|
||||||
|
|
||||||
#if !defined(FULL_THROTTLE)
|
#if !defined(FULL_THROTTLE)
|
||||||
w = READ_LE_UINT16(&foir.cdhd->v6.w)>>3;
|
w = READ_LE_UINT16(&foir.cdhd->v6.w)>>3;
|
||||||
|
50
scumm.h
50
scumm.h
@ -145,32 +145,34 @@ struct CodeHeader {
|
|||||||
};
|
};
|
||||||
} GCC_PACK;
|
} GCC_PACK;
|
||||||
|
|
||||||
#if defined(FULL_THROTTLE)
|
|
||||||
struct ImageHeader { /* file format */
|
struct ImageHeader { /* file format */
|
||||||
uint32 version;
|
union {
|
||||||
uint16 obj_id;
|
struct {
|
||||||
uint16 unk[1];
|
uint16 obj_id;
|
||||||
int16 x_pos,y_pos;
|
uint16 unk[5];
|
||||||
uint16 width,height;
|
uint16 width;
|
||||||
byte unk2[3];
|
uint16 height;
|
||||||
byte actordir;
|
uint16 unk_2;
|
||||||
uint16 unk_2;
|
struct {
|
||||||
struct {
|
int16 x,y;
|
||||||
int16 x,y;
|
} hotspot[15];
|
||||||
} hotspot[15];
|
} old;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
uint32 version;
|
||||||
|
uint16 obj_id;
|
||||||
|
uint16 unk[1];
|
||||||
|
int16 x_pos,y_pos;
|
||||||
|
uint16 width,height;
|
||||||
|
byte unk2[3];
|
||||||
|
byte actordir;
|
||||||
|
uint16 unk_2;
|
||||||
|
struct {
|
||||||
|
int16 x,y;
|
||||||
|
} hotspot[15];
|
||||||
|
} v7;
|
||||||
|
};
|
||||||
} GCC_PACK;
|
} GCC_PACK;
|
||||||
#else
|
|
||||||
struct ImageHeader { /* file format */
|
|
||||||
uint16 obj_id;
|
|
||||||
uint16 unk[5];
|
|
||||||
uint16 width;
|
|
||||||
uint16 height;
|
|
||||||
uint16 unk_2;
|
|
||||||
struct {
|
|
||||||
int16 x,y;
|
|
||||||
} hotspot[15];
|
|
||||||
} GCC_PACK;
|
|
||||||
#endif
|
|
||||||
#pragma END_PACK_STRUCTS
|
#pragma END_PACK_STRUCTS
|
||||||
|
|
||||||
struct AdjustBoxResult {
|
struct AdjustBoxResult {
|
||||||
|
@ -194,8 +194,13 @@ void Scumm::drawVerbBitmap(int vrb, int x, int y) {
|
|||||||
imptr = (obim+8);
|
imptr = (obim+8);
|
||||||
} else {
|
} else {
|
||||||
imhd = (ImageHeader*)findResourceData(MKID('IMHD'), obim);
|
imhd = (ImageHeader*)findResourceData(MKID('IMHD'), obim);
|
||||||
imgw = READ_LE_UINT16(&imhd->width) >> 3;
|
if (_features & GF_AFTER_V7) {
|
||||||
imgh = READ_LE_UINT16(&imhd->height) >> 3;
|
imgw = READ_LE_UINT16(&imhd->v7.width) >> 3;
|
||||||
|
imgh = READ_LE_UINT16(&imhd->v7.height) >> 3;
|
||||||
|
} else {
|
||||||
|
imgw = READ_LE_UINT16(&imhd->old.width) >> 3;
|
||||||
|
imgh = READ_LE_UINT16(&imhd->old.height) >> 3;
|
||||||
|
}
|
||||||
|
|
||||||
imptr = findResource(MKID('IM01'), obim);
|
imptr = findResource(MKID('IM01'), obim);
|
||||||
if (!imptr)
|
if (!imptr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user