[Scummvm-cvs-logs] SF.net SVN: scummvm: [32051] scummvm/trunk/engines/made

john_doe at users.sourceforge.net john_doe at users.sourceforge.net
Mon May 12 11:49:10 CEST 2008


Revision: 32051
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32051&view=rev
Author:   john_doe
Date:     2008-05-12 02:49:10 -0700 (Mon, 12 May 2008)

Log Message:
-----------
- Fixed timers, LGOP2 intro should now play correctly
- Some cleanup in LGOP2 opcodes

Modified Paths:
--------------
    scummvm/trunk/engines/made/made.cpp
    scummvm/trunk/engines/made/scriptfuncs_lgop2.cpp

Modified: scummvm/trunk/engines/made/made.cpp
===================================================================
--- scummvm/trunk/engines/made/made.cpp	2008-05-12 08:49:55 UTC (rev 32050)
+++ scummvm/trunk/engines/made/made.cpp	2008-05-12 09:49:10 UTC (rev 32051)
@@ -134,21 +134,26 @@
 }
 
 int16 MadeEngine::getTimer(int16 timerNum) {
-	return (_system->getMillis() - _timers[timerNum]) / 60;
+	if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers) && _timers[timerNum - 1] != -1)
+		return (_system->getMillis() - _timers[timerNum - 1]) / 60;
+	else
+		return 32000;
 }
 
 void MadeEngine::setTimer(int16 timerNum, int16 value) {
-	_timers[timerNum] = value * 60;
+	if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers))
+		_timers[timerNum - 1] = value * 60;
 }
 
 void MadeEngine::resetTimer(int16 timerNum) {
-	_timers[timerNum] = _system->getMillis();
+	if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers))
+		_timers[timerNum - 1] = _system->getMillis();
 }
 
 int16 MadeEngine::allocTimer() {
 	for (int i = 0; i < ARRAYSIZE(_timers); i++) {
 		if (_timers[i] == -1) {
-		 	resetTimer(i);
+			_timers[i] = _system->getMillis();
 			return i + 1;
 		}
 	}
@@ -156,7 +161,8 @@
 }
 
 void MadeEngine::freeTimer(int16 timerNum) {
-	_timers[timerNum] = -1;
+	if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers))
+		_timers[timerNum - 1] = -1;
 }
 
 Common::String MadeEngine::getSavegameFilename(int16 saveNum) {

Modified: scummvm/trunk/engines/made/scriptfuncs_lgop2.cpp
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs_lgop2.cpp	2008-05-12 08:49:55 UTC (rev 32050)
+++ scummvm/trunk/engines/made/scriptfuncs_lgop2.cpp	2008-05-12 09:49:10 UTC (rev 32051)
@@ -129,6 +129,7 @@
 }
 
 int16 ScriptFunctionsLgop2::o1_SHOWPAGE(int16 argc, int16 *argv) {
+	_vm->_mixer->stopHandle(_audioStreamHandle);
 	_vm->_screen->show();
 	return 0;
 }
@@ -322,7 +323,8 @@
 }
 
 int16 ScriptFunctionsLgop2::o1_DRAWSPRITE(int16 argc, int16 *argv) {
-	return _vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
+	_vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
+	return 0;
 }
 
 int16 ScriptFunctionsLgop2::o1_ERASESPRITES(int16 argc, int16 *argv) {
@@ -350,8 +352,7 @@
 }
 
 int16 ScriptFunctionsLgop2::o1_ALLOCTIMER(int16 argc, int16 *argv) {
-	int16 timerNum = _vm->allocTimer();
-	return timerNum;
+	return _vm->allocTimer();
 }
 
 int16 ScriptFunctionsLgop2::o1_FREETIMER(int16 argc, int16 *argv) {
@@ -439,6 +440,8 @@
 
 int16 ScriptFunctionsLgop2::o1_ADDMASK(int16 argc, int16 *argv) {
 	warning("Unimplemented opcode: o1_ADDMASK");
+	//PictureResource *flex = _vm->_res->getPicture(flexIndex);
+	//Graphics::Surface *sourceSurface = flex->getPicture();
 	return 0;
 }
 


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