diff options
author | Willem Jan Palenstijn | 2011-12-23 22:56:39 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-12-23 23:46:38 +0100 |
commit | 10774daa586008af8e327a58a3ee910482a7cbfb (patch) | |
tree | ff243d978439416adbf9c16875d7cef0131e164b | |
parent | 814793de49f8002fbac17fdd604399a4f694ddf8 (diff) | |
download | scummvm-rg350-10774daa586008af8e327a58a3ee910482a7cbfb.tar.gz scummvm-rg350-10774daa586008af8e327a58a3ee910482a7cbfb.tar.bz2 scummvm-rg350-10774daa586008af8e327a58a3ee910482a7cbfb.zip |
DREAMWEB: Move backgrounds, zoom space, initial vars out of buffers
-rw-r--r-- | engines/dreamweb/dreambase.h | 16 | ||||
-rw-r--r-- | engines/dreamweb/keypad.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/monitor.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 45 |
4 files changed, 39 insertions, 30 deletions
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h index 3428a8cef8..26f0395732 100644 --- a/engines/dreamweb/dreambase.h +++ b/engines/dreamweb/dreambase.h @@ -35,8 +35,17 @@ namespace DreamWeb { namespace DreamGen { - + // Note: duplication from dreamgen.h const unsigned int kNumReelRoutines = 57; +const unsigned int kUnderTextSizeX = 180; +const unsigned int kUnderTextSizeY = 10; +const unsigned int kUnderTimedTextSizeY = 24; +const unsigned int kUnderTextSizeX_f = 228; // foreign version +const unsigned int kUnderTextSizeY_f = 13; // foreign version +const unsigned int kUnderTimedTextSizeY_f = 30; +const unsigned int kUnderTextBufSize = kUnderTextSizeX_f * kUnderTextSizeY_f; +const unsigned int kUnderTimedTextBufSize = 256 * kUnderTextSizeY_f; +const unsigned int kLengthOfVars = 68; /** * This class is one of the parent classes of DreamGenContext. Its sole purpose @@ -69,6 +78,8 @@ protected: ReelRoutine *_personData; // from Buffers + uint8 _textUnder[kUnderTextBufSize]; + uint8 _pointerBack[32*32]; uint8 _mapFlags[11*10*3]; uint8 _startPal[3*256]; uint8 _endPal[3*256]; @@ -77,7 +88,10 @@ protected: Common::List<ObjPos> _freeList; Common::List<ObjPos> _exList; Common::List<People> _peopleList; + uint8 _zoomSpace[46*40]; + uint8 _underTimedText[kUnderTimedTextBufSize]; Common::List<Rain> _rainList; + uint8 _initialVars[kLengthOfVars]; // TODO: This shouldn't be necessary public: DreamBase(DreamWeb::DreamWebEngine *en); diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp index 6e6941918f..d0ef260e90 100644 --- a/engines/dreamweb/keypad.cpp +++ b/engines/dreamweb/keypad.cpp @@ -25,11 +25,11 @@ namespace DreamGen { void DreamBase::getUnderMenu() { - multiGet(getSegment(data.word(kBuffers)).ptr(kUndertimedtext, 0), kMenux, kMenuy, 48, 48); + multiGet(_underTimedText, kMenux, kMenuy, 48, 48); } void DreamBase::putUnderMenu() { - multiPut(getSegment(data.word(kBuffers)).ptr(kUndertimedtext, 0), kMenux, kMenuy, 48, 48); + multiPut(_underTimedText, kMenux, kMenuy, 48, 48); } void DreamBase::singleKey(uint8 key, uint16 x, uint16 y) { diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp index 665265052a..9a1076a92f 100644 --- a/engines/dreamweb/monitor.cpp +++ b/engines/dreamweb/monitor.cpp @@ -267,7 +267,7 @@ void DreamBase::printCurs() { height = 11; } else height = 8; - multiGet(textUnder(), x, y, 6, height); + multiGet(_textUnder, x, y, 6, height); ++data.word(kMaintimer); if ((data.word(kMaintimer) & 16) == 0) showFrame(engine->tempCharset(), x, y, '/' - 32, 0); @@ -284,7 +284,7 @@ void DreamBase::delCurs() { height = 11; } else height = 8; - multiPut(textUnder(), x, y, width, height); + multiPut(_textUnder, x, y, width, height); multiDump(x, y, width, height); } diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 3e7a694c91..388244676d 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -740,10 +740,6 @@ void DreamBase::switchRyanOff() { data.byte(kRyanon) = 1; } -uint8 *DreamBase::textUnder() { - return getSegment(data.word(kBuffers)).ptr(kTextunder, 0); -} - uint16 DreamBase::standardLoad(const char *fileName, uint16 *outSizeInBytes) { FileHeader header; @@ -833,17 +829,17 @@ void DreamBase::dumpTextLine() { } void DreamBase::getUnderTimed() { - uint16 y = data.byte(kTimedy); if (data.byte(kForeignrelease)) - y -= 3; - multiGet(getSegment(data.word(kBuffers)).ptr(kUndertimedtext, 0), data.byte(kTimedx), y, 240, kUndertimedysize); + multiGet(_underTimedText, data.byte(kTimedx), data.byte(kTimedy) - 3, 240, kUnderTimedTextSizeY_f); + else + multiGet(_underTimedText, data.byte(kTimedx), data.byte(kTimedy), 240, kUnderTimedTextSizeY); } void DreamBase::putUnderTimed() { - uint16 y = data.byte(kTimedy); if (data.byte(kForeignrelease)) - y -= 3; - multiPut(getSegment(data.word(kBuffers)).ptr(kUndertimedtext, 0), data.byte(kTimedx), y, 240, kUndertimedysize); + multiPut(_underTimedText, data.byte(kTimedx), data.byte(kTimedy) - 3, 240, kUnderTimedTextSizeY_f); + else + multiPut(_underTimedText, data.byte(kTimedx), data.byte(kTimedy), 240, kUnderTimedTextSizeY); } void DreamGenContext::triggerMessage(uint16 index) { @@ -1131,11 +1127,10 @@ void DreamBase::crosshair() { } void DreamBase::delTextLine() { - uint16 x = data.word(kTextaddressx); - uint16 y = data.word(kTextaddressy); - if (data.byte(kForeignrelease) != 0) - y -= 3; - multiPut(textUnder(), x, y, kUndertextsizex, kUndertextsizey); + if (data.byte(kForeignrelease)) + multiPut(_textUnder, data.byte(kTextaddressx), data.word(kTextaddressy) - 3, kUnderTextSizeX_f, kUnderTextSizeY_f); + else + multiPut(_textUnder, data.byte(kTextaddressx), data.word(kTextaddressy), kUnderTextSizeX, kUnderTextSizeY); } void DreamGenContext::commandOnly() { @@ -1514,7 +1509,7 @@ void DreamBase::delPointer() { data.word(kDelherey) = data.word(kOldpointery); data.byte(kDelxs) = data.byte(kPointerxs); data.byte(kDelys) = data.byte(kPointerys); - multiPut(getSegment(data.word(kBuffers)).ptr(kPointerback, 0), data.word(kDelherex), data.word(kDelherey), data.byte(kPointerxs), data.byte(kPointerys)); + multiPut(_pointerBack, data.word(kDelherex), data.word(kDelherey), data.byte(kPointerxs), data.byte(kPointerys)); } void DreamBase::showBlink() { @@ -1594,7 +1589,7 @@ void DreamBase::showPointer() { uint16 yMin = (y >= height / 2) ? y - height / 2 : 0; data.word(kOldpointerx) = xMin; data.word(kOldpointery) = yMin; - multiGet(getSegment(data.word(kBuffers)).ptr(kPointerback, 0), xMin, yMin, width, height); + multiGet(_pointerBack, xMin, yMin, width, height); showFrame(frames, x, y, 3 * data.byte(kItemframe) + 1, 128); showFrame(engine->icons1(), x, y, 3, 128); } else { @@ -1607,7 +1602,7 @@ void DreamBase::showPointer() { height = 12; data.byte(kPointerxs) = width; data.byte(kPointerys) = height; - multiGet(getSegment(data.word(kBuffers)).ptr(kPointerback, 0), x, y, width, height); + multiGet(_pointerBack, x, y, width, height); showFrame(engine->icons1(), x, y, data.byte(kPointerframe) + 20, 0); } } @@ -3059,18 +3054,18 @@ void DreamBase::showDiary() { } void DreamBase::underTextLine() { - uint16 y = data.word(kTextaddressy); if (data.byte(kForeignrelease)) - y -= 3; - multiGet(textUnder(), data.byte(kTextaddressx), y, kUndertextsizex, kUndertextsizey); + multiGet(_textUnder, data.byte(kTextaddressx), data.word(kTextaddressy) - 3, kUnderTextSizeX_f, kUnderTextSizeY_f); + else + multiGet(_textUnder, data.byte(kTextaddressx), data.word(kTextaddressy), kUnderTextSizeX, kUnderTextSizeY); } void DreamBase::getUnderZoom() { - multiGet(getSegment(data.word(kBuffers)).ptr(kZoomspace, 0), kZoomx + 5, kZoomy + 4, 46, 40); + multiGet(_zoomSpace, kZoomx + 5, kZoomy + 4, 46, 40); } void DreamBase::putUnderZoom() { - multiPut(getSegment(data.word(kBuffers)).ptr(kZoomspace, 0), kZoomx + 5, kZoomy + 4, 46, 40); + multiPut(_zoomSpace, kZoomx + 5, kZoomy + 4, 46, 40); } void DreamBase::showWatchReel() { @@ -3697,7 +3692,7 @@ void DreamBase::clearBuffers() { memset(getSegment(data.word(kExtras)).ptr(0, kLengthofextra), 0xFF, kLengthofextra); - memcpy(getSegment(data.word(kBuffers)).ptr(kInitialvars, kLengthofvars), data.ptr(kStartvars, kLengthofvars), kLengthofvars); + memcpy(_initialVars, data.ptr(kStartvars, kLengthofvars), kLengthofvars); clearChanges(); } @@ -3707,7 +3702,7 @@ void DreamBase::clearChanges() { setupInitialReelRoutines(); - memcpy(data.ptr(kStartvars, kLengthofvars), getSegment(data.word(kBuffers)).ptr(kInitialvars, kLengthofvars), kLengthofvars); + memcpy(data.ptr(kStartvars, kLengthofvars), _initialVars, kLengthofvars); data.byte(kExpos) = 0; data.word(kExframepos) = 0; |