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

john_doe at users.sourceforge.net john_doe at users.sourceforge.net
Wed Jun 18 13:01:51 CEST 2008


Revision: 32731
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32731&view=rev
Author:   john_doe
Date:     2008-06-18 04:01:51 -0700 (Wed, 18 Jun 2008)

Log Message:
-----------
- Fixed sprite drawing in Rodney's Funscreen
- Handle mouse button up events and event number fixes in MadeEngine::handleEvents()
- Use milliseconds -> game ticks calculation based on Windows version of the original engine
- "Rodney's Fun Screen" -> "Rodney's Funscreen"

Modified Paths:
--------------
    scummvm/trunk/engines/made/database.cpp
    scummvm/trunk/engines/made/detection.cpp
    scummvm/trunk/engines/made/made.cpp
    scummvm/trunk/engines/made/made.h
    scummvm/trunk/engines/made/scriptfuncs.cpp

Modified: scummvm/trunk/engines/made/database.cpp
===================================================================
--- scummvm/trunk/engines/made/database.cpp	2008-06-18 03:31:13 UTC (rev 32730)
+++ scummvm/trunk/engines/made/database.cpp	2008-06-18 11:01:51 UTC (rev 32731)
@@ -88,12 +88,9 @@
 	if (getClass() == 0x7FFF) {
 		byte *vector = (byte*)getData();
 		return vector[index];
-	} else if (getClass() == 0x7FFE) {
+	} else if (getClass() <= 0x7FFE) {
 		int16 *vector = (int16*)getData();
 		return READ_LE_UINT16(&vector[index]);
-	} else if (getClass() < 0x7FFE) {
-		int16 *vector = (int16*)getData();
-		return READ_LE_UINT16(&vector[index]);
 	} else {
 		// should never reach here
 		error("Unknown object class");
@@ -372,7 +369,7 @@
 	debug(2, "textOffs = %08X; textSize = %08X; objectCount = %d; varObjectCount = %d; gameStateSize = %d; objectsOffs = %08X; objectsSize = %d\n", textOffs, textSize, objectCount, varObjectCount, _gameStateSize, objectsOffs, objectsSize);
 
 	_gameState = new byte[_gameStateSize + 2];
-	memset(_gameState, 0, _gameStateSize);
+	memset(_gameState, 0, _gameStateSize + 2);
 	setVar(1, objectCount);
 
 	sourceS.seek(textOffs);
@@ -441,7 +438,7 @@
 	int16 *propPtr2 = prop + count2;
 
 	// First see if the property exists in the given object
-	while (count2-- > 0) {
+	while (count2--) {
 		if ((READ_LE_UINT16(prop) & 0x7FFF) == propertyId) {
 			propertyFlag = obj->getFlags() & 1;
 			return propPtr1;
@@ -467,8 +464,8 @@
 		propPtr1 = propPtr2 + count1 - count2;
 		int16 *propertyPtr = prop + count1;
 
-		while (count2-- > 0) {
-			if (!(READ_LE_UINT16(prop) & 0x8000)) {
+		while (count2--) {
+			if ((READ_LE_UINT16(prop) & 0x8000) == 0) {
 				if ((READ_LE_UINT16(prop) & 0x7FFF) == propertyId) {
 					propertyFlag = obj->getFlags() & 1;
 					return propPtr1;

Modified: scummvm/trunk/engines/made/detection.cpp
===================================================================
--- scummvm/trunk/engines/made/detection.cpp	2008-06-18 03:31:13 UTC (rev 32730)
+++ scummvm/trunk/engines/made/detection.cpp	2008-06-18 11:01:51 UTC (rev 32731)
@@ -65,7 +65,7 @@
 	{"manhole", "The Manhole"},
 	{"rtz", "Return to Zork"},
 	{"lgop2", "Leather Goddesses of Phobos 2"},
-	{"rodney", "Rodney's Fun Screen"},
+	{"rodney", "Rodney's Funscreen"},
 	{0, 0}
 };
 
@@ -278,7 +278,7 @@
 	},
 
 	{
-		// Rodney's Fun Screen
+		// Rodney's Funscreen
 		{
 			"rodney",
 			"",

Modified: scummvm/trunk/engines/made/made.cpp
===================================================================
--- scummvm/trunk/engines/made/made.cpp	2008-06-18 03:31:13 UTC (rev 32730)
+++ scummvm/trunk/engines/made/made.cpp	2008-06-18 11:01:51 UTC (rev 32731)
@@ -148,27 +148,31 @@
 	return 0;
 }
 
+int16 MadeEngine::getTicks() {
+	return g_system->getMillis() * 30 / 1000;
+}
+
 int16 MadeEngine::getTimer(int16 timerNum) {
 	if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers) && _timers[timerNum - 1] != -1)
-		return (_system->getMillis() - _timers[timerNum - 1]) / kTimerResolution;
+		return (getTicks() - _timers[timerNum - 1]);
 	else
 		return 32000;
 }
 
 void MadeEngine::setTimer(int16 timerNum, int16 value) {
 	if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers))
-		_timers[timerNum - 1] = value * kTimerResolution;
+		_timers[timerNum - 1] = value;
 }
 
 void MadeEngine::resetTimer(int16 timerNum) {
 	if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers))
-		_timers[timerNum - 1] = _system->getMillis();
+		_timers[timerNum - 1] = getTicks();
 }
 
 int16 MadeEngine::allocTimer() {
 	for (int i = 0; i < ARRAYSIZE(_timers); i++) {
 		if (_timers[i] == -1) {
-			_timers[i] = _system->getMillis();
+			_timers[i] = getTicks();
 			return i + 1;
 		}
 	}
@@ -202,24 +206,20 @@
 			break;
 
 		case Common::EVENT_LBUTTONDOWN:
-			_eventNum = 1;
+			_eventNum = 2;
 			break;
 
-		/*
 		case Common::EVENT_LBUTTONUP:
-			_eventNum = 2; // TODO: Is this correct?
+			_eventNum = 1;
 			break;
-		*/
 
 		case Common::EVENT_RBUTTONDOWN:
-			_eventNum = 3;
+			_eventNum = 4;
 			break;
 
-		/*
 		case Common::EVENT_RBUTTONUP:
-			eventNum = 4; // TODO: Is this correct?
+			_eventNum = 3;
 			break;
-		*/
 
 		case Common::EVENT_KEYDOWN:
 			_eventKey = event.kbd.ascii;
@@ -239,7 +239,7 @@
 
 		}
 	}
-	
+
 	AudioCD.updateCD();
 
 }

Modified: scummvm/trunk/engines/made/made.h
===================================================================
--- scummvm/trunk/engines/made/made.h	2008-06-18 03:31:13 UTC (rev 32730)
+++ scummvm/trunk/engines/made/made.h	2008-06-18 11:01:51 UTC (rev 32731)
@@ -120,6 +120,7 @@
 	int _engineVersion;
 
 	int32 _timers[50];
+	int16 getTicks();
 	int16 getTimer(int16 timerNum);
 	void setTimer(int16 timerNum, int16 value);
 	void resetTimer(int16 timerNum);

Modified: scummvm/trunk/engines/made/scriptfuncs.cpp
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs.cpp	2008-06-18 03:31:13 UTC (rev 32730)
+++ scummvm/trunk/engines/made/scriptfuncs.cpp	2008-06-18 11:01:51 UTC (rev 32731)
@@ -106,7 +106,7 @@
 	External(sfStopSound);
 	External(sfPlayVoice);
 
-	if (_vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_RTZ) {
+	if (_vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_RTZ || _vm->getGameID() == GID_RODNEY) {
 		External(sfPlayCd);
 		External(sfStopCd);
 		External(sfGetCdStatus);
@@ -332,7 +332,7 @@
 	if (_vm->getGameID() == GID_RTZ) {
 		// Unused in RTZ
 		return 0;
-	} if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE) {
+	} if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_RODNEY) {
 		return _vm->_screen->addToSpriteList(argv[2], argv[1], argv[0]);
 	} else {
 		return 0;
@@ -341,7 +341,7 @@
 
 int16 ScriptFunctions::sfFreeAnim(int16 argc, int16 *argv) {
 	_vm->_screen->clearChannels();
-	if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE) {
+	if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_RODNEY) {
 		_vm->_screen->clearSpriteList();
 	}
 	return 0;
@@ -350,7 +350,7 @@
 int16 ScriptFunctions::sfDrawSprite(int16 argc, int16 *argv) {
 	if (_vm->getGameID() == GID_RTZ) {
 		return _vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
-	} if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE) {
+	} if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_RODNEY) {
 		SpriteListItem item = _vm->_screen->getFromSpriteList(argv[2]);
 		int16 channelIndex = _vm->_screen->drawSprite(item.index, argv[1] - item.xofs, argv[0] - item.yofs);
 		_vm->_screen->setChannelUseMask(channelIndex);
@@ -409,7 +409,7 @@
 
 	if (_vm->getGameID() == GID_RTZ) {
 		text = _vm->_dat->getObjectString(argv[argc - 1]);
-	} if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE) {
+	} if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_RODNEY) {
 		text = _vm->_dat->getString(argv[argc - 1]);
 	}
 


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