aboutsummaryrefslogtreecommitdiff
path: root/engines/made/screenfx.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2009-01-11 11:15:16 +0000
committerPaul Gilbert2009-01-11 11:15:16 +0000
commit138c1936a4be0b7c7644a0ca81b3492cf986e08d (patch)
treee605982daf7ee6f39f4fc3e5704693b8891142b2 /engines/made/screenfx.cpp
parent954a1d27d8705fa31a0cbf2f6a6597f4522b9071 (diff)
downloadscummvm-rg350-138c1936a4be0b7c7644a0ca81b3492cf986e08d.tar.gz
scummvm-rg350-138c1936a4be0b7c7644a0ca81b3492cf986e08d.tar.bz2
scummvm-rg350-138c1936a4be0b7c7644a0ca81b3492cf986e08d.zip
Completed screen vfx #8, and also implemented screen vfx #18
svn-id: r35822
Diffstat (limited to 'engines/made/screenfx.cpp')
-rw-r--r--engines/made/screenfx.cpp30
1 files changed, 27 insertions, 3 deletions
diff --git a/engines/made/screenfx.cpp b/engines/made/screenfx.cpp
index ae0c10321e..0a2db5c787 100644
--- a/engines/made/screenfx.cpp
+++ b/engines/made/screenfx.cpp
@@ -273,6 +273,22 @@ void ScreenEffects::copyRect(Graphics::Surface *surface, int16 x1, int16 y1, int
_screen->unlockScreen();
}
+void ScreenEffects::reposition(int16 x1, int16 y1, int16 x2, int16 y2, int xd, int yd) {
+ Graphics::Surface *vgaScreen = _screen->lockScreen();
+ byte *source = (byte *)vgaScreen->getBasePtr(x1, y1);
+ byte *dest = (byte *)vgaScreen->getBasePtr(xd, yd);
+ for (int y = 0; y < y2 - y1; y++) {
+ if (dest < source)
+ memcpy(dest, source, x2 - x1);
+ else
+ Common::copy_backward(source, source + x2 - x1, dest + x2 - x1);
+
+ dest += 320;
+ source += 320;
+ }
+ _screen->unlockScreen();
+}
+
// No effect
void ScreenEffects::vfx00(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
setPalette(palette);
@@ -350,6 +366,8 @@ void ScreenEffects::vfx07(Graphics::Surface *surface, byte *palette, byte *newPa
// "Screen slide in" right to left
void ScreenEffects::vfx08(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
for (int x = 8; x <= 320; x += 8) {
+ if (x != 320)
+ reposition(8, 0, 328 - x, 200, 0, 0);
copyRect(surface, 0, 0, x, 200, 320 - x, 0);
_screen->updateScreenAndWait(25);
}
@@ -478,10 +496,16 @@ void ScreenEffects::vfx17(Graphics::Surface *surface, byte *palette, byte *newPa
}
+// "Screen slide in" left to right
void ScreenEffects::vfx18(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
- // TODO
- warning("Unimplemented visual effect: 18");
- vfx00(surface, palette, newPalette, colorCount);
+ for (int x = 8; x <= 320; x += 8) {
+ if (x != 320)
+ reposition(x, 0, 312, 200, x + 8, 0);
+ copyRect(surface, 320 - x, 0, 320, 200, 0, 0);
+ _screen->updateScreenAndWait(25);
+ }
+
+ setPalette(palette);
}
void ScreenEffects::vfx19(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {