aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2007-06-06 18:04:25 +0000
committerFilippos Karapetis2007-06-06 18:04:25 +0000
commit00dac8c10f3bdd0737d3e8be025bd8d51f9d7a05 (patch)
treee0cc6b98c7efb8f7b99ab5c8ef6e4a5f573353ae /engines
parenta6c476b292bab8652ff1dc748335dfc994ce529e (diff)
downloadscummvm-rg350-00dac8c10f3bdd0737d3e8be025bd8d51f9d7a05.tar.gz
scummvm-rg350-00dac8c10f3bdd0737d3e8be025bd8d51f9d7a05.tar.bz2
scummvm-rg350-00dac8c10f3bdd0737d3e8be025bd8d51f9d7a05.zip
Implemented the sfScriptFade opcode
svn-id: r27142
Diffstat (limited to 'engines')
-rw-r--r--engines/saga/sfuncs.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index 16051b49af..ec26bda562 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -1905,7 +1905,25 @@ void Script::sfWaitFrames(SCRIPTFUNC_PARAMS) {
}
void Script::sfScriptFade(SCRIPTFUNC_PARAMS) {
- SF_stub("sfScriptFade", thread, nArgs);
+ int16 startingBrightness = thread->pop();
+ int16 endingBrightness = thread->pop();
+ thread->pop(); // first pal entry, ignored (already handled by Gfx::palToBlack)
+ thread->pop(); // last pal entry, ignored (already handled by Gfx::palToBlack)
+ // delay between pal changes is always 10 (not used)
+
+ Event event;
+ static PalEntry cur_pal[PAL_ENTRIES];
+
+ _vm->_gfx->getCurrentPal(cur_pal);
+
+ event.type = kEvTImmediate;
+ event.code = kPalEvent;
+ event.op = kEventPalToBlack;
+ event.time = 0;
+ event.duration = endingBrightness - startingBrightness;
+ event.data = cur_pal;
+
+ _vm->_events->queue(&event);
}
void Script::sfScriptStartVideo(SCRIPTFUNC_PARAMS) {