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

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Tue Jul 7 22:57:14 CEST 2009


Revision: 42242
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42242&view=rev
Author:   dkasak13
Date:     2009-07-07 20:57:14 +0000 (Tue, 07 Jul 2009)

Log Message:
-----------
* Changed Game::_variables to public since the GPL interpreter needs to use it and made it int instead of uint16
* Implemented variable accessing by the math evaluator
* Fixed bug from previous commit (should have used && when checking for ending instructions, not ||)

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/game.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/game.h
    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-07-07 20:46:26 UTC (rev 42241)
+++ scummvm/branches/gsoc2009-draci/engines/draci/game.cpp	2009-07-07 20:57:14 UTC (rev 42242)
@@ -96,7 +96,7 @@
 	file = initArchive.getFile(2);
 	unsigned int numVariables = file->_length / sizeof (int16);
 
-	_variables = new int16[numVariables];
+	_variables = new int[numVariables];
 	Common::MemoryReadStream variableData(file->_data, file->_length);
 	
 	for (i = 0; i < numVariables; ++i) {

Modified: scummvm/branches/gsoc2009-draci/engines/draci/game.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/game.h	2009-07-07 20:46:26 UTC (rev 42241)
+++ scummvm/branches/gsoc2009-draci/engines/draci/game.h	2009-07-07 20:57:14 UTC (rev 42242)
@@ -131,13 +131,14 @@
 
 	GameObject *getObject(uint objNum);
 
+	int *_variables;
+
 private:
 	DraciEngine *_vm;
 	
 	GameInfo *_info;
 	Person *_persons;
 	uint16 *_dialogOffsets;
-	int16 *_variables;
 	byte *_itemStatus;
 	GameObject *_objects;
 	Room _currentRoom;	

Modified: scummvm/branches/gsoc2009-draci/engines/draci/script.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/script.cpp	2009-07-07 20:46:26 UTC (rev 42241)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.cpp	2009-07-07 20:57:14 UTC (rev 42242)
@@ -297,8 +297,11 @@
 
 		case kMathVariable:
 			value = reader.readUint16LE();
-			stk.push(value);
-			debugC(3, kDraciBytecodeDebugLevel, "\t\tvariable: %d", value);
+
+			stk.push(_vm->_game->_variables[value-1]);
+
+			debugC(3, kDraciBytecodeDebugLevel, "\t\tvariable: %d (%d)", value,
+				_vm->_game->_variables[value-1]);
 			break;
 
 		case kMathFunctionCall:
@@ -458,7 +461,7 @@
 			(this->*(cmd->_handler))(params);
 		}
 
-	} while (cmd->_name != "gplend" || cmd->_name != "exit");
+	} while (cmd->_name != "gplend" && cmd->_name != "exit");
 
 	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