[Scummvm-cvs-logs] SF.net SVN: scummvm:[43308] scummvm/branches/gsoc2009-draci/engines/draci

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Wed Aug 12 07:20:26 CEST 2009


Revision: 43308
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43308&view=rev
Author:   dkasak13
Date:     2009-08-12 05:20:25 +0000 (Wed, 12 Aug 2009)

Log Message:
-----------
* When setting the first two game variables (room and gate), first convert them back to 1-based indexing so they play well with the rest of the scripts. This fixes a number of bugs, e.g. the dragon now appears automatically when the game starts and the question mark animation in the intro is played / stopped at an appropriate time.
* Removed hack from Script::start() which loaded animation 657 before playing it to stop a crash. The fix above seems to fix this bug as well.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/game.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/script.cpp

Modified: scummvm/branches/gsoc2009-draci/engines/draci/game.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/game.cpp	2009-08-12 04:36:01 UTC (rev 43307)
+++ scummvm/branches/gsoc2009-draci/engines/draci/game.cpp	2009-08-12 05:20:25 UTC (rev 43308)
@@ -168,8 +168,10 @@
 		if (_newRoom != _currentRoom._roomNum) {
 
 			// Set the first two variables to the new room / gate
-			_variables[0] = _newGate;
-			_variables[1] = _newRoom;
+			// Before setting these variables we have to convert the values to 
+			// 1-based indexing because this is how everything is stored in the data files
+			_variables[0] = _newGate + 1;
+			_variables[1] = _newRoom + 1;
 
 			// If the new room is the map room, set the appropriate coordinates
 			// for the dragon in the persons array
@@ -263,8 +265,10 @@
 	_newRoom = _currentRoom._roomNum;
 	_newGate = _currentGate;
 
-	_variables[0] = _currentGate;
-	_variables[1] = _currentRoom._roomNum;
+	// Before setting these variables we have to convert the values to 1-based indexing
+	// because this is how everything is stored in the data files
+	_variables[0] = _currentGate + 1;
+	_variables[1] = _currentRoom._roomNum + 1;
 
 	changeRoom(_currentRoom._roomNum);
 	runGateProgram(_currentGate);

Modified: scummvm/branches/gsoc2009-draci/engines/draci/script.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/script.cpp	2009-08-12 04:36:01 UTC (rev 43307)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.cpp	2009-08-12 05:20:25 UTC (rev 43308)
@@ -394,21 +394,9 @@
 		return;
 	}
 
-	int objID = params.pop();
-	int animID = params.pop();	
+	int objID = params.pop() - 1;
+	int animID = params.pop() - 1;	
 
-	// Fixes bug in the data files which makes the game crash in the intro
-	// TODO: This is possibly exclusive to the English version, so check for that
-	if (animID == 657) {
-		Common::Queue<int> tmp;
-		tmp.push(objID);
-		tmp.push(animID);
-		this->load(tmp);
-	}
-
-	objID -= 1;
-	animID -= 1;
-
 	GameObject *obj = _vm->_game->getObject(objID);
 
 	// Stop all animation that the object owns
@@ -780,12 +768,12 @@
 			break;
 
 		case kMathVariable:
-			value = reader.readSint16LE();
+			value = reader.readSint16LE() - 1;
 
-			stk.push(_vm->_game->getVariable(value-1));
+			stk.push(_vm->_game->getVariable(value));
 
 			debugC(3, kDraciBytecodeDebugLevel, "\t\tvariable: %d (%d)", value,
-				_vm->_game->getVariable(value-1));
+				_vm->_game->getVariable(value));
 			break;
 
 		case kMathFunctionCall:


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