diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamweb.cpp | 6 | ||||
-rw-r--r-- | engines/dreamweb/dreamweb.h | 31 | ||||
-rw-r--r-- | engines/dreamweb/object.cpp | 13 | ||||
-rw-r--r-- | engines/dreamweb/saveload.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 18 |
5 files changed, 30 insertions, 42 deletions
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index b752ae7433..e91f5cbd41 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -39,8 +39,10 @@ namespace DreamWeb { DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _rnd("dreamweb"), - _exText(kNumExObjects+2), - _setDesc(130), _blockDesc(98), _roomDesc(38), _freeDesc(82), _personText(1026) { + _exText(kNumExTexts), + _setDesc(kNumSetTexts), _blockDesc(kNumBlockTexts), + _roomDesc(kNumRoomTexts), _freeDesc(kNumFreeTexts), + _personText(kNumPersonTexts) { // Setup mixer _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index b7713352ff..4b84992d92 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -75,25 +75,18 @@ const unsigned int kOpsy = 52; const unsigned int kSymbolx = 64; const unsigned int kSymboly = 56; const unsigned int kLengthofvars = 68; -const unsigned int kDebuglevel1 = (0); -const unsigned int kDebuglevel2 = (0); -const unsigned int kPlayback = (0); -const unsigned int kSpanish = (0); -const unsigned int kRecording = (0); -const unsigned int kGerman = (0); -const unsigned int kDemo = (0); -const unsigned int kExframedata = (0); -const unsigned int kExframes = (0+2080); -const unsigned int kExdata = (0+2080+30000); -const unsigned int kExtextdat = (0+2080+30000+(16*114)); -const unsigned int kExtext = (0+2080+30000+(16*114)+((114+2)*2)); -const unsigned int kLengthofextra = (0+2080+30000+(16*114)+((114+2)*2)+18000); -const unsigned int kForeign = (1); -const unsigned int kCd = (1); -const unsigned int kNumexobjects = (114); -const unsigned int kExtextlen = (18000); -const unsigned int kExframeslen = (30000); -const unsigned int kItempicsize = (44); +const unsigned int kFrameBlocksize = 2080; +const unsigned int kNumexobjects = 114; +const unsigned int kNumExTexts = kNumexobjects + 2; +const uint16 kExtextlen = 18000; +const uint16 kExframeslen = 30000; +const unsigned int kLengthofextra = kFrameBlocksize + kExframeslen + sizeof(DynObject)*kNumexobjects + sizeof(uint16)*kNumExTexts + kExtextlen; +const unsigned int kItempicsize = 44; +const unsigned int kNumSetTexts = 130; +const unsigned int kNumBlockTexts = 98; +const unsigned int kNumRoomTexts = 38; +const unsigned int kNumFreeTexts = 82; +const unsigned int kNumPersonTexts = 1026; // Keyboard buffer. data.word(kBufferin) and data.word(kBufferout) are indexes // into this, making it a ring buffer diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index a9cbadcc2c..b39be9cbe1 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -585,23 +585,16 @@ void DreamWebEngine::purgeALocation(uint8 index) { } const uint8 *DreamWebEngine::getObTextStart() { - const uint16 kSettext = 130*2; - const uint16 kFreetext = 82*2; - - const uint8 *textBase; + const uint8 *textBase = 0; const uint8 *text; - uint16 textOff; + uint16 textOff = 0; if (_objectType == kFreeObjectType) { - textBase = (const uint8 *)_freeDesc._text; - textOff = kFreetext; text = (const uint8 *)_freeDesc.getString(_command); } else if (_objectType == kSetObjectType1) { textBase = (const uint8 *)_setDesc._text; - textOff = kSettext; + textOff = kNumSetTexts * 2; text = (const uint8 *)_setDesc.getString(_command); } else { - textBase = (const uint8 *)_exText._text; - textOff = kExtext; text = (const uint8 *)_exText.getString(_command); } diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp index 76770f060e..9b16d14e7b 100644 --- a/engines/dreamweb/saveload.cpp +++ b/engines/dreamweb/saveload.cpp @@ -542,7 +542,7 @@ void DreamWebEngine::savePosition(unsigned int slot, const char *descbuf) { syncGameVars(s, _vars); // the Extras segment: - outSaveFile->write((const uint8 *)_exFrames._frames, 2080); + outSaveFile->write((const uint8 *)_exFrames._frames, kFrameBlocksize); outSaveFile->write((const uint8 *)_exFrames._data, kExframeslen); outSaveFile->write((const uint8 *)_exData, sizeof(DynObject)*kNumexobjects); outSaveFile->write((const uint8 *)_exText._offsetsLE, 2*(kNumExObjects+2)); @@ -616,7 +616,7 @@ void DreamWebEngine::loadPosition(unsigned int slot) { syncGameVars(s, _vars); // the Extras segment: - inSaveFile->read((uint8 *)_exFrames._frames, kExframes); + inSaveFile->read((uint8 *)_exFrames._frames, kFrameBlocksize); inSaveFile->read((uint8 *)_exFrames._data, kExframeslen); inSaveFile->read((uint8 *)_exData, sizeof(DynObject)*kNumexobjects); inSaveFile->read((uint8 *)_exText._offsetsLE, 2*(kNumExObjects+2)); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index f009bd5963..cf1eb4575e 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -786,20 +786,20 @@ void DreamWebEngine::loadGraphicsFile(GraphicsFile &file, const char *fileName) f.read((uint8 *)&header, sizeof(FileHeader)); uint16 sizeInBytes = header.len(0); - assert(sizeInBytes >= 2080); + assert(sizeInBytes >= kFrameBlocksize); delete[] file._data; - file._data = new uint8[sizeInBytes - 2080]; + file._data = new uint8[sizeInBytes - kFrameBlocksize]; - f.read((uint8 *)file._frames, 2080); - f.read(file._data, sizeInBytes - 2080); + f.read((uint8 *)file._frames, kFrameBlocksize); + f.read(file._data, sizeInBytes - kFrameBlocksize); } void DreamWebEngine::loadGraphicsSegment(GraphicsFile &file, unsigned int len) { - assert(len >= 2080); + assert(len >= kFrameBlocksize); delete[] file._data; - file._data = new uint8[len - 2080]; - readFromFile((uint8 *)file._frames, 2080); - readFromFile(file._data, len - 2080); + file._data = new uint8[len - kFrameBlocksize]; + readFromFile((uint8 *)file._frames, kFrameBlocksize); + readFromFile(file._data, len - kFrameBlocksize); } void DreamWebEngine::loadTextSegment(TextFile &file, unsigned int len) { @@ -3538,7 +3538,7 @@ void DreamWebEngine::clearChanges() { _vars._exFramePos = 0; _vars._exTextPos = 0; - memset(_exFrames._frames, 0xFF, 2080); + memset(_exFrames._frames, 0xFF, kFrameBlocksize); memset(_exFrames._data, 0xFF, kExframeslen); memset(_exData, 0xFF, sizeof(DynObject) * kNumexobjects); memset(_exText._offsetsLE, 0xFF, 2*(kNumexobjects+2)); |