aboutsummaryrefslogtreecommitdiff
path: root/saga/script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'saga/script.cpp')
-rw-r--r--saga/script.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/saga/script.cpp b/saga/script.cpp
index 3cf41d77b0..8482bc6880 100644
--- a/saga/script.cpp
+++ b/saga/script.cpp
@@ -96,7 +96,7 @@ Script::Script() {
_scriptLUTMax = rsc_len / _scriptLUTEntryLen;
debug(0, "LUT has %d entries.", _scriptLUTMax);
-
+
// Allocate space for logical LUT
_scriptLUT = (SCRIPT_LUT_ENTRY *)malloc(_scriptLUTMax * sizeof(SCRIPT_LUT_ENTRY));
if (_scriptLUT == NULL) {
@@ -529,6 +529,19 @@ VOICE_LUT *Script::loadVoiceLUT(const byte *voicelut_p, size_t voicelut_len, SCR
return voice_lut;
}
+void Script::scriptError(SCRIPT_THREAD *thread, const char *format, ...) {
+ char buf[STRINGBUFLEN];
+ va_list argptr;
+
+ va_start(argptr, format);
+ vsprintf(buf, format, argptr);
+ va_end (argptr);
+
+ thread->flags |= kTFlagAborted;
+ debug(0, "Script::scriptError %X: %s", thread->i_offset, buf);
+ _vm->_console->DebugPrintf("Script::scriptError %X: %s", thread->i_offset, buf);
+}
+
void Script::scriptInfo() {
uint32 n_entrypoints;
uint32 i;