From 72533e2f8a378e4d99e862a1331299a98ecb6848 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 23 Apr 2020 22:33:43 +0200 Subject: [PATCH] - redirect ST_Sound to a callback because the sound code is game specific --- src/common/engine/i_interface.h | 1 + src/common/platform/win32/st_start_util.cpp | 3 ++- src/d_main.cpp | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/engine/i_interface.h b/src/common/engine/i_interface.h index c862feb20..d992203d9 100644 --- a/src/common/engine/i_interface.h +++ b/src/common/engine/i_interface.h @@ -10,6 +10,7 @@ struct SystemCallbacks bool (*WantNativeMouse)(); bool (*CaptureModeInGame)(); void (*CrashInfo)(char* buffer, size_t bufflen, const char* lfstr); + void (*PlayStartupSound)(const char* name); }; diff --git a/src/common/platform/win32/st_start_util.cpp b/src/common/platform/win32/st_start_util.cpp index 11a0b146c..047aa8310 100644 --- a/src/common/platform/win32/st_start_util.cpp +++ b/src/common/platform/win32/st_start_util.cpp @@ -396,7 +396,8 @@ static const int StrifeStartupPicSizes[4 + 2 + 1] = static void ST_Sound(const char* sndname) { - //S_Sound(CHAN_BODY, 0, sndname, 1, ATTN_NONE); + if (sysCallbacks && sysCallbacks->PlayStartupSound) + sysCallbacks->PlayStartupSound(sndname); } //========================================================================== diff --git a/src/d_main.cpp b/src/d_main.cpp index c51bf72aa..d699a69c1 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2639,6 +2639,11 @@ static bool System_CaptureModeInGame() } } +static void System_PlayStartupSound(const char* sndname) +{ + S_Sound(CHAN_BODY, 0, sndname, 1, ATTN_NONE); +} + //========================================================================== // // DoomSpecificInfo