Skip to content

Commit

Permalink
tr2/stats: fix assault course not being paused
Browse files Browse the repository at this point in the history
Resolves #2153.
  • Loading branch information
rr- committed Dec 30, 2024
1 parent ec06b26 commit 965cf41
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docs/tr2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
- changed demo to be interrupted only by esc or action keys
- fixed Lara prioritising throwing a spent flare while mid-air, so to avoid missing ledge grabs (#1989)
- fixed Lara at times not being able to jump immediately after going from her walking to running animation (#1587)
- fixed bubbles spawning from flares if Lara is in shallow water (#1590)
- fixed flare sound effects not always playing when Lara is in shallow water (#1590)
- fixed software renderer not applying underwater tint (#2066, regression from 0.7)
- fixed some enemies not looking at Lara (#2080, regression from 0.6)
- fixed the camera getting stuck at the start of Home Sweet Home (#2129, regression from 0.7)
- fixed bubbles spawning from flares if Lara is in shallow water (#1590)
- fixed flare sound effects not always playing when Lara is in shallow water (#1590)
- fixed assault course timer not paused in the inventory (#2153, regression from 0.6)
- improved the animation of Lara's braid (#2094)

## [0.7.1](https://github.com/LostArtefacts/TRX/compare/tr2-0.7...tr2-0.7.1) - 2024-12-17
Expand Down
4 changes: 3 additions & 1 deletion src/tr2/game/inventory_ring/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ INV_RING *InvRing_Open(const INVENTORY_MODE mode)
g_PhdWinBottom = g_PhdWinMaxY;
g_Inv_Chosen = NO_OBJECT;

Stats_StartTimer();
if (g_CurrentLevel != LV_GYM) {
Stats_StartTimer();
}

if (mode == INV_TITLE_MODE) {
Output_LoadBackgroundFromFile("data/title.pcx");
Expand Down
7 changes: 7 additions & 0 deletions src/tr2/game/phase/phase_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static void M_PrepareGame(void);

static PHASE_CONTROL M_Start(PHASE *phase);
static void M_End(PHASE *phase);
static void M_Resume(PHASE *const phase);
static PHASE_CONTROL M_Control(PHASE *phase, int32_t n_frames);
static void M_Draw(PHASE *phase);

Expand Down Expand Up @@ -168,6 +169,11 @@ static void M_End(PHASE *const phase)
M_RestoreConfig(p);
}

static void M_Resume(PHASE *const phase)
{
Stats_StartTimer();
}

static PHASE_CONTROL M_Control(PHASE *const phase, const int32_t num_frames)
{
M_PRIV *const p = phase->priv;
Expand Down Expand Up @@ -208,6 +214,7 @@ PHASE *Phase_Demo_Create(const int32_t level_num)
phase->priv = p;
phase->start = M_Start;
phase->end = M_End;
phase->resume = M_Resume;
phase->control = M_Control;
phase->draw = M_Draw;
return phase;
Expand Down
7 changes: 7 additions & 0 deletions src/tr2/game/phase/phase_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ typedef struct {

static PHASE_CONTROL M_Start(PHASE *phase);
static void M_End(PHASE *phase);
static void M_Resume(PHASE *const phase);
static PHASE_CONTROL M_Control(PHASE *phase, int32_t n_frames);
static void M_Draw(PHASE *phase);

Expand Down Expand Up @@ -67,6 +68,11 @@ static void M_End(PHASE *const phase)
Music_SetVolume(g_Config.audio.music_volume);
}

static void M_Resume(PHASE *const phase)
{
Stats_StartTimer();
}

static PHASE_CONTROL M_Control(PHASE *const phase, const int32_t num_frames)
{
M_PRIV *const p = phase->priv;
Expand Down Expand Up @@ -105,6 +111,7 @@ PHASE *Phase_Game_Create(
phase->priv = p;
phase->start = M_Start;
phase->end = M_End;
phase->resume = M_Resume;
phase->control = M_Control;
phase->draw = M_Draw;
return phase;
Expand Down

0 comments on commit 965cf41

Please sign in to comment.