ADL: Load hires2 room data
This commit is contained in:
parent
fe384e0ae0
commit
c44f18a818
4 changed files with 27 additions and 1 deletions
|
@ -80,6 +80,9 @@ struct AdlGameDescription;
|
||||||
struct Room {
|
struct Room {
|
||||||
byte description;
|
byte description;
|
||||||
byte connections[6];
|
byte connections[6];
|
||||||
|
byte track;
|
||||||
|
byte sector;
|
||||||
|
byte offset;
|
||||||
byte picture;
|
byte picture;
|
||||||
byte curPicture;
|
byte curPicture;
|
||||||
};
|
};
|
||||||
|
|
|
@ -242,7 +242,7 @@ void HiRes1Engine::initState() {
|
||||||
_roomDesc.clear();
|
_roomDesc.clear();
|
||||||
f.seek(IDI_HR1_OFS_ROOMS);
|
f.seek(IDI_HR1_OFS_ROOMS);
|
||||||
for (uint i = 0; i < IDI_HR1_NUM_ROOMS; ++i) {
|
for (uint i = 0; i < IDI_HR1_NUM_ROOMS; ++i) {
|
||||||
Room room;
|
Room room = { };
|
||||||
f.readByte();
|
f.readByte();
|
||||||
_roomDesc.push_back(f.readByte());
|
_roomDesc.push_back(f.readByte());
|
||||||
for (uint j = 0; j < 6; ++j)
|
for (uint j = 0; j < 6; ++j)
|
||||||
|
|
|
@ -64,6 +64,27 @@ void HiRes2Engine::loadData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HiRes2Engine::initState() {
|
void HiRes2Engine::initState() {
|
||||||
|
Common::File f;
|
||||||
|
|
||||||
|
if (!f.open(IDS_HR2_DISK_IMAGE))
|
||||||
|
error("Failed to open file '" IDS_HR2_DISK_IMAGE "'");
|
||||||
|
|
||||||
|
_state.rooms.clear();
|
||||||
|
f.seek(IDI_HR2_OFS_ROOMS);
|
||||||
|
for (uint i = 0; i < IDI_HR2_NUM_ROOMS; ++i) {
|
||||||
|
Room room = { };
|
||||||
|
f.readByte(); // number
|
||||||
|
for (uint j = 0; j < 6; ++j)
|
||||||
|
room.connections[j] = f.readByte();
|
||||||
|
room.track = f.readByte();
|
||||||
|
room.sector = f.readByte();
|
||||||
|
room.offset = f.readByte();
|
||||||
|
f.readByte(); // always 1, possibly disk?
|
||||||
|
room.picture = f.readByte();
|
||||||
|
room.curPicture = f.readByte();
|
||||||
|
f.readByte(); // always 1, possibly disk?
|
||||||
|
_state.rooms.push_back(room);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HiRes2Engine::restartGame() {
|
void HiRes2Engine::restartGame() {
|
||||||
|
|
|
@ -44,6 +44,8 @@ namespace Adl {
|
||||||
#define IDI_HR2_OFS_INTRO_TEXT TSO(0x00, 0xd, 0x17)
|
#define IDI_HR2_OFS_INTRO_TEXT TSO(0x00, 0xd, 0x17)
|
||||||
#define IDI_HR2_OFS_VERBS T(0x19)
|
#define IDI_HR2_OFS_VERBS T(0x19)
|
||||||
#define IDI_HR2_OFS_NOUNS TS(0x22, 0x2)
|
#define IDI_HR2_OFS_NOUNS TS(0x22, 0x2)
|
||||||
|
#define IDI_HR2_OFS_ROOMS TSO(0x21, 0x5, 0x0e) // Skip bogus room 0
|
||||||
|
#define IDI_HR2_NUM_ROOMS 135
|
||||||
|
|
||||||
class HiRes2Engine : public AdlEngine {
|
class HiRes2Engine : public AdlEngine {
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue