Skip to content

Commit

Permalink
cutscene: suspend demoplayer while active
Browse files Browse the repository at this point in the history
Fixes #369
  • Loading branch information
Akaricchi committed Sep 2, 2023
1 parent 5d54618 commit 3ff6204
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cutscenes/cutscene.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "util/graphics.h"
#include "video.h"
#include "eventloop/eventloop.h"
#include "replay/demoplayer.h"

#define SKIP_DELAY 3
#define AUTO_ADVANCE_TIME_BEFORE_TEXT FPS * 2
Expand Down Expand Up @@ -406,6 +407,8 @@ static void cutscene_end_loop(void *ctx) {

CallChain cc = st->cc;
mem_free(st);

demoplayer_resume();
run_call_chain(&cc, NULL);
}

Expand Down Expand Up @@ -473,6 +476,7 @@ void cutscene_enter(CallChain next, CutsceneID id) {
st->bg_state.transition_rate = 1/80.0f;
progress_unlock_bgm(cs->bgm);
audio_bgm_play(res_bgm(cs->bgm), true, 0, 1);
demoplayer_suspend();
eventloop_enter(st, cutscene_logic_frame, cutscene_render_frame, cutscene_end_loop, FPS);
}

Expand Down

0 comments on commit 3ff6204

Please sign in to comment.