mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 01:38:36 +00:00
DIRECTOR: Check output of thawLingoPlayState
This commit is contained in:
parent
fb77e59dd5
commit
eb86d2794c
@ -135,17 +135,18 @@ bool Score::processFrozenScripts(bool recursion, int count) {
|
||||
// Unfreeze the play script if the special flag is set
|
||||
if (g_lingo->_playDone) {
|
||||
g_lingo->_playDone = false;
|
||||
_window->thawLingoPlayState();
|
||||
Symbol currentScript = _window->getLingoState()->callstack.front()->sp;
|
||||
g_lingo->switchStateFromWindow();
|
||||
bool completed = g_lingo->execute();
|
||||
if (!completed) {
|
||||
debugC(3, kDebugLingoExec, "Score::processFrozenScripts(): State froze again mid-thaw, interrupting");
|
||||
return false;
|
||||
} else if (currentScript == g_lingo->_currentInputEvent) {
|
||||
// script that just completed was the current input event, clear the flag
|
||||
debugC(3, kDebugEvents, "Score::processFrozenScripts(): Input event completed");
|
||||
g_lingo->_currentInputEvent = Symbol();
|
||||
if (_window->thawLingoPlayState()) {
|
||||
Symbol currentScript = _window->getLingoState()->callstack.front()->sp;
|
||||
g_lingo->switchStateFromWindow();
|
||||
bool completed = g_lingo->execute();
|
||||
if (!completed) {
|
||||
debugC(3, kDebugLingoExec, "Score::processFrozenScripts(): State froze again mid-thaw, interrupting");
|
||||
return false;
|
||||
} else if (currentScript == g_lingo->_currentInputEvent) {
|
||||
// script that just completed was the current input event, clear the flag
|
||||
debugC(3, kDebugEvents, "Score::processFrozenScripts(): Input event completed");
|
||||
g_lingo->_currentInputEvent = Symbol();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -649,19 +649,20 @@ void Window::freezeLingoPlayState() {
|
||||
debugC(kDebugLingoExec, 3, "Freezing Lingo play state");
|
||||
}
|
||||
|
||||
void Window::thawLingoPlayState() {
|
||||
bool Window::thawLingoPlayState() {
|
||||
if (!_lingoPlayState) {
|
||||
warning("Tried to thaw when there's no frozen play state, ignoring");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (!_lingoState->callstack.empty()) {
|
||||
warning("Can't thaw a Lingo state in mid-execution, ignoring");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
delete _lingoState;
|
||||
debugC(kDebugLingoExec, 3, "Thawing Lingo play state");
|
||||
_lingoState = _lingoPlayState;
|
||||
_lingoPlayState = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -164,7 +164,7 @@ public:
|
||||
void freezeLingoState();
|
||||
void thawLingoState();
|
||||
void freezeLingoPlayState();
|
||||
void thawLingoPlayState();
|
||||
bool thawLingoPlayState();
|
||||
LingoState *getLastFrozenLingoState() { return _frozenLingoStates.empty() ? nullptr : _frozenLingoStates[_frozenLingoStates.size() - 1]; }
|
||||
|
||||
// events.cpp
|
||||
|
Loading…
x
Reference in New Issue
Block a user