diff options
author | Max Horn | 2011-12-08 00:06:46 +0100 |
---|---|---|
committer | Max Horn | 2011-12-08 00:24:25 +0100 |
commit | cb0a12033b97064b35c30d5d86406b4b16517532 (patch) | |
tree | cfa8f16afdd7a0105065cedeca8658db25fe3a80 /engines/dreamweb | |
parent | 25b6496643500f03ba4f8fa59d8998a8c7503cd2 (diff) | |
download | scummvm-rg350-cb0a12033b97064b35c30d5d86406b4b16517532.tar.gz scummvm-rg350-cb0a12033b97064b35c30d5d86406b4b16517532.tar.bz2 scummvm-rg350-cb0a12033b97064b35c30d5d86406b4b16517532.zip |
DREAMWEB: Move more stuff to DreamBase
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreambase.h | 28 | ||||
-rw-r--r-- | engines/dreamweb/dreamweb.cpp | 2 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 25 | ||||
-rw-r--r-- | engines/dreamweb/vgafades.cpp | 35 | ||||
-rw-r--r-- | engines/dreamweb/vgagrafx.cpp | 36 |
6 files changed, 58 insertions, 72 deletions
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h index 9c84a3c493..32d53dc24c 100644 --- a/engines/dreamweb/dreambase.h +++ b/engines/dreamweb/dreambase.h @@ -73,11 +73,36 @@ public: void showRyanPage(); void volumeAdjust(); + // from vgafades.cpp + uint8 *mainPalette(); + uint8 *startPalette(); + uint8 *endPalette(); + void clearStartPal(); + void clearEndPal(); + void palToStartPal(); + void endPalToStart(); + void startPalToEnd(); + void palToEndPal(); + void doFade(); + void fadeCalculation(); + void fadeScreenUp(); + void fadeScreenUps(); + void fadeScreenUpHalf(); + void fadeScreenDown(); + void fadeScreenDowns(); + // from vgagrafx.cpp uint8 _workspace[(0x1000 + 2) * 16]; inline uint8 *workspace() { return _workspace; } void clearWork(); + uint8 *mapStore(); + void panelToMap(); + void mapToPanel(); + void dumpMap(); + + void transferInv(); + void multiGet(uint8 *dst, uint16 x, uint16 y, uint8 width, uint8 height); void multiPut(const uint8 *src, uint16 x, uint16 y, uint8 width, uint8 height); void multiDump(uint16 x, uint16 y, uint8 width, uint8 height); @@ -89,9 +114,12 @@ public: void frameOutBh(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); void frameOutFx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); void doShake(); + void vSync(); + void setMode(); void showPCX(const Common::String &name); void showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height); void showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag); + void loadPalFromIFF(); void createPanel(); void createPanel2(); void showPanel(); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index df39c4dfd6..f129964019 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -101,7 +101,7 @@ void DreamWebEngine::waitForVSync() { } _base.doShake(); - _context.doFade(); + _base.doFade(); _system->updateScreen(); } diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 923d0f76af..130f3038d4 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -838,10 +838,6 @@ bool DreamGenContext::openForLoad(unsigned int slot) { return engine->openSaveFileForReading(filename); } -uint8 *DreamGenContext::mapStore() { - return getSegment(data.word(kMapstore)).ptr(0, 0); -} - void DreamGenContext::readMouse() { data.word(kOldbutton) = data.word(kMousebutton); uint16 state = readMouseState(); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 87e9143716..3bf4ffa8dd 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -46,7 +46,6 @@ void hangOnCurs(uint16 frameCount); void hangOnCurs(); void workToScreen(); - uint8 *mapStore(); void multiGet(); void multiGet(uint8 *dst, uint16 x, uint16 y, uint8 width, uint8 height) { DreamBase::multiGet(dst, x, y, width, height); @@ -85,7 +84,6 @@ void dumpTextLine(); void oldToNames(); void namesToOld(); - void loadPalFromIFF(); void startLoading(const Room &room); Sprite *spriteTable(); void showFrame(); @@ -218,11 +216,7 @@ void addToPeopleList(); void addToPeopleList(ReelRoutine *routine); void getExPos(); - void panelToMap(); - void mapToPanel(); - void dumpMap(); void obPicture(); - void transferInv(); void obIcons(); void compare(); bool compare(uint8 index, uint8 flag, const char id[4]); @@ -271,17 +265,6 @@ void transferText(); void initRain(); Rain *splitIntoLines(uint8 x, uint8 y, Rain *rain); - uint8 *mainPalette(); - uint8 *startPalette(); - uint8 *endPalette(); - void clearStartPal(); - void clearEndPal(); - void palToStartPal(); - void endPalToStart(); - void startPalToEnd(); - void palToEndPal(); - void doFade(); - void fadeCalculation(); void watchCount(); void zoomIcon(); void loadRoom(); @@ -496,19 +479,12 @@ void readKey(); void hangOne(uint16 delay); void hangOne(); - void showPCX(const Common::String &name); void bibleQuote(); void realCredits(); void intro(); - void fadeScreenUp(); - void fadeScreenUps(); - void fadeScreenUpHalf(); - void fadeScreenDown(); - void fadeScreenDowns(); void clearBeforeLoad(); void clearReels(); void getRidOfReels(); - void setMode(); void liftNoise(uint8 index); void setTopLeft(); void setTopRight(); @@ -575,7 +551,6 @@ void dumpZoom(); void fadeDOS(); void selectLocation(); - void vSync(); void showGroup(); void loadSpeech(); void closeFile(); diff --git a/engines/dreamweb/vgafades.cpp b/engines/dreamweb/vgafades.cpp index 7b483179d1..bb0bd21ed8 100644 --- a/engines/dreamweb/vgafades.cpp +++ b/engines/dreamweb/vgafades.cpp @@ -24,43 +24,43 @@ namespace DreamGen { -uint8 *DreamGenContext::mainPalette() { +uint8 *DreamBase::mainPalette() { return getSegment(data.word(kBuffers)).ptr(kMaingamepal, 256 * 3); } -uint8 *DreamGenContext::startPalette() { +uint8 *DreamBase::startPalette() { return getSegment(data.word(kBuffers)).ptr(kStartpal, 256 * 3); } -uint8 *DreamGenContext::endPalette() { +uint8 *DreamBase::endPalette() { return getSegment(data.word(kBuffers)).ptr(kEndpal, 256 * 3); } -void DreamGenContext::clearStartPal() { +void DreamBase::clearStartPal() { memset(startPalette(), 0, 256 * 3); } -void DreamGenContext::clearEndPal() { +void DreamBase::clearEndPal() { memset(endPalette(), 0, 256 * 3); } -void DreamGenContext::palToStartPal() { +void DreamBase::palToStartPal() { memcpy(startPalette(), mainPalette(), 256 * 3); } -void DreamGenContext::endPalToStart() { +void DreamBase::endPalToStart() { memcpy(startPalette(), endPalette(), 256 * 3); } -void DreamGenContext::startPalToEnd() { +void DreamBase::startPalToEnd() { memcpy(endPalette(), startPalette(), 256 * 3); } -void DreamGenContext::palToEndPal() { +void DreamBase::palToEndPal() { memcpy(endPalette(), mainPalette(), 256 * 3); } -void DreamGenContext::doFade() { +void DreamBase::doFade() { if (data.byte(kFadedirection) == 0) return @@ -73,7 +73,7 @@ void DreamGenContext::doFade() { fadeCalculation(); } -void DreamGenContext::fadeCalculation() { +void DreamBase::fadeCalculation() { if (data.byte(kFadecount) == 0) { data.byte(kFadedirection) = 0; return; @@ -81,7 +81,7 @@ void DreamGenContext::fadeCalculation() { uint8 *startPal = startPalette(); const uint8 *endPal = endPalette(); - for (size_t i = 0; i < 256 * 3; ++i, ++si, ++di) { + for (size_t i = 0; i < 256 * 3; ++i) { uint8 s = startPal[i]; uint8 e = endPal[i]; if (s == e) @@ -121,7 +121,7 @@ void DreamGenContext::fadeupMonFirst() { hangOn(64); } -void DreamGenContext::fadeScreenUp() { +void DreamBase::fadeScreenUp() { clearStartPal(); palToEndPal(); data.byte(kFadedirection) = 1; @@ -130,8 +130,7 @@ void DreamGenContext::fadeScreenUp() { data.byte(kNumtofade) = 128; } - -void DreamGenContext::fadeScreenUps() { +void DreamBase::fadeScreenUps() { clearStartPal(); palToEndPal(); data.byte(kFadedirection) = 1; @@ -140,7 +139,7 @@ void DreamGenContext::fadeScreenUps() { data.byte(kNumtofade) = 64; } -void DreamGenContext::fadeScreenUpHalf() { +void DreamBase::fadeScreenUpHalf() { endPalToStart(); palToEndPal(); data.byte(kFadedirection) = 1; @@ -149,7 +148,7 @@ void DreamGenContext::fadeScreenUpHalf() { data.byte(kNumtofade) = 32; } -void DreamGenContext::fadeScreenDown() { +void DreamBase::fadeScreenDown() { palToStartPal(); clearEndPal(); data.byte(kFadedirection) = 1; @@ -158,7 +157,7 @@ void DreamGenContext::fadeScreenDown() { data.byte(kNumtofade) = 128; } -void DreamGenContext::fadeScreenDowns() { +void DreamBase::fadeScreenDowns() { palToStartPal(); clearEndPal(); data.byte(kFadedirection) = 1; diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp index 4c3ba57e6c..8d303d1a04 100644 --- a/engines/dreamweb/vgagrafx.cpp +++ b/engines/dreamweb/vgagrafx.cpp @@ -178,32 +178,16 @@ void DreamBase::doShake() { engine->setShakePos(offset >= 0 ? offset : -offset); } -void DreamGenContext::vSync() { - push(ax); - push(bx); - push(cx); - push(dx); - push(si); - push(di); - push(es); - push(ds); +void DreamBase::vSync() { engine->waitForVSync(); - ds = pop(); - es = pop(); - di = pop(); - si = pop(); - dx = pop(); - cx = pop(); - bx = pop(); - ax = pop(); } -void DreamGenContext::setMode() { +void DreamBase::setMode() { vSync(); initGraphics(320, 200, false); } -void DreamGenContext::showPCX(const Common::String &name) { +void DreamBase::showPCX(const Common::String &name) { Common::File pcxFile; if (!pcxFile.open(name)) { @@ -415,19 +399,23 @@ void DreamGenContext::zoom() { data.byte(kDidzoom) = 1; } -void DreamGenContext::panelToMap() { +uint8 *DreamBase::mapStore() { + return getSegment(data.word(kMapstore)).ptr(0, 0); +} + +void DreamBase::panelToMap() { multiGet(mapStore(), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); } -void DreamGenContext::mapToPanel() { +void DreamBase::mapToPanel() { multiPut(mapStore(), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); } -void DreamGenContext::dumpMap() { +void DreamBase::dumpMap() { multiDump(data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); } -void DreamGenContext::transferInv() { +void DreamBase::transferInv() { const Frame *freeFrames = (const Frame *)getSegment(data.word(kFreeframes)).ptr(kFrframedata, 0); const Frame *freeFrame = freeFrames + (3 * data.byte(kItemtotran) + 1); Frame *exFrames = (Frame *)getSegment(data.word(kExtras)).ptr(kExframedata, 0); @@ -453,7 +441,7 @@ bool DreamGenContext::pixelCheckSet(const ObjPos *pos, uint8 x, uint8 y) { return *ptr != 0; } -void DreamGenContext::loadPalFromIFF() { +void DreamBase::loadPalFromIFF() { engine->openFile("DREAMWEB.PAL"); engine->readFromFile(mapStore(), 2000); engine->closeFile(); |