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) function _stopallsounds(pli)
if (ffiC.screenpeek==pli) then if (ffiC.screenpeek==pli) then
ffiC.FX_StopAllSounds() ffiC.S_StopAllSounds()
end end
end end

View file

@ -699,7 +699,7 @@ const char *KB_ScanCodeToString(uint8_t scancode);
int32_t A_CheckAnySoundPlaying(int32_t i); int32_t A_CheckAnySoundPlaying(int32_t i);
int32_t S_CheckSoundPlaying(int32_t i, int32_t num); int32_t S_CheckSoundPlaying(int32_t i, int32_t num);
void S_StopEnvSound(int32_t num, int32_t i); 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); void S_ChangeSoundPitch(int32_t num, int32_t i, int32_t pitchoffset);
int32_t S_GetMusicPosition(void); int32_t S_GetMusicPosition(void);
void S_SetMusicPosition(int32_t position); void S_SetMusicPosition(int32_t position);

View file

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

View file

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

View file

@ -761,6 +761,12 @@ void S_StopEnvSound(int32_t num, int32_t i)
while (j < MAXSOUNDINSTANCES); 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) 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_SoundShutdown(void);
void S_SoundStartup(void); void S_SoundStartup(void);
void S_StopEnvSound(int32_t num,int32_t i); void S_StopEnvSound(int32_t num,int32_t i);
void S_StopAllSounds(void);
void S_StopMusic(void); void S_StopMusic(void);
void S_Update(void); void S_Update(void);
void S_ChangeSoundPitch(int32_t num, int32_t i, int32_t pitchoffset); 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) void S_Update(void)
{ {
int32_t sndist, sx, sy, sz, cx, cy, cz; 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); int32_t A_PlaySound(uint32_t num, int32_t i);
void S_StopSound(int32_t num); void S_StopSound(int32_t num);
void S_StopEnvSound(int32_t num,int32_t i); void S_StopEnvSound(int32_t num,int32_t i);
void S_StopAllSounds(void);
void S_Update(void); void S_Update(void);
int32_t A_CheckSoundPlaying(int32_t i, int32_t num); int32_t A_CheckSoundPlaying(int32_t i, int32_t num);
int32_t S_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) { void S_StopSound(int32_t num) {
UNREFERENCED_PARAMETER(num); UNREFERENCED_PARAMETER(num);
}; };
#ifdef __cplusplus void S_StopAllSounds(void) { }
extern "C"
#endif
int32_t FX_StopAllSounds(void) {
return 0;
};
//Just thought you might want my getnumber16 code //Just thought you might want my getnumber16 code
/* /*