aboutsummaryrefslogtreecommitdiff
path: root/saga/script.h
diff options
context:
space:
mode:
Diffstat (limited to 'saga/script.h')
-rw-r--r--saga/script.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/saga/script.h b/saga/script.h
index ae9132c8eb..71a2634e8f 100644
--- a/saga/script.h
+++ b/saga/script.h
@@ -216,8 +216,12 @@ struct VoiceLUT {
uint16 voicesCount;
uint16 *voices;
void freeMem() {
+ voicesCount = 0;
free(voices);
}
+ VoiceLUT() {
+ memset(this, 0, sizeof(*this));
+ }
};
struct ModuleData {
@@ -356,8 +360,6 @@ public:
void loadModule(int scriptModuleNumber);
void freeModules();
- bool isVoiceLUTPresent() const { return _voiceLUTPresent; }
-
void doVerb();
void showVerb(int statusColor = -1);
void setVerb(int verb);
@@ -384,7 +386,6 @@ public:
private:
SagaEngine *_vm;
- bool _voiceLUTPresent;
ResourceContext *_scriptContext;
uint16 _modulesLUTEntryLen;
@@ -422,6 +423,8 @@ public:
bool _skipSpeeches;
bool _abortEnabled;
+ VoiceLUT _globalVoiceLUT;
+
public:
ScriptThread *createThread(uint16 scriptModuleNumber, uint16 scriptEntryPointNumber);
int executeThread(ScriptThread *thread, int entrypointNumber);
@@ -433,9 +436,10 @@ public:
void wakeUpThreads(int waitType);
void wakeUpThreadsDelayed(int waitType, int sleepTime);
+ void loadVoiceLUT(VoiceLUT &voiceLUT, const byte *resourcePointer, size_t resourceLength);
+
private:
void loadModuleBase(ModuleData &module, const byte *resourcePointer, size_t resourceLength);
- void loadModuleVoiceLUT(ModuleData &module, const byte *resourcePointer, size_t resourceLength);
// runThread returns true if we should break running of other threads
bool runThread(ScriptThread *thread, uint instructionLimit);