Skip to content

Commit

Permalink
tr1/game-flow: merge GFS_STOP_GAME to GFS_LOOP_GAME
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Jan 23, 2025
1 parent e8a8fdf commit 0a9bc1d
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 43 deletions.
16 changes: 0 additions & 16 deletions data/tr1/ship/cfg/TR1X_gameflow.json5
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
{"type": "loading_screen", "picture_path": "data/images/gym.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 0},
{"type": "exit_to_title"},
],
Expand All @@ -67,7 +66,6 @@
{"type": "loading_screen", "picture_path": "data/images/peru.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 1},
{"type": "exit_to_level", "level_id": 2},
],
Expand All @@ -86,7 +84,6 @@
{"type": "loading_screen", "picture_path": "data/images/peru.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 2},
{"type": "exit_to_level", "level_id": 3},
],
Expand All @@ -108,7 +105,6 @@
{"type": "loading_screen", "picture_path": "data/images/peru.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 3},
{"type": "exit_to_level", "level_id": 4},
],
Expand All @@ -130,7 +126,6 @@
{"type": "loading_screen", "picture_path": "data/images/peru.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "exit_to_cine", "level_id": 16},
],
},
Expand All @@ -150,7 +145,6 @@
{"type": "loading_screen", "picture_path": "data/images/greece.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 5},
{"type": "exit_to_level", "level_id": 6},
],
Expand All @@ -172,7 +166,6 @@
{"type": "loading_screen", "picture_path": "data/images/greece.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 6},
{"type": "exit_to_level", "level_id": 7},
],
Expand All @@ -191,7 +184,6 @@
{"type": "loading_screen", "picture_path": "data/images/greece.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 7},
{"type": "exit_to_level", "level_id": 8},
],
Expand All @@ -213,7 +205,6 @@
{"type": "loading_screen", "picture_path": "data/images/greece.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 8},
{"type": "exit_to_level", "level_id": 9},
],
Expand All @@ -237,7 +228,6 @@
{"type": "loading_screen", "picture_path": "data/images/greece.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "exit_to_cine", "level_id": 17},
],
},
Expand All @@ -257,7 +247,6 @@
{"type": "loading_screen", "picture_path": "data/images/egypt.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 10},
{"type": "exit_to_level", "level_id": 11},
],
Expand All @@ -279,7 +268,6 @@
{"type": "loading_screen", "picture_path": "data/images/egypt.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 11},
{"type": "exit_to_level", "level_id": 12},
],
Expand All @@ -299,7 +287,6 @@
{"type": "loading_screen", "picture_path": "data/images/egypt.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 12},
{"type": "exit_to_level", "level_id": 13},
],
Expand Down Expand Up @@ -333,7 +320,6 @@
{"type": "remove_scions"},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 13},
{"type": "exit_to_cine", "level_id": 18},
],
Expand All @@ -355,7 +341,6 @@
{"type": "give_item", "object_id": 84, "quantity": 1},
{"type": "setup_bacon_lara", "anchor_room": 10},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "play_fmv", "fmv_path": "fmv/prison.avi"},
{"type": "exit_to_cine", "level_id": 19},
],
Expand All @@ -376,7 +361,6 @@
{"type": "loading_screen", "picture_path": "data/images/atlantis.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 15},
{"type": "play_fmv", "fmv_path": "fmv/end.avi"},
{"type": "play_synced_audio", "audio_id": 19},
Expand Down
1 change: 0 additions & 1 deletion data/tr1/ship/cfg/TR1X_gameflow_demo_pc.json5
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
{"type": "loading_screen", "picture_path": "data/images/peru.webp", "display_time": 5},
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 0},
{"type": "exit_to_level", "level_id": 1},
],
Expand Down
4 changes: 0 additions & 4 deletions data/tr1/ship/cfg/TR1X_gameflow_ub.json5
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"sequence": [
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 0},
{"type": "exit_to_level", "level_id": 1},
],
Expand All @@ -66,7 +65,6 @@
"sequence": [
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 1},
{"type": "exit_to_level", "level_id": 2},
],
Expand All @@ -87,7 +85,6 @@
"sequence": [
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 2},
{"type": "exit_to_level", "level_id": 3},
],
Expand All @@ -107,7 +104,6 @@
"sequence": [
{"type": "start_game"},
{"type": "loop_game"},
{"type": "stop_game"},
{"type": "level_stats", "level_id": 3},
{"type": "play_synced_audio", "audio_id": 19},
{"type": "display_picture", "picture_path": "data/images/end.webp", "display_time": 7.5},
Expand Down
3 changes: 1 addition & 2 deletions src/tr1/game/game/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@ GAME_FLOW_COMMAND Game_Control(const bool demo_mode)

Lara_Cheat_Control();
if (g_LevelComplete) {
// exit details are set up in GFS_STOP_GAME / Game_Stop_Legacy
return (GAME_FLOW_COMMAND) { .action = GF_LEVEL_COMPLETE };
return Game_Stop_Legacy();
}

Input_Update();
Expand Down
1 change: 0 additions & 1 deletion src/tr1/game/game_flow/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ static void M_FreeSequence(GAME_FLOW_SEQUENCE *const sequence)
break;
case GFS_START_GAME:
case GFS_LOOP_GAME:
case GFS_STOP_GAME:
case GFS_LOOP_CINE:
case GFS_LEVEL_STATS:
case GFS_EXIT_TO_TITLE:
Expand Down
1 change: 0 additions & 1 deletion src/tr1/game/game_flow/enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ typedef enum {
GFS_DISPLAY_PICTURE,
GFS_START_GAME,
GFS_LOOP_GAME,
GFS_STOP_GAME,
GFS_LOOP_CINE,
GFS_PLAY_FMV,
GFS_LEVEL_STATS,
Expand Down
1 change: 0 additions & 1 deletion src/tr1/game/game_flow/reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ static bool M_LoadLevelSequence(JSON_OBJECT *obj, int32_t level_num)

switch (event->type) {
case GFS_START_GAME:
case GFS_STOP_GAME:
case GFS_LOOP_GAME:
case GFS_LOOP_CINE:
event->data = (void *)(intptr_t)level_num;
Expand Down
16 changes: 0 additions & 16 deletions src/tr1/game/game_flow/sequencer.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,6 @@ GF_InterpretSequence(int32_t level_num, GAME_FLOW_LEVEL_TYPE level_type)
}
break;

case GFS_STOP_GAME:
command = Game_Stop_Legacy();
if (command.action != GF_NOOP
&& command.action != GF_LEVEL_COMPLETE) {
return command;
}
if (level_type == GFL_SAVED) {
if (g_GameFlow.levels[level_num].level_type == GFL_BONUS) {
level_type = GFL_BONUS;
} else {
level_type = GFL_NORMAL;
}
}
break;

case GFS_LOOP_CINE:
if (level_type != GFL_SAVED) {
command = GF_PlayCutscene((int32_t)(intptr_t)event->data);
Expand Down Expand Up @@ -295,7 +280,6 @@ GF_StorySoFar(const GAME_FLOW_SEQUENCE *const sequence, int32_t savegame_level)

switch (event->type) {
case GFS_LOOP_GAME:
case GFS_STOP_GAME:
case GFS_LEVEL_STATS:
case GFS_TOTAL_STATS:
case GFS_LOADING_SCREEN:
Expand Down
1 change: 0 additions & 1 deletion src/tr1/global/enum_map.def
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ ENUM_MAP_DEFINE(MUSIC_LOAD_CONDITION, MUSIC_LOAD_NON_AMBIENT, "non-ambient")
ENUM_MAP_DEFINE(MUSIC_LOAD_CONDITION, MUSIC_LOAD_ALWAYS, "always")

ENUM_MAP_DEFINE(GAME_FLOW_SEQUENCE_EVENT_TYPE, GFS_START_GAME, "start_game")
ENUM_MAP_DEFINE(GAME_FLOW_SEQUENCE_EVENT_TYPE, GFS_STOP_GAME, "stop_game")
ENUM_MAP_DEFINE(GAME_FLOW_SEQUENCE_EVENT_TYPE, GFS_LOOP_GAME, "loop_game")
ENUM_MAP_DEFINE(GAME_FLOW_SEQUENCE_EVENT_TYPE, GFS_LOOP_CINE, "loop_cine")
ENUM_MAP_DEFINE(GAME_FLOW_SEQUENCE_EVENT_TYPE, GFS_PLAY_FMV, "play_fmv")
Expand Down

0 comments on commit 0a9bc1d

Please sign in to comment.