Add S_StopAllSounds function, guaranteed to be present at link time, whether stubbed (for KenBuild's editor) or calling audiolib's FX_StopAllSounds (for Lunatic).

Also, m32exec should not directly touch audiolib. Only sounds_mapster32.c should interacti with it. KenBuild and its editor do not link to audiolib.

git-svn-id: https://svn.eduke32.com/eduke32@5989 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-01-05 05:29:25 +00:00
parent 22f73a9ab5
commit aa89d88569
9 changed files with 19 additions and 11 deletions

View File

@ -1867,7 +1867,7 @@ end
function _stopallsounds(pli)
if (ffiC.screenpeek==pli) then
ffiC.FX_StopAllSounds()
ffiC.S_StopAllSounds()
end
end

View File

@ -699,7 +699,7 @@ const char *KB_ScanCodeToString(uint8_t scancode);
int32_t A_CheckAnySoundPlaying(int32_t i);
int32_t S_CheckSoundPlaying(int32_t i, int32_t num);
void S_StopEnvSound(int32_t num, int32_t i);
int32_t FX_StopAllSounds(void);
void S_StopAllSounds(void);
void S_ChangeSoundPitch(int32_t num, int32_t i, int32_t pitchoffset);
int32_t S_GetMusicPosition(void);
void S_SetMusicPosition(int32_t position);

View File

@ -230,7 +230,7 @@ KB_ScanCodeToString;
A_CheckAnySoundPlaying;
S_CheckSoundPlaying;
S_StopEnvSound;
FX_StopAllSounds;
S_StopAllSounds;
S_ChangeSoundPitch;
S_GetMusicPosition;
S_SetMusicPosition;

View File

@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "m32def.h"
#include "sounds_mapster32.h"
#include "fx_man.h"
#include "osd.h"
#include "keys.h"
@ -3098,7 +3097,7 @@ dodefault:
case CON_STOPALLSOUNDS:
insptr++;
FX_StopAllSounds();
S_StopAllSounds();
continue;
default:

View File

@ -761,6 +761,12 @@ void S_StopEnvSound(int32_t num, int32_t i)
while (j < MAXSOUNDINSTANCES);
}
// Do not remove this or make it inline.
void S_StopAllSounds(void)
{
FX_StopAllSounds();
}
void S_ChangeSoundPitch(int32_t num, int32_t i, int32_t pitchoffset)
{

View File

@ -102,6 +102,7 @@ int32_t S_PlaySound3D(int32_t num,int32_t i,const vec3_t *pos);
void S_SoundShutdown(void);
void S_SoundStartup(void);
void S_StopEnvSound(int32_t num,int32_t i);
void S_StopAllSounds(void);
void S_StopMusic(void);
void S_Update(void);
void S_ChangeSoundPitch(int32_t num, int32_t i, int32_t pitchoffset);

View File

@ -374,6 +374,12 @@ void S_StopEnvSound(int32_t num,int32_t i)
}
}
// Do not remove this or make it inline.
void S_StopAllSounds(void)
{
FX_StopAllSounds();
}
void S_Update(void)
{
int32_t sndist, sx, sy, sz, cx, cy, cz;

View File

@ -57,6 +57,7 @@ void S_PlaySound(int32_t);
int32_t A_PlaySound(uint32_t num, int32_t i);
void S_StopSound(int32_t num);
void S_StopEnvSound(int32_t num,int32_t i);
void S_StopAllSounds(void);
void S_Update(void);
int32_t A_CheckSoundPlaying(int32_t i, int32_t num);
int32_t S_CheckSoundPlaying(int32_t i, int32_t num);

View File

@ -672,12 +672,7 @@ int32_t A_PlaySound(uint32_t num, int32_t i) {
void S_StopSound(int32_t num) {
UNREFERENCED_PARAMETER(num);
};
#ifdef __cplusplus
extern "C"
#endif
int32_t FX_StopAllSounds(void) {
return 0;
};
void S_StopAllSounds(void) { }
//Just thought you might want my getnumber16 code
/*