aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorTravis Howell2009-07-21 10:37:58 +0000
committerTravis Howell2009-07-21 10:37:58 +0000
commit66311e32484d5fd5e18766125c4f09ed0604314f (patch)
tree16c1e9f48ee7e67a90ed4793f0dc8808992d86b7 /engines/agos
parent4c797d57d0ce45532e1fd3dc144ba271f2f5f86c (diff)
downloadscummvm-rg350-66311e32484d5fd5e18766125c4f09ed0604314f.tar.gz
scummvm-rg350-66311e32484d5fd5e18766125c4f09ed0604314f.tar.bz2
scummvm-rg350-66311e32484d5fd5e18766125c4f09ed0604314f.zip
Fix fade effects in Waxworks.
svn-id: r42638
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/agos.h1
-rw-r--r--engines/agos/vga_e2.cpp44
-rw-r--r--engines/agos/vga_ww.cpp22
3 files changed, 33 insertions, 34 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index b8af9df95f..ac1f33428b 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1248,6 +1248,7 @@ protected:
void hitarea_stuff_helper_2();
void fastFadeIn();
void slowFadeIn();
+ void fullFade();
virtual void vcStopAnimation(uint16 zone, uint16 sprite);
diff --git a/engines/agos/vga_e2.cpp b/engines/agos/vga_e2.cpp
index f6e6630d43..de3cb55963 100644
--- a/engines/agos/vga_e2.cpp
+++ b/engines/agos/vga_e2.cpp
@@ -353,9 +353,32 @@ void AGOSEngine::vc55_moveBox() {
_needHitAreaRecalc++;
}
-void AGOSEngine::vc56_fullScreen() {
- uint8 palette[1024];
+void AGOSEngine::fullFade() {
+ uint8 *srcPal, *dstPal;
+ int c, p;
+
+ for (c = 64; c != 0; c --) {
+ srcPal = _curVgaFile2 + 32;
+ dstPal = _currentPalette;
+ for (p = 768; p !=0 ; p -= 3) {
+ uint8 r = srcPal[0] * 4;
+ if (dstPal[0] != r)
+ dstPal[0] += 4;
+ uint8 g = srcPal[1] * 4;
+ if (dstPal[1] != g)
+ dstPal[1] += 4;
+ uint8 b = srcPal[2] * 4;
+ if (dstPal[2] != b)
+ dstPal[2] += 4;
+ srcPal += 3;
+ dstPal += 4;
+ }
+ _system->setPalette(_currentPalette, 0, 256);
+ delay(5);
+ }
+}
+void AGOSEngine::vc56_fullScreen() {
Graphics::Surface *screen = _system->lockScreen();
byte *dst = (byte *)screen->pixels;
byte *src = _curVgaFile2 + 800;
@@ -367,23 +390,12 @@ void AGOSEngine::vc56_fullScreen() {
}
_system->unlockScreen();
- //fullFade();
-
- src = _curVgaFile2 + 32;
- for (int i = 0; i < 256; i++) {
- palette[i * 4 + 0] = *src++ * 4;
- palette[i * 4 + 1] = *src++ * 4;
- palette[i * 4 + 2] = *src++ * 4;
- palette[i * 4 + 3] = 0;
- }
-
- _system->setPalette(palette, 0, 256);
+ fullFade();
}
void AGOSEngine::vc57_blackPalette() {
- uint8 palette[1024];
- memset(palette, 0, sizeof(palette));
- _system->setPalette(palette, 0, 256);
+ memset(_currentPalette, 0, sizeof(_currentPalette));
+ _system->setPalette(_currentPalette, 0, 256);
}
void AGOSEngine::vc58_checkCodeWheel() {
diff --git a/engines/agos/vga_ww.cpp b/engines/agos/vga_ww.cpp
index e7f2ad7807..afc05f7869 100644
--- a/engines/agos/vga_ww.cpp
+++ b/engines/agos/vga_ww.cpp
@@ -193,20 +193,8 @@ void AGOSEngine::vc61() {
_system->unlockScreen();
- if (a == 6) {
- //fullFade();
- src = _curVgaFile2 + 32;
-
- uint8 palette[1024];
- for (int i = 0; i < 256; i++) {
- palette[i * 4 + 0] = *src++ * 4;
- palette[i * 4 + 1] = *src++ * 4;
- palette[i * 4 + 2] = *src++ * 4;
- palette[i * 4 + 3] = 0;
- }
-
- _system->setPalette(palette, 0, 256);
- }
+ if (a == 6)
+ fullFade();
}
void AGOSEngine::vc62_fastFadeOut() {
@@ -221,8 +209,6 @@ void AGOSEngine::vc62_fastFadeOut() {
_fastFadeCount = 208;
}
- memcpy(_videoBuf1, _currentPalette, _fastFadeCount * 4);
-
if (getGameType() == GType_FF || getGameType() == GType_PP) {
if (getGameType() == GType_FF && getBitFlag(75)) {
fadeCount = 4;
@@ -237,8 +223,8 @@ void AGOSEngine::vc62_fastFadeOut() {
}
for (i = fadeCount; i != 0; --i) {
- paletteFadeOut(_videoBuf1, _fastFadeCount, fadeSize);
- _system->setPalette(_videoBuf1, 0, _fastFadeCount);
+ paletteFadeOut(_currentPalette, _fastFadeCount, fadeSize);
+ _system->setPalette(_currentPalette, 0, _fastFadeCount);
delay(5);
}