[Scummvm-cvs-logs] SF.net SVN: scummvm: [27142] scummvm/trunk/engines/saga/sfuncs.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Jun 6 20:04:26 CEST 2007


Revision: 27142
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27142&view=rev
Author:   thebluegr
Date:     2007-06-06 11:04:25 -0700 (Wed, 06 Jun 2007)

Log Message:
-----------
Implemented the sfScriptFade opcode

Modified Paths:
--------------
    scummvm/trunk/engines/saga/sfuncs.cpp

Modified: scummvm/trunk/engines/saga/sfuncs.cpp
===================================================================
--- scummvm/trunk/engines/saga/sfuncs.cpp	2007-06-06 18:02:33 UTC (rev 27141)
+++ scummvm/trunk/engines/saga/sfuncs.cpp	2007-06-06 18:04:25 UTC (rev 27142)
@@ -1905,7 +1905,25 @@
 }
 
 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) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list