mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 09:49:14 +00:00
TWINE: replaced magic numbers with enum constants
This commit is contained in:
parent
c5943bfb40
commit
39ca392a45
@ -116,7 +116,7 @@ void GameState::initEngineVars() {
|
||||
|
||||
_engine->_scene->_currentSceneIdx = SCENE_CEILING_GRID_FADE_1;
|
||||
_engine->_scene->_needChangeScene = LBA1SceneId::Citadel_Island_Prison;
|
||||
_engine->_quitSceneLoop = -1;
|
||||
_engine->_sceneLoopState = SceneLoopState::Continue;
|
||||
_engine->_scene->_mecaPenguinIdx = -1;
|
||||
_engine->_menuOptions->canShowCredits = false;
|
||||
|
||||
|
@ -1631,7 +1631,7 @@ static int32 lGAME_OVER(TwinEEngine *engine, LifeScriptContext &ctx) {
|
||||
* @note Opcode @c 0x62
|
||||
*/
|
||||
static int32 lTHE_END(TwinEEngine *engine, LifeScriptContext &ctx) {
|
||||
engine->_quitSceneLoop = 1;
|
||||
engine->_sceneLoopState = SceneLoopState::Finished;
|
||||
engine->_gameState->setLeafs(0);
|
||||
engine->_scene->_sceneHero->setLife(kActorMaxLife);
|
||||
engine->_gameState->setMagicPoints(80);
|
||||
@ -1739,7 +1739,7 @@ static int32 lCLEAR_TEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
|
||||
* @note Opcode @c 0x69
|
||||
*/
|
||||
static int32 lBRUTAL_EXIT(TwinEEngine *engine, LifeScriptContext &ctx) {
|
||||
engine->_quitSceneLoop = 0;
|
||||
engine->_sceneLoopState = SceneLoopState::ReturnToMenu;
|
||||
return 1; // break
|
||||
}
|
||||
|
||||
|
@ -770,7 +770,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
|
||||
}
|
||||
if (giveUp == 1) {
|
||||
_redraw->redrawEngineActions(true);
|
||||
_quitSceneLoop = 0;
|
||||
_sceneLoopState = SceneLoopState::ReturnToMenu;
|
||||
return false;
|
||||
}
|
||||
_redraw->redrawEngineActions(true);
|
||||
@ -931,8 +931,8 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
|
||||
|
||||
processActorSamplePosition(a);
|
||||
|
||||
if (_quitSceneLoop != -1) {
|
||||
return _quitSceneLoop == 1;
|
||||
if (_sceneLoopState != SceneLoopState::Continue) {
|
||||
return _sceneLoopState == SceneLoopState::Finished;
|
||||
}
|
||||
|
||||
if (actor->_staticFlags.bCanDrown) {
|
||||
@ -1000,7 +1000,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
|
||||
|
||||
autoSave();
|
||||
_gameState->processGameoverAnimation();
|
||||
_quitSceneLoop = 0;
|
||||
_sceneLoopState = SceneLoopState::ReturnToMenu;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1039,7 +1039,7 @@ bool TwinEEngine::gameEngineLoop() {
|
||||
_screens->_fadePalette = true;
|
||||
_movements->setActorAngle(ANGLE_0, -ANGLE_90, ANGLE_1, &_loopMovePtr);
|
||||
|
||||
while (_quitSceneLoop == -1) {
|
||||
while (_sceneLoopState == SceneLoopState::Continue) {
|
||||
if (runGameEngine()) {
|
||||
return true;
|
||||
}
|
||||
|
@ -151,6 +151,12 @@ enum class EngineState {
|
||||
QuitGame
|
||||
};
|
||||
|
||||
enum class SceneLoopState {
|
||||
Continue = -1,
|
||||
ReturnToMenu = 0,
|
||||
Finished = 1
|
||||
};
|
||||
|
||||
struct ScopedEngineFreeze {
|
||||
TwinEEngine *_engine;
|
||||
ScopedEngineFreeze(TwinEEngine *engine);
|
||||
@ -281,7 +287,7 @@ public:
|
||||
ConfigFile _cfgfile;
|
||||
|
||||
int32 _frameCounter = 0;
|
||||
int32 _quitSceneLoop = 0;
|
||||
SceneLoopState _sceneLoopState = SceneLoopState::ReturnToMenu;
|
||||
int32 _lbaTime = 0;
|
||||
|
||||
int32 _loopInventoryItem = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user