diff options
-rw-r--r-- | saga/scene.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/saga/scene.cpp b/saga/scene.cpp index d7246e0473..658d05a7f5 100644 --- a/saga/scene.cpp +++ b/saga/scene.cpp @@ -947,6 +947,7 @@ int Scene::defaultScene(int param, R_SCENE_INFO *scene_info) { _vm->_anim->setFlag(0, ANIM_LOOP); _vm->_anim->play(0, 0); + // Start scene scripts if (_desc.startScriptNum > 0) { R_SCRIPT_THREAD *_startScriptThread; @@ -961,6 +962,23 @@ int Scene::defaultScene(int param, R_SCENE_INFO *scene_info) { _vm->_script->SThreadCompleteThread(); } + if (_desc.sceneScriptNum > 0) { + R_SCRIPT_THREAD *_sceneScriptThread; + + debug(0, "Starting scene script #%d", _desc.sceneScriptNum); + + _sceneScriptThread = _vm->_script->SThreadCreate(); + if (_sceneScriptThread == NULL) { + _vm->_console->print("Thread creation failed."); + break; + } + + // TODO: Set up thread variables. First we'll need to + // add the concept of thread variables... + + _vm->_script->SThreadExecute(_sceneScriptThread, _desc.sceneScriptNum); + } + debug(0, "Scene started"); break; case SCENE_END: |