aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2016-06-17 08:06:47 +0200
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commitf58de432c5d7ab1e465fccfe9a449fe955a7865b (patch)
tree5a17436d4de7f0b7a1d447cd591e5f95b9a0a3c6 /engines
parent23c79a2786aad39251768bd644779607a04682ca (diff)
downloadscummvm-rg350-f58de432c5d7ab1e465fccfe9a449fe955a7865b.tar.gz
scummvm-rg350-f58de432c5d7ab1e465fccfe9a449fe955a7865b.tar.bz2
scummvm-rg350-f58de432c5d7ab1e465fccfe9a449fe955a7865b.zip
DIRECTOR: Lingo: Fix script compilation
Diffstat (limited to 'engines')
-rw-r--r--engines/director/lingo/lingo.cpp10
-rw-r--r--engines/director/lingo/lingo.h7
2 files changed, 10 insertions, 7 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index d7bd1dca87..ddb1cb11f3 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -73,21 +73,21 @@ Lingo::Lingo(DirectorEngine *vm) : _vm(vm) {
_eventHandlerTypes[t->handler] = t->name;
_currentScript = 0;
+
+ warning("Lingo Inited");
}
Lingo::~Lingo() {
}
void Lingo::addCode(Common::String code, ScriptType type, uint16 id) {
- debug(0, "Add code %s for type %d with id %d", code.c_str(), type, id);
+ debug(0, "Add code \"%s\" for type %d with id %d", code.c_str(), type, id);
- //FIXME
- return;
if (_scripts[type].contains(id)) {
- free(_scripts[type][id]);
+ delete _scripts[type][id];
}
- _currentScript = new Common::Array<inst>();
+ _currentScript = new ScriptData;
_scripts[type][id] = _currentScript;
parse(code.c_str());
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index c819779a31..2e5c7b47eb 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -73,6 +73,9 @@ enum LEvent {
typedef void (*inst)(void);
#define STOP (inst)0
+typedef Common::Array<inst> ScriptData;
+typedef Common::HashMap<int32, ScriptData *> ScriptHash;
+
class Lingo {
public:
Lingo(DirectorEngine *vm);
@@ -101,8 +104,8 @@ private:
Common::HashMap<uint32, const char *> _eventHandlerTypes;
Common::HashMap<Common::String, Audio::AudioStream *> _audioAliases;
- Common::HashMap<int32, Common::Array<inst> *> _scripts[kMaxScriptType];
- Common::Array<inst> *_currentScript;
+ ScriptHash _scripts[kMaxScriptType + 1];
+ ScriptData *_currentScript;
DirectorEngine *_vm;
};