diff options
author | Paul Gilbert | 2007-10-07 11:12:46 +0000 |
---|---|---|
committer | Paul Gilbert | 2007-10-07 11:12:46 +0000 |
commit | 8ec0e447c22d18c77b25090c4313b904f167f0ee (patch) | |
tree | 98c885b550f5acfb510068c2b690d4f51b93cc82 | |
parent | d817f530e8321f32d76f44e23d51ce84aa568387 (diff) | |
download | scummvm-rg350-8ec0e447c22d18c77b25090c4313b904f167f0ee.tar.gz scummvm-rg350-8ec0e447c22d18c77b25090c4313b904f167f0ee.tar.bz2 scummvm-rg350-8ec0e447c22d18c77b25090c4313b904f167f0ee.zip |
Added support for setting animations by their index rather than their offset, allowing for easier multi-language support. Also fixed translation of inventory window
svn-id: r29169
-rw-r--r-- | engines/lure/hotspots.cpp | 75 | ||||
-rw-r--r-- | engines/lure/hotspots.h | 1 | ||||
-rw-r--r-- | engines/lure/luredefs.h | 20 | ||||
-rw-r--r-- | engines/lure/res_struct.cpp | 147 |
4 files changed, 132 insertions, 111 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 0dc0efe152..550d57d9f0 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -234,21 +234,36 @@ void Hotspot::setAnimation(uint16 newAnimId) { setAnimation(tempAnim); } +void Hotspot::setAnimationIndex(int animIndex) { + Resources &r = Resources::getReference(); + + // Get the animation specified + HotspotAnimData *tempAnim = r.animRecords()[animIndex]; + + _animId = tempAnim->animRecordId; + if (_data) + _data->animRecordId = tempAnim->animRecordId; + + setAnimation(tempAnim); +} + struct SizeOverrideEntry { - uint16 animId; + int animIndex; uint16 width, height; }; static const SizeOverrideEntry sizeOverrides[] = { - {BLACKSMITH_STANDARD, 32, 48}, - {BLACKSMITH_HAMMERING_ANIM_ID, 48, 47}, + {BLACKSMITH_DEFAULT_ANIM_INDEX, 32, 48}, + {BLACKSMITH_HAMMERING_ANIM_INDEX, 48, 47}, {0, 0, 0} }; void Hotspot::setAnimation(HotspotAnimData *newRecord) { - Disk &r = Disk::getReference(); + Disk &disk = Disk::getReference(); + Resources &res = Resources::getReference(); uint16 tempWidth, tempHeight; int16 xStart; + int animIndex = res.getAnimationIndex(newRecord); if (_frames) { delete _frames; @@ -258,13 +273,13 @@ void Hotspot::setAnimation(HotspotAnimData *newRecord) { _numFrames = 0; _frameNumber = 0; if (!newRecord) return; - if (!r.exists(newRecord->animId)) return; + if (!disk.exists(newRecord->animId)) return; // Scan for any size overrides - some animations get their size set after decoding, but // we want it in advance so we can decode the animation straight to a graphic surface const SizeOverrideEntry *p = &sizeOverrides[0]; - while ((p->animId != 0) && (p->animId != newRecord->animId)) ++p; - if (p->animId != 0) + while ((p->animIndex != 0) && (p->animIndex != animIndex)) ++p; + if (p->animIndex != 0) setSize(p->width, p->height); _anim = newRecord; @@ -289,7 +304,7 @@ void Hotspot::setAnimation(HotspotAnimData *newRecord) { _frameNumber = 0; // Special handling need - if (newRecord->animRecordId == SERF_ANIM_ID) { + if (_hotspotId == RACK_SERF_ID) { _frameStartsUsed = true; _frames = new Surface(416, 27); } else { @@ -315,7 +330,7 @@ void Hotspot::setAnimation(HotspotAnimData *newRecord) { pSrc = dest->data() + frameOffset; } - if (newRecord->animRecordId == SERF_ANIM_ID) { + if (_hotspotId == RACK_SERF_ID) { // Save the start of each frame for serf, since the size varies xStart = (frameNumCtr == 0) ? 0 : _frameStarts[frameNumCtr - 1] + tempWidth; _frameStarts[frameNumCtr] = xStart; @@ -1422,8 +1437,6 @@ void Hotspot::doUse(HotspotData *hotspot) { } } -uint16 giveTalkIds[6] = {0xCF5E, 0xCF14, 0xCF90, 0xCFAA, 0xCFD0, 0xCFF6}; - void Hotspot::doGive(HotspotData *hotspot) { Resources &res = Resources::getReference(); uint16 usedId = _currentActions.top().supportData().param(1); @@ -1462,8 +1475,8 @@ void Hotspot::doGive(HotspotData *hotspot) { if (sequenceOffset == NOONE_ID) { // Start a conversation based on the index of field #6 uint16 index = fields.getField(GIVE_TALK_INDEX); - assert(index < 6); - startTalk(hotspot, giveTalkIds[index]); + uint16 id = res.getGiveTalkId(index); + startTalk(hotspot, id); } else if (sequenceOffset == 0) { // Move item into character's inventory @@ -1686,18 +1699,20 @@ void Hotspot::doDrink(HotspotData *hotspot) { void Hotspot::doStatus(HotspotData *hotspot) { char buffer[MAX_DESC_SIZE]; uint16 numItems = 0; + Resources &res = Resources::getReference(); + StringList &stringList = res.stringList(); StringData &strings = StringData::getReference(); - Resources &resources = Resources::getReference(); Room &room = Room::getReference(); room.update(); endAction(); strings.getString(room.roomNumber(), buffer); - strcat(buffer, "\n\nYou are carrying "); + strcat(buffer, "\n\n"); + strcat(buffer, stringList.getString(S_YOU_ARE_CARRYING)); // Scan through the list and add in any items assigned to the player - HotspotDataList &list = resources.hotspotData(); + HotspotDataList &list = res.hotspotData(); HotspotDataList::iterator i; for (i = list.begin(); i != list.end(); ++i) { HotspotData *rec = *i; @@ -1710,13 +1725,16 @@ void Hotspot::doStatus(HotspotData *hotspot) { } // If there were no items, add in the word 'nothing' - if (numItems == 0) strcat(buffer, "nothing."); + if (numItems == 0) strcat(buffer, stringList.getString(S_INV_NOTHING)); // If the player has money, add it in - uint16 numGroats = resources.fieldList().numGroats(); + uint16 numGroats = res.fieldList().numGroats(); if (numGroats > 0) { - sprintf(buffer + strlen(buffer), "\n\nYou have %d groat", numGroats); - if (numGroats > 1) strcat(buffer, "s"); + strcat(buffer, "\n\n"); + strcat(buffer, stringList.getString(S_YOU_HAVE)); + sprintf(buffer + strlen(buffer), "%d", numGroats); + strcat(buffer, " "); + strcat(buffer, stringList.getString((numGroats == 1) ? S_GROAT : S_GROATS)); } // Display the dialog @@ -2391,9 +2409,10 @@ void HotspotTickHandlers::standardCharacterAnimHandler(Hotspot &h) { // There is some countdown left to do h.updateMovement(); - bool decrementFlag = (h.resource()->actionHotspotId != 0); - if (decrementFlag) { + bool decrementFlag = (h.resource()->actionHotspotId == 0); + if (!decrementFlag) { HotspotData *hotspot = res.getHotspot(h.resource()->actionHotspotId); + assert(hotspot); decrementFlag = (hotspot->roomNumber != h.hotspotId()) ? false : Support::charactersIntersecting(hotspot, h.resource()); } @@ -3069,16 +3088,16 @@ void HotspotTickHandlers::sparkleAnimHandler(Hotspot &h) { h.setPosition(player->x() - 14, player->y() - 10); h.setActionCtr(h.actionCtr() + 1); if (h.actionCtr() == 6) { - uint16 animId; + int animIndex; if ((fields.getField(11) == 2) || (fields.getField(28) != 0)) { fields.setField(28, 0); - animId = PLAYER_ANIM_ID; + animIndex = PLAYER_ANIM_INDEX; } else { fields.setField(28, fields.getField(28) + 1); - animId = SELENA_ANIM_ID; + animIndex = SELENA_ANIM_INDEX; } - player->setAnimation(animId); + player->setAnimationIndex(animIndex); } if (h.executeScript()) { @@ -3578,7 +3597,7 @@ void HotspotTickHandlers::barmanAnimHandler(Hotspot &h) { else { // Set up alternate animation h.setWidth(32); - h.setAnimation(EWAN_ALT_ANIM_ID); + h.setAnimationIndex(EWAN_ALT_ANIM_INDEX); ewanXOffset = true; h.setPosition(h.x() - 8, h.y()); id = BG_EXTRA2 << 8; @@ -3605,7 +3624,7 @@ void HotspotTickHandlers::barmanAnimHandler(Hotspot &h) { if (h.hotspotId() == EWAN_ID) { // Make sure Ewan is back to his standard animation h.setWidth(16); - h.setAnimation(EWAN_ANIM_ID); + h.setAnimationIndex(EWAN_ANIM_INDEX); if (ewanXOffset) { h.setPosition(h.x() + 8, h.y()); diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h index 78a807b2f9..93eceddc16 100644 --- a/engines/lure/hotspots.h +++ b/engines/lure/hotspots.h @@ -352,6 +352,7 @@ public: ~Hotspot(); void setAnimation(uint16 newAnimId); + void setAnimationIndex(int animIndex); void setAnimation(HotspotAnimData *newRecord); uint16 hotspotId() { return _hotspotId; } uint16 originalId() { return _originalId; } diff --git a/engines/lure/luredefs.h b/engines/lure/luredefs.h index c44b2a3341..6dca97678c 100644 --- a/engines/lure/luredefs.h +++ b/engines/lure/luredefs.h @@ -34,7 +34,7 @@ namespace Lure { #define SUPPORT_FILENAME "lure.dat" #define LURE_DAT_MAJOR 1 -#define LURE_DAT_MINOR 22 +#define LURE_DAT_MINOR 23 #define LURE_DEBUG 1 @@ -246,6 +246,7 @@ enum CursorType {CURSOR_ARROW = 0, CURSOR_DISK = 1, CURSOR_TIME_START = 2, #define CASTLE_SKORL_ID 0x3F3 #define FIRST_NONCHARACTER_ID 0x408 #define SACK_ID 0x40D +#define RACK_SERF_ID 0x411 #define PRISONER_ID 0x412 #define SID_ID 0x420 #define OIL_BURNER_ID 0x424 @@ -285,19 +286,20 @@ enum CursorType {CURSOR_ARROW = 0, CURSOR_DISK = 1, CURSOR_TIME_START = 2, // Misc constants #define GENERAL_MAGIC_ID 42 -#define PLAYER_FIGHT_ANIM_ID 0x55F6 #define VOICE_ANIM_INDEX 1 #define PUZZLED_ANIM_INDEX 2 #define EXCLAMATION_ANIM_INDEX 3 -#define SERF_ANIM_ID 0x58A0 -#define BLACKSMITH_STANDARD 0x8a12 -#define BLACKSMITH_HAMMERING_ANIM_ID 0x9c11 -#define EWAN_ANIM_ID 0x59E4 -#define EWAN_ALT_ANIM_ID 0x59ED -#define PLAYER_ANIM_ID 0x5C80 -#define SELENA_ANIM_ID 0x5CAA #define DEFAULT_VOLUME 192 +// Animation record indexes +#define PLAYER_FIGHT_ANIM_INDEX 10 +#define BLACKSMITH_HAMMERING_ANIM_INDEX 21 +#define EWAN_ANIM_INDEX 22 +#define EWAN_ALT_ANIM_INDEX 23 +#define PLAYER_ANIM_INDEX 31 +#define SELENA_ANIM_INDEX 32 +#define BLACKSMITH_DEFAULT_ANIM_INDEX 33 + #define CONVERSE_COUNTDOWN_SIZE 40 #define IDLE_COUNTDOWN_SIZE 15 #define MAX_TELL_COMMANDS 8 diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index eace23798e..b338817b93 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -75,49 +75,49 @@ extern const RoomTranslationRecord roomTranslations[] = { // Room data holding class RoomData::RoomData(RoomResource *rec, MemoryBlock *pathData) { - roomNumber = FROM_LE_16(rec->roomNumber); + roomNumber = READ_LE_UINT16(&rec->roomNumber); hdrFlags = rec->hdrFlags; actions = FROM_LE_32(rec->actions) & 0xfffffff; flags = (FROM_LE_32(rec->actions) >> 24) & 0xf0; - descId = FROM_LE_16(rec->descId); - sequenceOffset = FROM_LE_16(rec->sequenceOffset); - numLayers = FROM_LE_16(rec->numLayers); + descId = READ_LE_UINT16(&rec->descId); + sequenceOffset = READ_LE_UINT16(&rec->sequenceOffset); + numLayers = READ_LE_UINT16(&rec->numLayers); paths.load(pathData->data() + (roomNumber - 1) * ROOM_PATHS_SIZE); for (int ctr = 0; ctr < 4; ++ctr) - layers[ctr] = FROM_LE_16(rec->layers[ctr]); + layers[ctr] = READ_LE_UINT16(&rec->layers[ctr]); - clippingXStart = FROM_LE_16(rec->clippingXStart); - clippingXEnd = FROM_LE_16(rec->clippingXEnd); + clippingXStart = READ_LE_UINT16(&rec->clippingXStart); + clippingXEnd = READ_LE_UINT16(&rec->clippingXEnd); exitTime = FROM_LE_32(rec->exitTime); areaFlag = rec->areaFlag; - walkBounds.left = FROM_LE_16(rec->walkBounds.xs); - walkBounds.right = FROM_LE_16(rec->walkBounds.xe); - walkBounds.top = FROM_LE_16(rec->walkBounds.ys); - walkBounds.bottom = FROM_LE_16(rec->walkBounds.ye); + walkBounds.left = READ_LE_UINT16(&rec->walkBounds.xs); + walkBounds.right = READ_LE_UINT16(&rec->walkBounds.xe); + walkBounds.top = READ_LE_UINT16(&rec->walkBounds.ys); + walkBounds.bottom = READ_LE_UINT16(&rec->walkBounds.ye); } // Room exit hotspot area holding class RoomExitHotspotData::RoomExitHotspotData(RoomExitHotspotResource *rec) { - hotspotId = FROM_LE_16(rec->hotspotId); - xs = FROM_LE_16(rec->xs); - ys = FROM_LE_16(rec->ys); - xe = FROM_LE_16(rec->xe); - ye = FROM_LE_16(rec->ye); + hotspotId = READ_LE_UINT16(&rec->hotspotId); + xs = READ_LE_UINT16(&rec->xs); + ys = READ_LE_UINT16(&rec->ys); + xe = READ_LE_UINT16(&rec->xe); + ye = READ_LE_UINT16(&rec->ye); cursorNum = rec->cursorNum; - destRoomNumber = FROM_LE_16(rec->destRoomNumber); + destRoomNumber = READ_LE_UINT16(&rec->destRoomNumber); } // Room exit class RoomExitData::RoomExitData(RoomExitResource *rec) { - xs = FROM_LE_16(rec->xs); - ys = FROM_LE_16(rec->ys); - xe = FROM_LE_16(rec->xe); - ye = FROM_LE_16(rec->ye); - sequenceOffset = FROM_LE_16(rec->sequenceOffset); + xs = READ_LE_UINT16(&rec->xs); + ys = READ_LE_UINT16(&rec->ys); + xe = READ_LE_UINT16(&rec->xe); + ye = READ_LE_UINT16(&rec->ye); + sequenceOffset = READ_LE_UINT16(&rec->sequenceOffset); roomNumber = rec->newRoom; x = rec->newRoomX; y = rec->newRoomY; @@ -304,12 +304,12 @@ void RoomDataList::loadFromStream(ReadStream *stream) { // Room exit joins class RoomExitJoinData::RoomExitJoinData(RoomExitJoinResource *rec) { - hotspots[0].hotspotId = FROM_LE_16(rec->hotspot1Id); + hotspots[0].hotspotId = READ_LE_UINT16(&rec->hotspot1Id); hotspots[0].currentFrame = rec->h1CurrentFrame; hotspots[0].destFrame = rec->h1DestFrame; hotspots[0].openSound = rec->h1OpenSound; hotspots[0].closeSound = rec->h1CloseSound; - hotspots[1].hotspotId = FROM_LE_16(rec->hotspot2Id); + hotspots[1].hotspotId = READ_LE_UINT16(&rec->hotspot2Id); hotspots[1].currentFrame = rec->h2CurrentFrame; hotspots[1].destFrame = rec->h2DestFrame; hotspots[1].openSound = rec->h2OpenSound; @@ -378,42 +378,42 @@ uint16 HotspotActionList::getActionOffset(Action action) { // Hotspot data HotspotData::HotspotData(HotspotResource *rec) { - hotspotId = FROM_LE_16(rec->hotspotId); - nameId = FROM_LE_16(rec->nameId); - descId = FROM_LE_16(rec->descId); - descId2 = FROM_LE_16(rec->descId2); + hotspotId = READ_LE_UINT16(&rec->hotspotId); + nameId = READ_LE_UINT16(&rec->nameId); + descId = READ_LE_UINT16(&rec->descId); + descId2 = READ_LE_UINT16(&rec->descId2); actions = READ_LE_UINT32(&rec->actions); - actionsOffset = FROM_LE_16(rec->actionsOffset); + actionsOffset = READ_LE_UINT16(&rec->actionsOffset); flags = (byte) (actions >> 24) & 0xf0; actions &= 0xfffffff; - roomNumber = FROM_LE_16(rec->roomNumber); + roomNumber = READ_LE_UINT16(&rec->roomNumber); layer = rec->layer; scriptLoadFlag = rec->scriptLoadFlag; - loadOffset = FROM_LE_16(rec->loadOffset); - startX = FROM_LE_16(rec->startX); - startY = FROM_LE_16(rec->startY); - width = FROM_LE_16(rec->width); - height = FROM_LE_16(rec->height); - widthCopy = FROM_LE_16(rec->widthCopy); - heightCopy = FROM_LE_16(rec->heightCopy); - yCorrection = FROM_LE_16(rec->yCorrection); - walkX = FROM_LE_16(rec->walkX); - walkY = FROM_LE_16(rec->walkY); + loadOffset = READ_LE_UINT16(&rec->loadOffset); + startX = READ_LE_UINT16(&rec->startX); + startY = READ_LE_UINT16(&rec->startY); + width = READ_LE_UINT16(&rec->width); + height = READ_LE_UINT16(&rec->height); + widthCopy = READ_LE_UINT16(&rec->widthCopy); + heightCopy = READ_LE_UINT16(&rec->heightCopy); + yCorrection = READ_LE_UINT16(&rec->yCorrection); + walkX = READ_LE_UINT16(&rec->walkX); + walkY = READ_LE_UINT16(&rec->walkY); talkX = rec->talkX; talkY = rec->talkY; - colourOffset = FROM_LE_16(rec->colourOffset); - animRecordId = FROM_LE_16(rec->animRecordId); - hotspotScriptOffset = FROM_LE_16(rec->hotspotScriptOffset); - talkScriptOffset = FROM_LE_16(rec->talkScriptOffset); - tickProcId = FROM_LE_16(rec->tickProcId); - tickTimeout = FROM_LE_16(rec->tickTimeout); - tickScriptOffset = FROM_LE_16(rec->tickScriptOffset); - npcSchedule = FROM_LE_16(rec->npcSchedule); - characterMode = (CharacterMode) FROM_LE_16(rec->characterMode); - delayCtr = FROM_LE_16(rec->delayCtr); - flags2 = FROM_LE_16(rec->flags2); - headerFlags = FROM_LE_16(rec->hdrFlags); + colourOffset = READ_LE_UINT16(&rec->colourOffset); + animRecordId = READ_LE_UINT16(&rec->animRecordId); + hotspotScriptOffset = READ_LE_UINT16(&rec->hotspotScriptOffset); + talkScriptOffset = READ_LE_UINT16(&rec->talkScriptOffset); + tickProcId = READ_LE_UINT16(&rec->tickProcId); + tickTimeout = READ_LE_UINT16(&rec->tickTimeout); + tickScriptOffset = READ_LE_UINT16(&rec->tickScriptOffset); + npcSchedule = READ_LE_UINT16(&rec->npcSchedule); + characterMode = (CharacterMode) READ_LE_UINT16(&rec->characterMode); + delayCtr = READ_LE_UINT16(&rec->delayCtr); + flags2 = READ_LE_UINT16(&rec->flags2); + headerFlags = READ_LE_UINT16(&rec->hdrFlags); // Initialise runtime fields actionCtr = 0; @@ -540,19 +540,19 @@ void HotspotDataList::loadFromStream(ReadStream *stream) { // Hotspot override data HotspotOverrideData::HotspotOverrideData(HotspotOverrideResource *rec) { - hotspotId = FROM_LE_16(rec->hotspotId); - xs = FROM_LE_16(rec->xs); - ys = FROM_LE_16(rec->ys); - xe = FROM_LE_16(rec->xe); - ye = FROM_LE_16(rec->ye); + hotspotId = READ_LE_UINT16(&rec->hotspotId); + xs = READ_LE_UINT16(&rec->xs); + ys = READ_LE_UINT16(&rec->ys); + xe = READ_LE_UINT16(&rec->xe); + ye = READ_LE_UINT16(&rec->ye); } // Hotspot animation movement frame MovementData::MovementData(MovementResource *rec) { - frameNumber = FROM_LE_16(rec->frameNumber); - xChange = FROM_LE_16(rec->xChange); - yChange = FROM_LE_16(rec->yChange); + frameNumber = READ_LE_UINT16(&rec->frameNumber); + xChange = READ_LE_UINT16(&rec->xChange); + yChange = READ_LE_UINT16(&rec->yChange); } // List of movement frames @@ -577,13 +577,12 @@ bool MovementDataList::getFrame(uint16 currentFrame, int16 &xChange, return true; } - // Hotspot animation data HotspotAnimData::HotspotAnimData(HotspotAnimResource *rec) { - animRecordId = FROM_LE_16(rec->animRecordId); - animId = FROM_LE_16(rec->animId); - flags = FROM_LE_16(rec->flags); + animRecordId = READ_LE_UINT16(&rec->animRecordId); + animId = READ_LE_UINT16(&rec->animId); + flags = READ_LE_UINT16(&rec->flags); upFrame = rec->upFrame; downFrame = rec->downFrame; @@ -649,9 +648,9 @@ uint16 TalkHeaderData::getEntry(int index) { // The following class holds a single talking entry TalkEntryData::TalkEntryData(TalkDataResource *rec) { - preSequenceId = FROM_LE_16(rec->preSequenceId); - descId = FROM_LE_16(rec->descId); - postSequenceId = FROM_LE_16(rec->postSequenceId); + preSequenceId = READ_LE_UINT16(&rec->preSequenceId); + descId = READ_LE_UINT16(&rec->descId); + postSequenceId = READ_LE_UINT16(&rec->postSequenceId); } // The following class acts as a container for all the talk entries and @@ -685,10 +684,10 @@ RoomExitCoordinates::RoomExitCoordinates(RoomExitCoordinateEntryResource *rec) { int ctr; for (ctr = 0; ctr < ROOM_EXIT_COORDINATES_NUM_ENTRIES; ++ctr) { - uint16 tempY = FROM_LE_16(rec->entries[ctr].y); - _entries[ctr].x = FROM_LE_16(rec->entries[ctr].x); + uint16 tempY = READ_LE_UINT16(&rec->entries[ctr].y); + _entries[ctr].x = READ_LE_UINT16(&rec->entries[ctr].x); _entries[ctr].y = tempY & 0xfff; - _entries[ctr].roomNumber = FROM_LE_16(rec->entries[ctr].roomNumber); + _entries[ctr].roomNumber = READ_LE_UINT16(&rec->entries[ctr].roomNumber); _entries[ctr].hotspotIndexId = (tempY >> 12) << 4; } @@ -816,13 +815,13 @@ CharacterScheduleEntry::CharacterScheduleEntry(CharacterScheduleSet *parentSet, CharacterScheduleResource *&rec) { _parent = parentSet; - if ((rec->action == 0) || (FROM_LE_16(rec->action) > NPC_JUMP_ADDRESS)) + if ((rec->action == 0) || (READ_LE_UINT16(&rec->action) > NPC_JUMP_ADDRESS)) error("Invalid action encountered reading NPC schedule"); - _action = (Action) FROM_LE_16(rec->action); + _action = (Action) READ_LE_UINT16(&rec->action); _numParams = actionNumParams[_action]; for (int index = 0; index < _numParams; ++index) - _params[index] = FROM_LE_16(rec->params[index]); + _params[index] = READ_LE_UINT16(&rec->params[index]); rec = (CharacterScheduleResource *) ((byte *) rec + (_numParams + 1) * sizeof(uint16)); @@ -999,7 +998,7 @@ void RandomActionList::loadFromStream(Common::ReadStream *stream) { RoomExitIndexedHotspotData::RoomExitIndexedHotspotData(RoomExitIndexedHotspotResource *rec) { roomNumber = rec->roomNumber; hotspotIndex = rec->hotspotIndex; - hotspotId = FROM_LE_16(rec->hotspotId); + hotspotId = READ_LE_UINT16(&rec->hotspotId); } uint16 RoomExitIndexedHotspotList::getHotspot(uint16 roomNumber, uint8 hotspotIndexId) { |