aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorlukaslw2014-08-02 16:03:54 +0200
committerlukaslw2014-08-02 16:03:54 +0200
commit51bc133c43227d3bf5a9fb167afcc13c911ec20e (patch)
tree7822612f9c33a9e20f35c61c429f06f0edbdd068 /engines
parent54a78d6341ddc8af6a9e80f574b65b016fe75ebb (diff)
downloadscummvm-rg350-51bc133c43227d3bf5a9fb167afcc13c911ec20e.tar.gz
scummvm-rg350-51bc133c43227d3bf5a9fb167afcc13c911ec20e.tar.bz2
scummvm-rg350-51bc133c43227d3bf5a9fb167afcc13c911ec20e.zip
PRINCE: Background interpreter during dialog boxes
Diffstat (limited to 'engines')
-rw-r--r--engines/prince/prince.cpp5
-rw-r--r--engines/prince/script.cpp7
-rw-r--r--engines/prince/script.h3
3 files changed, 11 insertions, 4 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 33750d50c7..9f01796270 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -2664,8 +2664,8 @@ void PrinceEngine::runDialog() {
while (!shouldQuit()) {
+ _interpreter->stepBg();
drawScreen();
- // TODO - background iterpreter?
int dialogX = (640 - _dialogWidth) / 2;
int dialogY = 460 - _dialogHeight;
@@ -4431,7 +4431,8 @@ void PrinceEngine::mainLoop() {
return;
}
- _interpreter->step();
+ _interpreter->stepBg();
+ _interpreter->stepFg();
drawScreen();
diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp
index 9b49b749a4..e0fdff1e31 100644
--- a/engines/prince/script.cpp
+++ b/engines/prince/script.cpp
@@ -429,11 +429,14 @@ void Interpreter::debugInterpreter(const char *s, ...) {
//debug("Prince::Script mode %s %s %s", _mode, str.c_str(), buf);
}
-void Interpreter::step() {
+void Interpreter::stepBg() {
if (_bgOpcodePC) {
_mode = "bg";
_bgOpcodePC = step(_bgOpcodePC);
}
+}
+
+void Interpreter::stepFg() {
if (_fgOpcodePC) {
_mode = "fg";
_fgOpcodePC = step(_fgOpcodePC);
@@ -1530,6 +1533,7 @@ void Interpreter::O_DISABLEDIALOGOPT() {
void Interpreter::O_SHOWDIALOGBOX() {
uint16 box = readScriptFlagValue();
+ uint32 currInstr = _currentInstruction;
_vm->createDialogBox(box);
_flags->setFlagValue(Flags::DIALINES, _vm->_dialogLines);
if (_vm->_dialogLines) {
@@ -1537,6 +1541,7 @@ void Interpreter::O_SHOWDIALOGBOX() {
_vm->runDialog();
_vm->changeCursor(0);
}
+ _currentInstruction = currInstr;
debugInterpreter("O_SHOWDIALOGBOX box %d", box);
}
diff --git a/engines/prince/script.h b/engines/prince/script.h
index f033128e97..9c397b0d1f 100644
--- a/engines/prince/script.h
+++ b/engines/prince/script.h
@@ -189,7 +189,8 @@ public:
void stopBg() { _bgOpcodePC = 0; }
- void step();
+ void stepBg();
+ void stepFg();
void storeNewPC(int opcodePC);
int getLastOPCode();
int getFgOpcodePC();