mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-06 02:10:28 +00:00
TRECISION: Merge duplicate code
This commit is contained in:
parent
a80de16ee5
commit
b7d47aa369
@ -57,6 +57,19 @@ void TrecisionEngine::playScript(uint16 id) {
|
||||
_graphicsMgr->hideCursor();
|
||||
_curScriptFrame[_curStack] = _script[id]._firstFrame;
|
||||
|
||||
processScriptFrame();
|
||||
}
|
||||
|
||||
void TrecisionEngine::evalScript() {
|
||||
if (_characterQueue.testEmptyCharacterQueue4Script() && _gameQueue.testEmptyQueue(MC_DIALOG)) {
|
||||
_curScriptFrame[_curStack]++;
|
||||
_graphicsMgr->hideCursor();
|
||||
|
||||
processScriptFrame();
|
||||
}
|
||||
}
|
||||
|
||||
void TrecisionEngine::processScriptFrame() {
|
||||
SScriptFrame *curFrame = &_scriptFrame[_curScriptFrame[_curStack]];
|
||||
// If the event is empty, terminate the script
|
||||
if (curFrame->isEmptyEvent()) {
|
||||
@ -77,31 +90,6 @@ void TrecisionEngine::playScript(uint16 id) {
|
||||
}
|
||||
}
|
||||
|
||||
void TrecisionEngine::evalScript() {
|
||||
if (_characterQueue.testEmptyCharacterQueue4Script() && _gameQueue.testEmptyQueue(MC_DIALOG)) {
|
||||
_curScriptFrame[_curStack]++;
|
||||
_graphicsMgr->hideCursor();
|
||||
|
||||
SScriptFrame *curFrame = &_scriptFrame[_curScriptFrame[_curStack]];
|
||||
if (curFrame->isEmptyEvent()) {
|
||||
endScript();
|
||||
return;
|
||||
}
|
||||
|
||||
bool loop = true;
|
||||
while (loop) {
|
||||
loop = false;
|
||||
curFrame = &_scriptFrame[_curScriptFrame[_curStack]];
|
||||
SScriptFrame *nextFrame = &_scriptFrame[_curScriptFrame[_curStack] + 1];
|
||||
curFrame->sendFrame(_scheduler);
|
||||
if (curFrame->_noWait && !nextFrame->isEmptyEvent()) {
|
||||
_curScriptFrame[_curStack]++;
|
||||
loop = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TrecisionEngine::quitPrompt() {
|
||||
_graphicsMgr->clearScreenBufferTop();
|
||||
|
||||
|
@ -98,6 +98,7 @@ class TrecisionEngine : public Engine {
|
||||
// Script
|
||||
void endScript();
|
||||
void evalScript();
|
||||
void processScriptFrame();
|
||||
void doAction();
|
||||
void doMouse();
|
||||
void doCharacter();
|
||||
|
Loading…
x
Reference in New Issue
Block a user