void AdlEngine_v2::loadRoom(byte roomNr) { Room &room = getRoom(roomNr); StreamPtr stream(room.data->createReadStream()); uint16 descOffset = stream->readUint16LE(); uint16 commandOffset = stream->readUint16LE(); _roomData.pictures.clear(); // There's no picture count. The original engine always checks at most // five pictures. We use the description offset to bound our search. uint16 picCount = (descOffset - 4) / 5; for (uint i = 0; i < picCount; ++i) { byte nr = stream->readByte(); _roomData.pictures[nr] = readDataBlockPtr(*stream); } _roomData.description = readStringAt(*stream, descOffset, 0xff); _roomData.commands.clear(); if (commandOffset != 0) { stream->seek(commandOffset); readCommands(*stream, _roomData.commands); } }
void HiRes4Engine_Atari::rebindDisk() { // As room.data is bound to the DiskImage, we need to rebind them here // We cannot simply reload the rooms as that would reset their state // FIXME: Remove DataBlockPtr-DiskImage coupling? StreamPtr stream(createReadStream(_boot, 0x03, 0x1, 0x0e, 9)); for (uint i = 0; i < IDI_HR4_NUM_ROOMS; ++i) { stream->skip(7); _state.rooms[i].data = readDataBlockPtr(*stream); stream->skip(3); } // Rebind data that is on both side B and C loadCommonData(); }