TWINE: replaced magic numbers

This commit is contained in:
Martin Gerhardy 2020-10-25 22:04:33 +01:00
parent 05bc119526
commit 7f8c588af9
3 changed files with 8 additions and 8 deletions

View File

@ -97,8 +97,8 @@ void MenuOptions::showCredits() {
int32 tmpShadowMode = _engine->cfgfile.ShadowMode;
_engine->cfgfile.ShadowMode = 0;
_engine->_gameState->initEngineVars();
_engine->_scene->currentSceneIdx = 119;
_engine->_scene->needChangeScene = 119;
_engine->_scene->currentSceneIdx = LBA1SceneId::Credits_List_Sequence;
_engine->_scene->needChangeScene = LBA1SceneId::Credits_List_Sequence;
_engine->gameEngineLoop();

View File

@ -183,7 +183,7 @@ void Scene::loadScene() {
}
sceneActors[i].body = *(localScene++);
sceneActors[i].anim = (AnimationTypes)*(localScene++);
sceneActors[i].anim = (AnimationTypes) * (localScene++);
sceneActors[i].sprite = *((uint16 *)localScene);
localScene += 2;
sceneActors[i].x = *((uint16 *)localScene);
@ -307,8 +307,8 @@ void Scene::changeScene() {
int32 a;
// change twinsen house destroyed hard-coded
if (needChangeScene == 4 && _engine->_gameState->gameFlags[30] != 0) {
needChangeScene = 118;
if (needChangeScene == LBA1SceneId::Citadel_Island_near_twinsens_house && _engine->_gameState->gameFlags[30] != 0) {
needChangeScene = LBA1SceneId::Citadel_Island_Twinsens_house_destroyed;
}
// local backup previous scene
@ -330,7 +330,7 @@ void Scene::changeScene() {
// TODO: treat holomap trajectories
if (needChangeScene == 116 || needChangeScene == 117) {
if (needChangeScene == LBA1SceneId::Citadel_Island_end_sequence_1 || needChangeScene == LBA1SceneId::Citadel_Island_end_sequence_2) {
_engine->_text->currentTextBank = 10;
}
@ -394,7 +394,7 @@ void Scene::changeScene() {
}
}
ActorStruct* Scene::getActor(int32 actorIdx) {
ActorStruct *Scene::getActor(int32 actorIdx) {
assert(actorIdx >= 0);
assert(actorIdx < NUM_MAX_ACTORS);
return &sceneActors[actorIdx];

View File

@ -246,7 +246,7 @@ public:
uint8 *currentScene = nullptr;
int32 needChangeScene = 0;
int32 needChangeScene = LBA1SceneId::Citadel_Island_Prison;
int32 currentSceneIdx = 0;
int32 previousSceneIdx = 0;