diff options
Diffstat (limited to 'engines/made')
-rw-r--r-- | engines/made/screenfx.cpp | 54 | ||||
-rw-r--r-- | engines/made/screenfx.h | 3 |
2 files changed, 51 insertions, 6 deletions
diff --git a/engines/made/screenfx.cpp b/engines/made/screenfx.cpp index 79017cc0fb..b65c3db60c 100644 --- a/engines/made/screenfx.cpp +++ b/engines/made/screenfx.cpp @@ -64,6 +64,10 @@ void ScreenEffects::run(int16 effectNum, Graphics::Surface *surface, byte *palet vfx00(surface, palette, newPalette, colorCount); break; + case 2: + vfx02(surface, palette, newPalette, colorCount); + break; + case 9: // "Checkerboard" effect vfx09(surface, palette, newPalette, colorCount); break; @@ -80,6 +84,10 @@ void ScreenEffects::run(int16 effectNum, Graphics::Surface *surface, byte *palet vfx14(surface, palette, newPalette, colorCount); break; + case 15: + vfx15(surface, palette, newPalette, colorCount); + break; + case 17: // Palette fadeout/fadein vfx17(surface, palette, newPalette, colorCount); break; @@ -121,7 +129,7 @@ void ScreenEffects::setBlendedPalette(byte *palette, byte *newPalette, int color } } -void ScreenEffects::copyRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2) { +void ScreenEffects::copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2) { // TODO: Clean up @@ -197,18 +205,41 @@ void ScreenEffects::copyRect(Graphics::Surface *surface, int16 x1, int16 y1, int } +void ScreenEffects::copyRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2) { + Graphics::Surface *vgaScreen = _screen->lockScreen(); + byte *source = (byte*)surface->getBasePtr(x1, y1); + byte *dest = (byte*)vgaScreen->getBasePtr(x1, y1); + for (int y = 0; y < y2 - y1; y++) { + memcpy(dest, source, x2 - x1); + dest += 320; + source += 320; + } + _screen->unlockScreen(); +} + // No effect void ScreenEffects::vfx00(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) { setPalette(palette); _screen->showWorkScreen(); + // FIXME: For Manhole; causes sluggish mouse + _screen->updateScreenAndWait(100); +} + +void ScreenEffects::vfx02(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) { + for (int x = 312; x >= 0; x -= 8) { + copyRect(surface, x, 0, x + 8, 200); + setBlendedPalette(palette, newPalette, colorCount, 312 - x, 312); + _screen->updateScreenAndWait(25); + } + setPalette(palette); } // "Checkerboard" effect void ScreenEffects::vfx09(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) { for (int i = 0; i < 8; i++) { - copyRect(surface, 0, 0, 320, 200); + copyFxRect(surface, 0, 0, 320, 200); for (int j = 0; j < 4; j++) { - setBlendedPalette(palette, newPalette, colorCount, i * 4 + j, 32); + setBlendedPalette(palette, newPalette, colorCount, i * 4 + j, 36/*FIX?*/); _screen->updateScreenAndWait(25); } } @@ -218,7 +249,7 @@ void ScreenEffects::vfx09(Graphics::Surface *surface, byte *palette, byte *newPa // "Screen wipe in", left to right void ScreenEffects::vfx10(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) { for (int x = -56; x < 312; x += 8) { - copyRect(surface, x, 0, x + 64, 200); + copyFxRect(surface, x, 0, x + 64, 200); setBlendedPalette(palette, newPalette, colorCount, x + 56, 368); _screen->updateScreenAndWait(25); } @@ -228,7 +259,7 @@ void ScreenEffects::vfx10(Graphics::Surface *surface, byte *palette, byte *newPa // "Screen wipe in", top to bottom void ScreenEffects::vfx12(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) { for (int y = -70; y < 312; y += 10) { - copyRect(surface, 0, y, 320, y + 80); + copyFxRect(surface, 0, y, 320, y + 80); setBlendedPalette(palette, newPalette, colorCount, y + 70, 260); _screen->updateScreenAndWait(25); } @@ -239,7 +270,7 @@ void ScreenEffects::vfx12(Graphics::Surface *surface, byte *palette, byte *newPa void ScreenEffects::vfx14(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) { int16 x = 8, y = 5; for (int i = 0; i < 27; i++) { - copyRect(surface, 160 - x, 100 - y, 160 + x, 100 + y); + copyFxRect(surface, 160 - x, 100 - y, 160 + x, 100 + y); x += 8; y += 5; setBlendedPalette(palette, newPalette, colorCount, i, 27); @@ -248,6 +279,17 @@ void ScreenEffects::vfx14(Graphics::Surface *surface, byte *palette, byte *newPa setPalette(palette); } +void ScreenEffects::vfx15(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) { + int16 x = 8; + for (int i = 0; i < 27; i++) { + copyFxRect(surface, 160 - x, 0, 160 + x, 200); + x += 8; + setBlendedPalette(palette, newPalette, colorCount, i, 27); + _screen->updateScreenAndWait(25); + } + setPalette(palette); +} + // Palette fadeout/fadein void ScreenEffects::vfx17(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) { diff --git a/engines/made/screenfx.h b/engines/made/screenfx.h index f0e706318f..1c36b3e1f1 100644 --- a/engines/made/screenfx.h +++ b/engines/made/screenfx.h @@ -51,12 +51,15 @@ private: int16 vfxX1, vfxY1, vfxWidth, vfxHeight; void setPalette(byte *palette); void setBlendedPalette(byte *palette, byte *newPalette, int colorCount, int16 value, int16 maxValue); + void copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2); void copyRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2); void vfx00(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); + void vfx02(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); void vfx09(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); void vfx10(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); void vfx12(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); void vfx14(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); + void vfx15(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); void vfx17(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); }; |