aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorDenis Kasak2009-06-27 15:17:26 +0000
committerDenis Kasak2009-06-27 15:17:26 +0000
commit97dde5e1eddcff4e038843a880343429b26a1fe9 (patch)
tree5ea92d6b3426e2253079ebbd444c8a073af4a577 /engines/draci
parent2e30fae261307b47885ade487a43d418bfe15fa5 (diff)
downloadscummvm-rg350-97dde5e1eddcff4e038843a880343429b26a1fe9.tar.gz
scummvm-rg350-97dde5e1eddcff4e038843a880343429b26a1fe9.tar.bz2
scummvm-rg350-97dde5e1eddcff4e038843a880343429b26a1fe9.zip
Put all GPL interpreter related routines inside a Script class.
svn-id: r41919
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/draci.cpp4
-rw-r--r--engines/draci/script.cpp8
-rw-r--r--engines/draci/script.h20
3 files changed, 21 insertions, 11 deletions
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index 3fc9553a8c..42023588ec 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -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 @@ int DraciEngine::init() {
}
// Disassemble GPL script for the first location
- gpldisasm(f->_data, f->_length);
+ //gpldisasm(f->_data, f->_length);
return Common::kNoError;
}
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index ee7b128529..05018b590d 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -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 @@ enum mathExpressionObject {
* @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 @@ void handleMathExpression(Common::MemoryReadStream &reader) {
* @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 @@ GPL2Command *findCommand(byte num, byte subnum) {
* value comes from.
*/
-int gpldisasm(byte *gplcode, uint16 len) {
+int Script::gpldisasm(byte *gplcode, uint16 len) {
Common::MemoryReadStream reader(gplcode, len);
while (!reader.eos()) {
diff --git a/engines/draci/script.h b/engines/draci/script.h
index c23de4ba33..11aded6330 100644
--- a/engines/draci/script.h
+++ b/engines/draci/script.h
@@ -23,10 +23,11 @@
*
*/
-#include "common/str.h"
+#ifndef DRACI_SCRIPT_H
+#define DRACI_SCRIPT_H
-#ifndef DRACI_GPLDISASM_H
-#define DRACI_GPLDISASM_H
+#include "common/str.h"
+#include "common/stream.h"
namespace Draci {
@@ -49,8 +50,17 @@ struct GPL2Command {
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