[Scummvm-cvs-logs] SF.net SVN: scummvm:[41919] scummvm/branches/gsoc2009-draci/engines/draci
dkasak13 at users.sourceforge.net
dkasak13 at users.sourceforge.net
Sat Jun 27 17:17:26 CEST 2009
Revision: 41919
http://scummvm.svn.sourceforge.net/scummvm/?rev=41919&view=rev
Author: dkasak13
Date: 2009-06-27 15:17:26 +0000 (Sat, 27 Jun 2009)
Log Message:
-----------
Put all GPL interpreter related routines inside a Script class.
Modified Paths:
--------------
scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp
scummvm/branches/gsoc2009-draci/engines/draci/script.cpp
scummvm/branches/gsoc2009-draci/engines/draci/script.h
Modified: scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp 2009-06-27 15:00:14 UTC (rev 41918)
+++ scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp 2009-06-27 15:17:26 UTC (rev 41919)
@@ -34,7 +34,7 @@
#include "draci/draci.h"
#include "draci/barchive.h"
-#include "draci/gpldisasm.h"
+#include "draci/script.h"
#include "draci/font.h"
#include "draci/sprite.h"
#include "draci/screen.h"
@@ -108,7 +108,7 @@
}
// Disassemble GPL script for the first location
- gpldisasm(f->_data, f->_length);
+ //gpldisasm(f->_data, f->_length);
return Common::kNoError;
}
Modified: scummvm/branches/gsoc2009-draci/engines/draci/script.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/script.cpp 2009-06-27 15:00:14 UTC (rev 41918)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.cpp 2009-06-27 15:17:26 UTC (rev 41919)
@@ -27,7 +27,7 @@
#include "common/stream.h"
#include "common/stack.h"
-#include "draci/gpldisasm.h"
+#include "draci/script.h"
#include "draci/draci.h"
namespace Draci {
@@ -150,7 +150,7 @@
* @param reader Stream reader set to the beginning of the expression
*/
-void handleMathExpression(Common::MemoryReadStream &reader) {
+void Script::handleMathExpression(Common::MemoryReadStream &reader) {
Common::Stack<uint16> stk;
mathExpressionObject obj;
@@ -223,7 +223,7 @@
* @return NULL if command is not found. Otherwise, a pointer to a GPL2Command
* struct representing the command.
*/
-GPL2Command *findCommand(byte num, byte subnum) {
+GPL2Command *Script::findCommand(byte num, byte subnum) {
unsigned int i = 0;
while (1) {
@@ -275,7 +275,7 @@
* value comes from.
*/
-int gpldisasm(byte *gplcode, uint16 len) {
+int Script::gpldisasm(byte *gplcode, uint16 len) {
Common::MemoryReadStream reader(gplcode, len);
while (!reader.eos()) {
Modified: scummvm/branches/gsoc2009-draci/engines/draci/script.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/script.h 2009-06-27 15:00:14 UTC (rev 41918)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.h 2009-06-27 15:17:26 UTC (rev 41919)
@@ -23,11 +23,12 @@
*
*/
+#ifndef DRACI_SCRIPT_H
+#define DRACI_SCRIPT_H
+
#include "common/str.h"
+#include "common/stream.h"
-#ifndef DRACI_GPLDISASM_H
-#define DRACI_GPLDISASM_H
-
namespace Draci {
/** The maximum number of parameters for a GPL command */
@@ -49,8 +50,17 @@
int _paramTypes[kMaxParams];
};
-int gpldisasm(byte *gplcode, uint16 len);
+class Script {
+public:
+ int gpldisasm(byte *gplcode, uint16 len);
+
+private:
+ GPL2Command *findCommand(byte num, byte subnum);
+ void handleMathExpression(Common::MemoryReadStream &reader);
+
+};
+
}
-#endif // DRACI_GPLDISASM_H
+#endif // DRACI_SCRIPT_H
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