Fixed casting to wrong StopAllSounds function
diff --git a/src/engine/soundSystem/sndSystem_dma.cpp b/src/engine/soundSystem/sndSystem_dma.cpp
index a7bee33..51fe3fd 100644
--- a/src/engine/soundSystem/sndSystem_dma.cpp
+++ b/src/engine/soundSystem/sndSystem_dma.cpp
@@ -100,6 +100,24 @@ portable_samplepair_t s_rawsamples[MAX_RAW_SAMPLES];
// ====================================================================
/*
+===============
+idSoundSystemLocal::idSoundSystemLocal
+===============
+*/
+idSoundSystemLocal::idSoundSystemLocal( void )
+{
+}
+
+/*
+===============
+idSystemLocal::~idSystemLocal
+===============
+*/
+idSoundSystemLocal::~idSoundSystemLocal( void )
+{
+}
+
+/*
=================
S_SoundInfo_f
=================
@@ -139,6 +157,19 @@ void S_SoundInfo_f( void )
}
/*
+===============
+idSoundSystemLocal::S_StopAllSounds
+
+I had a problem with AddCommand and pointing to the class member so this is one way of doing
+pointing to a function that is a class member
+===============
+*/
+void idSoundSystemLocal::S_StopAllSounds( void )
+{
+ static_cast<idSoundSystemLocal*>( soundSystem )->StopAllSounds();
+}
+
+/*
================
S_Init
================
@@ -162,7 +193,7 @@ void SOrig_Init( void )
cmdSystem->AddCommand( "music", S_Music_f, "Plays specified music file (music music)" );
cmdSystem->AddCommand( "s_list", S_SoundList_f, "Display paths and filenames of all sound files as they are played. (replaced soundlist command)" );
cmdSystem->AddCommand( "s_info", S_SoundInfo_f, "Display information about sound system (replaced soundinfo command)" );
- cmdSystem->AddCommand( "s_stop", SOrig_StopAllSounds, "Stop whatever sound that is currently playing from playing. (Replaced stopsound command)" );
+ cmdSystem->AddCommand( "s_stop", soundSystemLocal.S_StopAllSounds, "Stop whatever sound that is currently playing from playing. (Replaced stopsound command)" );
r = SNDDMA_Init( s_khz->integer );
diff --git a/src/engine/soundSystem/sndSystem_local.hpp b/src/engine/soundSystem/sndSystem_local.hpp
index 3fc0b5d..dc1707a 100644
--- a/src/engine/soundSystem/sndSystem_local.hpp
+++ b/src/engine/soundSystem/sndSystem_local.hpp
@@ -249,6 +249,14 @@ bool SNDDMA_Init( sint sampleFrequencyInKHz );
class idSoundSystemLocal : public idSoundSystem
{
public:
+ /*
+ ===============
+ idSystemLocal::idSystemLocal
+ ===============
+ */
+ idSoundSystemLocal( void );
+ ~idSoundSystemLocal( void );
+
virtual void Init( void );
virtual void Shutdown( void );
// if origin is nullptr, the sound will be dynamically sourced from the entity
@@ -290,6 +298,8 @@ public:
virtual snd_stream_t* codec_open( pointer filename );
virtual void codec_close( snd_stream_t* stream );
virtual sint codec_read( snd_stream_t* stream, sint bytes, void* buffer );
+
+ static void S_StopAllSounds( void );
};
extern idSoundSystemLocal soundSystemLocal;
diff --git a/src/engine/soundSystemAL/sndSystemAL_local.hpp b/src/engine/soundSystemAL/sndSystemAL_local.hpp
index bb7a8f8..ebd3d8f 100644
--- a/src/engine/soundSystemAL/sndSystemAL_local.hpp
+++ b/src/engine/soundSystemAL/sndSystemAL_local.hpp
@@ -73,6 +73,9 @@ typedef sint srcHandle_t;
class idAudioOpenALSystemLocal : public idAudioOpenALSystem
{
public:
+ idAudioOpenALSystemLocal( void );
+ ~idAudioOpenALSystemLocal( void );
+
virtual bool Init( void );
virtual void Shutdown( void );
virtual void StartSound( vec3_t origin, sint entnum, sint entchannel, sfxHandle_t sfx );
diff --git a/src/engine/soundSystemAL/sndSystemAL_main.cpp b/src/engine/soundSystemAL/sndSystemAL_main.cpp
index c16d065..7ab00d6 100644
--- a/src/engine/soundSystemAL/sndSystemAL_main.cpp
+++ b/src/engine/soundSystemAL/sndSystemAL_main.cpp
@@ -42,6 +42,24 @@ idAudioOpenALSystem* soundOpenALSystem = &soundOpenALSystemLocal;
static openALImports_t* imports;
/*
+===============
+idSoundSystemLocal::idSoundSystemLocal
+===============
+*/
+idAudioOpenALSystemLocal::idAudioOpenALSystemLocal( void )
+{
+}
+
+/*
+===============
+idSystemLocal::~idSystemLocal
+===============
+*/
+idAudioOpenALSystemLocal::~idAudioOpenALSystemLocal( void )
+{
+}
+
+/*
=================
idAudioOpenALSystemLocal::format
=================
GitHub
sha: 5df1ee80