tr1/game-flow: fix skipping cutscenes

Resolves #2743
This commit is contained in:
Marcin Kurczewski 2025-04-12 16:40:49 +02:00
parent cec3c8d235
commit e3d1fdc4da
6 changed files with 6 additions and 31 deletions

View file

@ -13,6 +13,7 @@
- changed the number of static mesh slots from 50 to 256 (#2734)
- changed the "enable EIDOS logo" option to disable the Core Design and Bink Video Codec FMVs as well; renamed to "enable legal" (#2741)
- fixed the bilinear filter to not readjust the UVs (#2258)
- fixed disabling the cutscenes causing the game to exit (#2743, regression from 4.8)
- fixed anisotropy filter causing black lines on certain GPUs (#902)
- fixed mesh faces not being drawn under some circumstances (#2452, #2438)
- fixed objects disappearing too early around screen edges (#2005)

View file

@ -81,10 +81,6 @@ GF_COMMAND GF_InterpretSequence(
const GF_SEQUENCE *const sequence = &level->sequence;
for (int32_t i = 0; i < sequence->length; i++) {
const GF_SEQUENCE_EVENT *const event = &sequence->events[i];
if (GF_ShouldSkipSequenceEvent(level, event)) {
continue;
}
if (M_PostponeEvent(event)) {
continue;
}

View file

@ -37,6 +37,11 @@ static DECLARE_GF_EVENT_HANDLER(M_HandlePlayCutscene)
{
GF_COMMAND gf_cmd = { .action = GF_NOOP };
const int16_t cutscene_num = (int16_t)(intptr_t)event->data;
#if TR_VERSION == 1
if (!g_Config.gameplay.enable_cutscenes) {
return gf_cmd;
}
#endif
if (seq_ctx != GFSC_SAVED) {
gf_cmd = GF_DoCutsceneSequence(cutscene_num);
if (gf_cmd.action == GF_LEVEL_COMPLETE) {

View file

@ -3,8 +3,6 @@
extern void GF_PreSequenceHook(GF_SEQUENCE_CONTEXT seq_ctx, void *seq_ctx_arg);
extern GF_SEQUENCE_CONTEXT GF_SwitchSequenceContext(
const GF_SEQUENCE_EVENT *event, GF_SEQUENCE_CONTEXT seq_ctx);
extern bool GF_ShouldSkipSequenceEvent(
const GF_LEVEL *level, const GF_SEQUENCE_EVENT *event);
// Defer execution of certain events to run it at various stages of
// GFS_LOOP_GAME.

View file

@ -388,25 +388,6 @@ GF_SEQUENCE_CONTEXT GF_SwitchSequenceContext(
}
}
bool GF_ShouldSkipSequenceEvent(
const GF_LEVEL *const level, const GF_SEQUENCE_EVENT *const event)
{
// Skip cinematic levels
if (!g_Config.gameplay.enable_cutscenes && level->type == GFL_CUTSCENE) {
switch (event->type) {
case GFS_EXIT_TO_TITLE:
case GFS_LEVEL_COMPLETE:
case GFS_PLAY_FMV:
case GFS_LEVEL_STATS:
case GFS_TOTAL_STATS:
return false;
default:
return true;
}
}
return false;
}
GF_EVENT_QUEUE_TYPE GF_ShouldDeferSequenceEvent(
const GF_SEQUENCE_EVENT_TYPE event_type)
{

View file

@ -293,12 +293,6 @@ GF_SEQUENCE_CONTEXT GF_SwitchSequenceContext(
}
}
bool GF_ShouldSkipSequenceEvent(
const GF_LEVEL *const level, const GF_SEQUENCE_EVENT *const event)
{
return false;
}
GF_EVENT_QUEUE_TYPE GF_ShouldDeferSequenceEvent(
const GF_SEQUENCE_EVENT_TYPE event_type)
{