diff --git a/docs/tr1/CHANGELOG.md b/docs/tr1/CHANGELOG.md index 51a90d0da..3c2148cb8 100644 --- a/docs/tr1/CHANGELOG.md +++ b/docs/tr1/CHANGELOG.md @@ -11,6 +11,7 @@ - fixed Lara activating triggers one frame too early (#2208, regression from 4.3) - fixed wrong underwater caustics speed with the turbo cheat (#2231) - fixed 1-frame UI flicker on pause screen exit confirmation +- improved pause screen compatibility with PS1 (#2248) ## [4.7.1](https://github.com/LostArtefacts/TRX/compare/tr1-4.7...tr1-4.7.1) - 2024-12-21 - changed the inventory examine UI to auto-hide if the item description is empty (#2097) diff --git a/src/libtrx/game/phase/phase_pause.c b/src/libtrx/game/phase/phase_pause.c index bc0e02a99..a89ac5141 100644 --- a/src/libtrx/game/phase/phase_pause.c +++ b/src/libtrx/game/phase/phase_pause.c @@ -19,8 +19,11 @@ #include #include +#define FADE_TIME 0.4 + typedef enum { - STATE_DEFAULT, + STATE_FADE_IN, + STATE_WAIT, STATE_ASK, STATE_CONFIRM, STATE_FADE_OUT, @@ -53,8 +56,8 @@ static void M_Draw(PHASE *phase); static void M_FadeIn(M_PRIV *const p) { - M_CreateText(p); - Fader_Init(&p->back_fader, FADER_TRANSPARENT, FADER_SEMI_BLACK, 0.5); + p->state = STATE_FADE_IN; + Fader_Init(&p->back_fader, FADER_TRANSPARENT, FADER_SEMI_BLACK, FADE_TIME); } static void M_FadeOut(M_PRIV *const p) @@ -65,9 +68,9 @@ static void M_FadeOut(M_PRIV *const p) p->ui = NULL; } if (p->action == GF_NOOP) { - Fader_Init(&p->back_fader, FADER_ANY, FADER_TRANSPARENT, 0.3); + Fader_Init(&p->back_fader, FADER_ANY, FADER_TRANSPARENT, FADE_TIME); } else { - Fader_Init(&p->back_fader, FADER_ANY, FADER_BLACK, 0.5); + Fader_Init(&p->back_fader, FADER_ANY, FADER_BLACK, FADE_TIME); } p->state = STATE_FADE_OUT; } @@ -150,7 +153,6 @@ static PHASE_CONTROL M_Start(PHASE *const phase) M_PauseGame(p); p->is_ui_ready = false; - p->state = STATE_DEFAULT; return (PHASE_CONTROL) { .action = PHASE_ACTION_CONTINUE }; } @@ -180,7 +182,17 @@ static PHASE_CONTROL M_Control(PHASE *const phase, int32_t const num_frames) } switch (p->state) { - case STATE_DEFAULT: + case STATE_FADE_IN: + if (g_InputDB.pause) { + M_ReturnToGame(p); + return (PHASE_CONTROL) { .action = PHASE_ACTION_NO_WAIT }; + } else if (!Fader_IsActive(&p->back_fader)) { + p->state = STATE_WAIT; + M_CreateText(p); + } + break; + + case STATE_WAIT: if (g_InputDB.pause) { M_ReturnToGame(p); return (PHASE_CONTROL) { .action = PHASE_ACTION_NO_WAIT };