use READ_LE_UINT16 instead of FROM_LE_16 to avoid unaligned memory access problems on PalmOS

svn-id: r7223
This commit is contained in:
Max Horn 2003-04-30 12:57:46 +00:00
parent 01d3067b7d
commit 30e3a81618

View file

@ -163,7 +163,7 @@ int Scumm::getScale(int box, int x, int y) {
} else } else
return FROM_LE_32(ptr->v8.scale); return FROM_LE_32(ptr->v8.scale);
} else { } else {
uint16 scale = FROM_LE_16(ptr->old.scale); uint16 scale = READ_LE_UINT16(&ptr->old.scale);
if (scale & 0x8000) { if (scale & 0x8000) {
scale = (scale & 0x7FFF) + 1; scale = (scale & 0x7FFF) + 1;
@ -190,7 +190,7 @@ int Scumm::getBoxScale(int box) {
if (_features & GF_AFTER_V8) if (_features & GF_AFTER_V8)
return FROM_LE_32(ptr->v8.scale); return FROM_LE_32(ptr->v8.scale);
else else
return FROM_LE_16(ptr->old.scale); return READ_LE_UINT16(&ptr->old.scale);
} }
byte Scumm::getNumBoxes() { byte Scumm::getNumBoxes() {
@ -325,15 +325,15 @@ void Scumm::getBoxCoordinates(int boxnum, BoxCoords *box) {
SWAP(box->ll.y, box->lr.y); SWAP(box->ll.y, box->lr.y);
} }
} else { } else {
box->ul.x = (int16)FROM_LE_16(bp->old.ulx); box->ul.x = (int16)READ_LE_UINT16(&bp->old.ulx);
box->ul.y = (int16)FROM_LE_16(bp->old.uly); box->ul.y = (int16)READ_LE_UINT16(&bp->old.uly);
box->ur.x = (int16)FROM_LE_16(bp->old.urx); box->ur.x = (int16)READ_LE_UINT16(&bp->old.urx);
box->ur.y = (int16)FROM_LE_16(bp->old.ury); box->ur.y = (int16)READ_LE_UINT16(&bp->old.ury);
box->ll.x = (int16)FROM_LE_16(bp->old.llx); box->ll.x = (int16)READ_LE_UINT16(&bp->old.llx);
box->ll.y = (int16)FROM_LE_16(bp->old.lly); box->ll.y = (int16)READ_LE_UINT16(&bp->old.lly);
box->lr.x = (int16)FROM_LE_16(bp->old.lrx); box->lr.x = (int16)READ_LE_UINT16(&bp->old.lrx);
box->lr.y = (int16)FROM_LE_16(bp->old.lry); box->lr.y = (int16)READ_LE_UINT16(&bp->old.lry);
} }
} }