diff options
author | Filippos Karapetis | 2011-12-26 13:59:20 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-26 13:59:20 +0200 |
commit | d7335d69e351e910f33dbcc3b80a9a5d52bfd4e1 (patch) | |
tree | 29f1c12e74ebbd766a2b164d929b358cf335a0da /engines/dreamweb | |
parent | 2ca00bc3c6c2817090372450dbdd835677d3c20e (diff) | |
download | scummvm-rg350-d7335d69e351e910f33dbcc3b80a9a5d52bfd4e1.tar.gz scummvm-rg350-d7335d69e351e910f33dbcc3b80a9a5d52bfd4e1.tar.bz2 scummvm-rg350-d7335d69e351e910f33dbcc3b80a9a5d52bfd4e1.zip |
DREAMWEB: Move the roomsCanGo array out of the data blob
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreambase.h | 2 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 8 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 13 | ||||
-rw-r--r-- | engines/dreamweb/newplace.cpp | 14 | ||||
-rw-r--r-- | engines/dreamweb/saveload.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 2 |
6 files changed, 23 insertions, 20 deletions
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h index cbcfa1e46f..5ac720be89 100644 --- a/engines/dreamweb/dreambase.h +++ b/engines/dreamweb/dreambase.h @@ -98,6 +98,7 @@ protected: uint8 _underTimedText[kUnderTimedTextBufSize]; Common::List<Rain> _rainList; uint8 _initialVars[kLengthOfVars]; // TODO: This shouldn't be necessary + uint8 _roomsCanGo[16]; public: DreamBase(DreamWeb::DreamWebEngine *en); @@ -177,6 +178,7 @@ public: void showArrows(); uint8 getLocation(uint8 index); void setLocation(uint8 index); + void clearLocation(uint8 index); void resetLocation(uint8 index); void readCityPic(); void readDestIcon(); diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 66885d7623..2d58aea6c5 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -608,7 +608,7 @@ void DreamGenContext::parser() { al = '='; _stosb(); ds = cs; - si = 556; + si = 540; notspace1: _lodsw(); _cmp(al, 32); @@ -704,7 +704,7 @@ void DreamGenContext::__start() { //0x01f0: .... .... .D:. .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0200: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0210: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0220: .... .... .... .... @@ -720,10 +720,8 @@ void DreamGenContext::__start() { //0x0270: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0280: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0290: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - //0x02a0: .... .... .... .... + //0x0290: .... .... .... .... 0xff, 0xff, 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); dreamweb(); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 3d98f294ce..3da65cf189 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -345,13 +345,12 @@ static const uint16 kCurrentsample = 419; static const uint16 kRoomssample = 420; static const uint16 kBasicsample = 421; static const uint16 kCurrentfile = 462; -static const uint16 kRoomscango = 537; -static const uint16 kOplist = 553; -static const uint16 kInputline = 556; -static const uint16 kPresslist = 684; -static const uint16 kQuitrequested = 690; -static const uint16 kSubtitles = 691; -static const uint16 kForeignrelease = 692; +static const uint16 kOplist = 537; +static const uint16 kInputline = 540; +static const uint16 kPresslist = 668; +static const uint16 kQuitrequested = 674; +static const uint16 kSubtitles = 675; +static const uint16 kForeignrelease = 676; static const uint16 kBlocktextdat = (0); static const uint16 kPersonframes = (0); static const uint16 kDebuglevel1 = (0); diff --git a/engines/dreamweb/newplace.cpp b/engines/dreamweb/newplace.cpp index 03824aa706..efcffef82a 100644 --- a/engines/dreamweb/newplace.cpp +++ b/engines/dreamweb/newplace.cpp @@ -177,7 +177,7 @@ void DreamBase::nextDest() { data.byte(kDestpos)++; if (data.byte(kDestpos) == 15) data.byte(kDestpos) = 0; // last destination - } while (!data.byte(kRoomscango + data.byte(kDestpos))); + } while (!getLocation(data.byte(kDestpos))); data.byte(kNewtextline) = 1; delTextLine(); @@ -206,7 +206,7 @@ void DreamBase::lastDest() { data.byte(kDestpos)--; if (data.byte(kDestpos) == 0xFF) data.byte(kDestpos) = 15; // first destination - } while (!data.byte(kRoomscango + data.byte(kDestpos))); + } while (!getLocation(data.byte(kDestpos))); data.byte(kNewtextline) = 1; delTextLine(); @@ -235,11 +235,15 @@ void DreamBase::destSelect() { } uint8 DreamBase::getLocation(uint8 index) { - return data.byte(kRoomscango + index); + return _roomsCanGo[index]; } void DreamBase::setLocation(uint8 index) { - data.byte(kRoomscango + index) = 1; + _roomsCanGo[index] = 1; +} + +void DreamBase::clearLocation(uint8 index) { + _roomsCanGo[index] = 0; } void DreamBase::resetLocation(uint8 index) { @@ -264,7 +268,7 @@ void DreamBase::resetLocation(uint8 index) { purgeALocation(29); } - data.byte(kRoomscango + index) = 0; + clearLocation(index); } void DreamBase::readDestIcon() { diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp index 2076a349b5..4fa8cf33fe 100644 --- a/engines/dreamweb/saveload.cpp +++ b/engines/dreamweb/saveload.cpp @@ -483,7 +483,7 @@ void DreamBase::savePosition(unsigned int slot, const char *descbuf) { // len[4] == 48, which is sizeof(Room) plus 16 for 'Roomscango' outSaveFile->write((const uint8 *)&madeUpRoom, sizeof(Room)); - outSaveFile->write(data.ptr(kRoomscango, 16), 16); + outSaveFile->write(_roomsCanGo, 16); // TODO: Convert more to serializer? Common::Serializer s(0, outSaveFile); @@ -551,7 +551,7 @@ void DreamBase::loadPosition(unsigned int slot) { // Note: the values read into g_madeUpRoomDat are only used in actualLoad, // which is (almost) immediately called after this function inSaveFile->read((uint8 *)&g_madeUpRoomDat, sizeof(Room)); - inSaveFile->read(data.ptr(kRoomscango, 16), 16); + inSaveFile->read(_roomsCanGo, 16); // TODO: Use serializer for more Common::Serializer s(inSaveFile, 0); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 413bd27c85..827fb2ee22 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -3618,7 +3618,7 @@ void DreamBase::clearChanges() { const uint8 initialRoomsCanGo[] = { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - memcpy(data.ptr(kRoomscango, 16), initialRoomsCanGo, 16); + memcpy(_roomsCanGo, initialRoomsCanGo, 16); } void DreamBase::showDiaryKeys() { |