mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-12 22:51:11 +00:00
PRINCE: Background interpreter during dialog boxes
This commit is contained in:
parent
54a78d6341
commit
51bc133c43
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,8 @@ public:
|
||||
|
||||
void stopBg() { _bgOpcodePC = 0; }
|
||||
|
||||
void step();
|
||||
void stepBg();
|
||||
void stepFg();
|
||||
void storeNewPC(int opcodePC);
|
||||
int getLastOPCode();
|
||||
int getFgOpcodePC();
|
||||
|
Loading…
x
Reference in New Issue
Block a user