From de7da0d4d70a9ef00e491d85f509aa28bfe75676 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 7 Sep 2020 20:09:53 +0200 Subject: [PATCH] - fixed: The summary screen in Duke and RR was blocking without explicit user input. It must check for the actual sound that was played, because at least in Duke the looping music is still playing. Fixes #367 --- source/games/duke/src/2d_d.cpp | 6 ++++-- source/games/duke/src/2d_r.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/games/duke/src/2d_d.cpp b/source/games/duke/src/2d_d.cpp index 42c4505d7..291e88296 100644 --- a/source/games/duke/src/2d_d.cpp +++ b/source/games/duke/src/2d_d.cpp @@ -767,6 +767,7 @@ class DDukeLevelSummaryScreen : public DScreenJob const char* lastmapname; int gfx_offset; int bonuscnt = 0; + int speech = -1; void SetTotalClock(int tc) { @@ -911,7 +912,8 @@ public: bonuscnt++; S_PlaySound(SHOTGUN_COCK, CHAN_AUTO, CHANF_UI); static const uint16_t speeches[] = { BONUS_SPEECH1, BONUS_SPEECH2, BONUS_SPEECH3, BONUS_SPEECH4}; - S_PlaySound(speeches[(rand() & 3)], CHAN_AUTO, CHANF_UI, 1); + speech = speeches[(rand() & 3)]; + S_PlaySound(speech, CHAN_AUTO, CHANF_UI, 1); } case 1: case 4: @@ -926,7 +928,7 @@ public: } else if (currentclock > (10240 + 120L)) { - if (!skiprequest && soundEngine->GetSoundPlayingInfo(SOURCE_None, nullptr, -1)) return 1; + if (speech > 0 && !skiprequest && soundEngine->GetSoundPlayingInfo(SOURCE_None, nullptr, speech)) return 1; return 0; } else diff --git a/source/games/duke/src/2d_r.cpp b/source/games/duke/src/2d_r.cpp index b7d5bca54..1c0739d1f 100644 --- a/source/games/duke/src/2d_r.cpp +++ b/source/games/duke/src/2d_r.cpp @@ -358,6 +358,7 @@ class DRRLevelSummaryScreen : public DScreenJob const char* lastmapname; int gfx_offset; int bonuscnt = 0; + int speech = -1; void SetTotalClock(int tc) { @@ -502,13 +503,14 @@ public: { bonuscnt++; S_PlaySound(425, CHAN_AUTO, CHANF_UI); - S_PlaySound(BONUS_SPEECH1 + (rand() & 3), CHAN_AUTO, CHANF_UI); + speech = BONUS_SPEECH1 + (rand() & 3); + S_PlaySound(speech, CHAN_AUTO, CHANF_UI); } } } else if (currentclock > (10240 + 120L)) { - if (!skiprequest && soundEngine->GetSoundPlayingInfo(SOURCE_None, nullptr, -1)) return 1; + if (speech > 0 && !skiprequest && soundEngine->GetSoundPlayingInfo(SOURCE_None, nullptr, speech)) return 1; return 0; }