void AgiEngine::interpretCycle() { ScreenObjEntry *screenObjEgo = &_game.screenObjTable[SCREENOBJECTS_EGO_ENTRY]; bool oldSound; byte oldScore; if (!_game.playerControl) setVar(VM_VAR_EGO_DIRECTION, screenObjEgo->direction); else screenObjEgo->direction = getVar(VM_VAR_EGO_DIRECTION); checkAllMotions(); oldScore = getVar(VM_VAR_SCORE); oldSound = getFlag(VM_FLAG_SOUND_ON); // Reset script heuristic here resetGetVarSecondsHeuristic(); _game.exitAllLogics = false; while (runLogic(0) == 0 && !(shouldQuit() || _restartGame)) { setVar(VM_VAR_WORD_NOT_FOUND, 0); setVar(VM_VAR_BORDER_TOUCH_OBJECT, 0); setVar(VM_VAR_BORDER_CODE, 0); oldScore = getVar(VM_VAR_SCORE); setFlag(VM_FLAG_ENTERED_CLI, false); _game.exitAllLogics = false; artificialDelay_CycleDone(); resetControllers(); } artificialDelay_CycleDone(); resetControllers(); screenObjEgo->direction = getVar(VM_VAR_EGO_DIRECTION); if (getVar(VM_VAR_SCORE) != oldScore || getFlag(VM_FLAG_SOUND_ON) != oldSound) _game._vm->_text->statusDraw(); setVar(VM_VAR_BORDER_TOUCH_OBJECT, 0); setVar(VM_VAR_BORDER_CODE, 0); setFlag(VM_FLAG_NEW_ROOM_EXEC, false); setFlag(VM_FLAG_RESTART_GAME, false); setFlag(VM_FLAG_RESTORE_JUST_RAN, false); if (_game.gfxMode) { updateScreenObjTable(); } _gfx->updateScreen(); //_gfx->doUpdate(); }
void AgiEngine::interpretCycle() { int oldSound, oldScore; if (_game.playerControl) _game.vars[vEgoDir] = _game.viewTable[0].direction; else _game.viewTable[0].direction = _game.vars[vEgoDir]; checkAllMotions(); oldScore = _game.vars[vScore]; oldSound = getflag(fSoundOn); _game.exitAllLogics = false; while (runLogic(0) == 0 && !(shouldQuit() || _restartGame)) { _game.vars[vWordNotFound] = 0; _game.vars[vBorderTouchObj] = 0; _game.vars[vBorderCode] = 0; oldScore = _game.vars[vScore]; setflag(fEnteredCli, false); _game.exitAllLogics = false; resetControllers(); } resetControllers(); _game.viewTable[0].direction = _game.vars[vEgoDir]; if (_game.vars[vScore] != oldScore || getflag(fSoundOn) != oldSound) writeStatus(); _game.vars[vBorderTouchObj] = 0; _game.vars[vBorderCode] = 0; setflag(fNewRoomExec, false); setflag(fRestartGame, false); setflag(fRestoreJustRan, false); if (_game.gfxMode) { updateViewtable(); _gfx->doUpdate(); } }