aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsylvaintv2012-04-18 22:48:21 +0200
committerEugene Sandulenko2018-03-28 17:36:57 +0200
commiteeb69f46bcdbb088fb63c06647683fbebdaec9dc (patch)
treecee1e9005502293008abb82b56077aef7965fdc2
parent3780999f3d4eaea606bea4a2f800cf4731dd69e1 (diff)
downloadscummvm-rg350-eeb69f46bcdbb088fb63c06647683fbebdaec9dc.tar.gz
scummvm-rg350-eeb69f46bcdbb088fb63c06647683fbebdaec9dc.tar.bz2
scummvm-rg350-eeb69f46bcdbb088fb63c06647683fbebdaec9dc.zip
LILLIPUT: Implement fade in/fade out
Fade from/to black
-rw-r--r--engines/lilliput/lilliput.cpp1
-rw-r--r--engines/lilliput/script.cpp32
2 files changed, 26 insertions, 7 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 7ddf193cf2..bf899eae71 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -648,7 +648,6 @@ byte *LilliputEngine::loadVGA(Common::String filename, bool loadPal) {
remainingSize -= 768;
fixPaletteEntries(_curPalette, 256);
- _system->getPaletteManager()->setPalette(_curPalette, 0, 256);
}
uint8 curByte;
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index 8eccb2630a..c9e7607867 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -24,6 +24,8 @@
#include "lilliput/script.h"
#include "common/debug.h"
+#include "common/system.h"
+
namespace Lilliput {
LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(NULL) {
@@ -1649,10 +1651,28 @@ void LilliputScript::OC_sub182EC() {
warning("OC_sub182EC");
}
void LilliputScript::OC_unkPaletteFunction_1() {
- warning("OC_unkPaletteFunction_1");
+
+ byte palette[768];
+ for (int fade = 256; fade >= 0; fade -= 8) {
+ for (int i = 0; i < 768; i++) {
+ palette[i] = (_vm->_curPalette[i] * fade) >> 8;
+ }
+ _vm->_system->getPaletteManager()->setPalette(palette, 0, 256);
+ _vm->_system->updateScreen();
+ _vm->_system->delayMillis(33);
+ }
}
void LilliputScript::OC_unkPaletteFunction_2() {
- warning("OC_unkPaletteFunction_2");
+
+ byte palette[768];
+ for (int fade = 8; fade <= 256; fade += 8) {
+ for (int i = 0; i < 768; i++) {
+ palette[i] = (_vm->_curPalette[i] * fade) >> 8;
+ }
+ _vm->_system->getPaletteManager()->setPalette(palette, 0, 256);
+ _vm->_system->updateScreen();
+ _vm->_system->delayMillis(33);
+ }
}
void LilliputScript::OC_loadAndDisplayCUBESx_GFX() {
@@ -1741,13 +1761,13 @@ void LilliputScript::OC_displayVGAFile() {
debugC(1, kDebugScript, "OC_displayVGAFile()");
_byte12A09 = 1;
- warning("TODO: unkPaletteFunction_1");
+ OC_unkPaletteFunction_1();
int curWord = _currScript->readUint16LE();
int index = _vm->_rulesChunk3[curWord];
Common::String fileName = Common::String((const char *)&_vm->_rulesChunk4[index]);
_word1881B = -1;
_vm->displayVGAFile(fileName);
- warning("TODO: unkPaletteFunction_2");
+ OC_unkPaletteFunction_2();
}
void LilliputScript::OC_sub184D7() {
@@ -1789,14 +1809,14 @@ void LilliputScript::OC_displayTitleScreen() {
void LilliputScript::OC_sub1853B() {
debugC(1, kDebugScript, "OC_initArr1853B()");
- warning("TODO: unkPaletteFunction_1");
+ OC_unkPaletteFunction_1();
_byte16F08 = 0;
_byte15FFA = 0;
sub130B6();
_vm->displayFunction12();
- warning("TODO: unkPaletteFunction_2");
+ OC_unkPaletteFunction_2();
_byte12A09 = 0;
warning("TODO: call sound function #5");
}