aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2006-11-18 20:57:37 +0000
committerEugene Sandulenko2006-11-18 20:57:37 +0000
commitc558018bd97858d2ca52afd9995a70f83ee34bd6 (patch)
tree77d873312e65950d7616e2ae669fdb57c4eaff9b
parentc5bed9ebb72233072197f0bd0e2bf8bdfb8499b9 (diff)
downloadscummvm-rg350-c558018bd97858d2ca52afd9995a70f83ee34bd6.tar.gz
scummvm-rg350-c558018bd97858d2ca52afd9995a70f83ee34bd6.tar.bz2
scummvm-rg350-c558018bd97858d2ca52afd9995a70f83ee34bd6.zip
Implement o1_fadeToBlack()
svn-id: r24738
-rw-r--r--engines/cine/gfx.cpp18
-rw-r--r--engines/cine/gfx.h2
-rw-r--r--engines/cine/script.cpp6
3 files changed, 23 insertions, 3 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index e44019244d..c99f2269f4 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -369,4 +369,22 @@ void drawSpriteRaw2(byte *spritePtr, byte transColor, int16 width, int16 height,
}
}
+void fadeToBlack() {
+ for (int i = 0; i < 8; i++) {
+ if (colorMode256) {
+ for (int j = 0; j < 256; j++) {
+ palette256[j] = transformColor(palette256[j], -1, -1, -1);
+ }
+ } else {
+ for (int j = 0; j < 16; j++) {
+ c_palette[j] = transformColor(c_palette[j], -1, -1, -1);
+ }
+ }
+ gfxFlipRawPage(page1Raw);
+ g_system->updateScreen();
+ g_system->delayMillis(50);
+ }
+}
+
+
} // End of namespace Cine
diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h
index 088e476732..fc2c600b63 100644
--- a/engines/cine/gfx.h
+++ b/engines/cine/gfx.h
@@ -70,6 +70,8 @@ void drawSpriteRaw(byte *spritePtr, byte *maskPtr, int16 width, int16 height, by
void gfxDrawPlainBoxRaw(int16 x1, int16 y1, int16 x2, int16 y2, byte color, byte *page);
void drawSpriteRaw2(byte *spritePtr, byte transColor, int16 width, int16 height, byte *page, int16 x, int16 y);
+void fadeToBlack(void);
+
} // End of namespace Cine
#endif
diff --git a/engines/cine/script.cpp b/engines/cine/script.cpp
index 026fab7f2a..b1421623a6 100644
--- a/engines/cine/script.cpp
+++ b/engines/cine/script.cpp
@@ -1501,8 +1501,8 @@ void o1_blitAndFade() {
void o1_fadeToBlack() {
debugC(5, kCineDebugScript, "Line: %d: request fadeout", _currentLine);
- //fadeToBlack();
- warning("STUB: o1_fadeToBlack()");
+
+ fadeToBlack();
}
void o1_transformPaletteRange() {
@@ -1512,7 +1512,7 @@ void o1_transformPaletteRange() {
uint16 g = getNextWord();
uint16 b = getNextWord();
- debugC(5, kCineDebugScript, "Line: %d: transformPaletteRange(from:%d,numIdx:%d,r:%d,g:%d,b:%d) -> unimplemented", _currentLine, startColor, numColor, r, g, b);
+ debugC(5, kCineDebugScript, "Line: %d: transformPaletteRange(from:%d,numIdx:%d,r:%d,g:%d,b:%d)", _currentLine, startColor, numColor, r, g, b);
transformPaletteRange(startColor, numColor, r, g, b);
}