mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 19:50:45 +00:00
audiolib:
consolidate all multivoc invalid file errors into MV_InvalidFile renamed FX_PlayLooped to FX_Play and removed original FX_Play removed device type parameter from FX_Init moved several FX_ multivoc wrapper functions to the header and made them FORCE_INLINE git-svn-id: https://svn.eduke32.com/eduke32@5814 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
1305d32e84
commit
a58e1ff580
13 changed files with 98 additions and 184 deletions
|
@ -189,6 +189,7 @@
|
||||||
<ClInclude Include="source\input.h" />
|
<ClInclude Include="source\input.h" />
|
||||||
<ClInclude Include="source\inv.h" />
|
<ClInclude Include="source\inv.h" />
|
||||||
<ClInclude Include="source\jaudiolib\include\drivers.h" />
|
<ClInclude Include="source\jaudiolib\include\drivers.h" />
|
||||||
|
<ClInclude Include="source\jaudiolib\include\multivoc.h" />
|
||||||
<ClInclude Include="source\lunatic\lunatic_game.h" />
|
<ClInclude Include="source\lunatic\lunatic_game.h" />
|
||||||
<ClInclude Include="source\lunatic\lunatic_m32.h" />
|
<ClInclude Include="source\lunatic\lunatic_m32.h" />
|
||||||
<ClInclude Include="source\m32def.h" />
|
<ClInclude Include="source\m32def.h" />
|
||||||
|
@ -232,7 +233,6 @@
|
||||||
<ClInclude Include="source\jaudiolib\src\driver_sdl.h" />
|
<ClInclude Include="source\jaudiolib\src\driver_sdl.h" />
|
||||||
<ClInclude Include="source\jaudiolib\include\fx_man.h" />
|
<ClInclude Include="source\jaudiolib\include\fx_man.h" />
|
||||||
<ClInclude Include="source\jaudiolib\src\linklist.h" />
|
<ClInclude Include="source\jaudiolib\src\linklist.h" />
|
||||||
<ClInclude Include="source\jaudiolib\src\multivoc.h" />
|
|
||||||
<ClInclude Include="source\jaudiolib\include\music.h" />
|
<ClInclude Include="source\jaudiolib\include\music.h" />
|
||||||
<ClInclude Include="source\jaudiolib\src\pitch.h" />
|
<ClInclude Include="source\jaudiolib\src\pitch.h" />
|
||||||
<ClInclude Include="source\jmact\_control.h" />
|
<ClInclude Include="source\jmact\_control.h" />
|
||||||
|
|
|
@ -249,9 +249,6 @@
|
||||||
<ClInclude Include="source\jaudiolib\src\linklist.h">
|
<ClInclude Include="source\jaudiolib\src\linklist.h">
|
||||||
<Filter>jaudiolib\headers</Filter>
|
<Filter>jaudiolib\headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="source\jaudiolib\src\multivoc.h">
|
|
||||||
<Filter>jaudiolib\headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="source\jaudiolib\include\music.h">
|
<ClInclude Include="source\jaudiolib\include\music.h">
|
||||||
<Filter>jaudiolib\headers</Filter>
|
<Filter>jaudiolib\headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -540,6 +537,9 @@
|
||||||
<ClInclude Include="build\include\clip.h">
|
<ClInclude Include="build\include\clip.h">
|
||||||
<Filter>build\headers</Filter>
|
<Filter>build\headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="source\jaudiolib\include\multivoc.h">
|
||||||
|
<Filter>jaudiolib\headers</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="build\src\a-c.c">
|
<ClCompile Include="build\src\a-c.c">
|
||||||
|
|
|
@ -32,7 +32,6 @@ typedef enum
|
||||||
ASS_SDL,
|
ASS_SDL,
|
||||||
#endif
|
#endif
|
||||||
ASS_NumSoundCards,
|
ASS_NumSoundCards,
|
||||||
ASS_AutoDetect = -2
|
|
||||||
} soundcardnames;
|
} soundcardnames;
|
||||||
|
|
||||||
extern int32_t ASS_SoundDriver;
|
extern int32_t ASS_SoundDriver;
|
||||||
|
|
|
@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "inttypes.h"
|
#include "inttypes.h"
|
||||||
#include "limits.h"
|
#include "limits.h"
|
||||||
#include "drivers.h"
|
#include "drivers.h"
|
||||||
|
#include "multivoc.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -57,43 +58,61 @@ enum FX_LOOP_HOW
|
||||||
#define FX_MUSIC_PRIORITY INT_MAX
|
#define FX_MUSIC_PRIORITY INT_MAX
|
||||||
|
|
||||||
const char *FX_ErrorString(int32_t ErrorNumber);
|
const char *FX_ErrorString(int32_t ErrorNumber);
|
||||||
int32_t FX_Init(int32_t SoundCard, int32_t numvoices, int32_t numchannels, unsigned mixrate, void *initdata);
|
int32_t FX_Init(int32_t numvoices, int32_t numchannels, unsigned mixrate, void *initdata);
|
||||||
int32_t FX_Shutdown(void);
|
int32_t FX_Shutdown(void);
|
||||||
void FX_SetCallBack(void(*function)(uint32_t));
|
|
||||||
void FX_SetVolume(int32_t volume);
|
|
||||||
int32_t FX_GetVolume(void);
|
|
||||||
|
|
||||||
void FX_SetReverseStereo(int32_t setting);
|
|
||||||
int32_t FX_GetReverseStereo(void);
|
|
||||||
void FX_SetReverb(int32_t reverb);
|
|
||||||
int32_t FX_GetMaxReverbDelay(void);
|
|
||||||
int32_t FX_GetReverbDelay(void);
|
|
||||||
void FX_SetReverbDelay(int32_t delay);
|
|
||||||
|
|
||||||
int32_t FX_PauseVoice(int32_t handle, int32_t pause);
|
|
||||||
int32_t FX_VoiceAvailable(int32_t priority);
|
|
||||||
int32_t FX_EndLooping(int32_t handle);
|
|
||||||
int32_t FX_SetPan(int32_t handle, int32_t vol, int32_t left, int32_t right);
|
|
||||||
int32_t FX_SetPitch(int32_t handle, int32_t pitchoffset);
|
|
||||||
int32_t FX_SetFrequency(int32_t handle, int32_t frequency);
|
|
||||||
|
|
||||||
int32_t FX_Play(char *ptr, uint32_t ptrlength, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right,
|
int32_t FX_Play(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t loopend, int32_t pitchoffset,
|
||||||
int32_t priority, uint32_t callbackval);
|
|
||||||
int32_t FX_PlayLooped(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t loopend, int32_t pitchoffset,
|
|
||||||
int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval);
|
int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval);
|
||||||
int32_t FX_Play3D(char *ptr, uint32_t ptrlength, int32_t loophow, int32_t pitchoffset, int32_t angle,
|
int32_t FX_Play3D(char *ptr, uint32_t ptrlength, int32_t loophow, int32_t pitchoffset, int32_t angle,
|
||||||
int32_t distance, int32_t priority, uint32_t callbackval);
|
int32_t distance, int32_t priority, uint32_t callbackval);
|
||||||
|
|
||||||
int32_t FX_Pan3D(int32_t handle, int32_t angle, int32_t distance);
|
|
||||||
int32_t FX_SoundActive(int32_t handle);
|
|
||||||
int32_t FX_SoundsPlaying(void);
|
|
||||||
int32_t FX_StopSound(int32_t handle);
|
|
||||||
int32_t FX_StopAllSounds(void);
|
|
||||||
|
|
||||||
int32_t FX_SetPrintf(void(*function)(const char *, ...));
|
int32_t FX_SetPrintf(void(*function)(const char *, ...));
|
||||||
|
|
||||||
int32_t FX_GetPosition(int32_t handle, int32_t *position);
|
extern int32_t FX_ErrorCode;
|
||||||
int32_t FX_SetPosition(int32_t handle, int32_t position);
|
#define FX_SetErrorCode(status) FX_ErrorCode = (status);
|
||||||
|
|
||||||
|
FORCE_INLINE int FX_CheckMVErr(int32_t status)
|
||||||
|
{
|
||||||
|
if (status != MV_Ok)
|
||||||
|
{
|
||||||
|
FX_SetErrorCode(FX_MultiVocError);
|
||||||
|
status = FX_Warning;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCE_INLINE void FX_SetCallBack(void(*function)(uint32_t)) { MV_SetCallBack(function); }
|
||||||
|
FORCE_INLINE void FX_SetVolume(int32_t volume) { MV_SetVolume(volume); }
|
||||||
|
FORCE_INLINE int32_t FX_GetVolume(void) { return MV_GetVolume(); }
|
||||||
|
FORCE_INLINE void FX_SetReverseStereo(int32_t setting) { MV_SetReverseStereo(setting); }
|
||||||
|
FORCE_INLINE int32_t FX_GetReverseStereo(void) { return MV_GetReverseStereo(); }
|
||||||
|
FORCE_INLINE void FX_SetReverb(int32_t reverb) { MV_SetReverb(reverb); }
|
||||||
|
FORCE_INLINE int32_t FX_GetMaxReverbDelay(void) { return MV_GetMaxReverbDelay(); }
|
||||||
|
FORCE_INLINE int32_t FX_GetReverbDelay(void) { return MV_GetReverbDelay(); }
|
||||||
|
FORCE_INLINE void FX_SetReverbDelay(int32_t delay) { MV_SetReverbDelay(delay); }
|
||||||
|
FORCE_INLINE int32_t FX_VoiceAvailable(int32_t priority) { return MV_VoiceAvailable(priority); }
|
||||||
|
FORCE_INLINE int32_t FX_PauseVoice(int32_t handle, int32_t pause) { return FX_CheckMVErr(MV_PauseVoice(handle, pause)); }
|
||||||
|
FORCE_INLINE int32_t FX_GetPosition(int32_t handle, int32_t *position) { return FX_CheckMVErr(MV_GetPosition(handle, position)); }
|
||||||
|
FORCE_INLINE int32_t FX_SetPosition(int32_t handle, int32_t position) { return FX_CheckMVErr(MV_SetPosition(handle, position)); }
|
||||||
|
FORCE_INLINE int32_t FX_EndLooping(int32_t handle) { return FX_CheckMVErr(MV_EndLooping(handle)); }
|
||||||
|
FORCE_INLINE int32_t FX_SetPan(int32_t handle, int32_t vol, int32_t left, int32_t right)
|
||||||
|
{
|
||||||
|
return FX_CheckMVErr(MV_SetPan(handle, vol, left, right));
|
||||||
|
}
|
||||||
|
FORCE_INLINE int32_t FX_SetPitch(int32_t handle, int32_t pitchoffset) { return FX_CheckMVErr(MV_SetPitch(handle, pitchoffset)); }
|
||||||
|
FORCE_INLINE int32_t FX_SetFrequency(int32_t handle, int32_t frequency) { return FX_CheckMVErr(MV_SetFrequency(handle, frequency)); }
|
||||||
|
FORCE_INLINE int32_t FX_Pan3D(int32_t handle, int32_t angle, int32_t distance)
|
||||||
|
{
|
||||||
|
return FX_CheckMVErr(MV_Pan3D(handle, angle, distance));
|
||||||
|
}
|
||||||
|
FORCE_INLINE int32_t FX_SoundActive(int32_t handle) { return MV_VoicePlaying(handle); }
|
||||||
|
FORCE_INLINE int32_t FX_SoundsPlaying(void) { return MV_VoicesPlaying(); }
|
||||||
|
FORCE_INLINE int32_t FX_StopSound(int32_t handle) { return FX_CheckMVErr(MV_Kill(handle)); }
|
||||||
|
FORCE_INLINE int32_t FX_StopAllSounds(void) { return FX_CheckMVErr(MV_KillAllVoices()); }
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,17 +96,14 @@ extern int32_t MV_ErrorCode;
|
||||||
|
|
||||||
enum MV_Errors
|
enum MV_Errors
|
||||||
{
|
{
|
||||||
|
MV_Error = -1,
|
||||||
MV_Ok = 0,
|
MV_Ok = 0,
|
||||||
MV_NotInstalled,
|
MV_NotInstalled,
|
||||||
MV_DriverError,
|
MV_DriverError,
|
||||||
MV_NoVoices,
|
MV_NoVoices,
|
||||||
MV_NoMem,
|
MV_NoMem,
|
||||||
MV_VoiceNotFound,
|
MV_VoiceNotFound,
|
||||||
MV_InvalidVOCFile,
|
MV_InvalidFile,
|
||||||
MV_InvalidWAVFile,
|
|
||||||
MV_InvalidVorbisFile,
|
|
||||||
MV_InvalidFLACFile,
|
|
||||||
MV_InvalidXAFile,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void (*MV_Printf)(const char *fmt, ...);
|
extern void (*MV_Printf)(const char *fmt, ...);
|
|
@ -446,7 +446,7 @@ int32_t MV_PlayFLAC(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t lo
|
||||||
fd = (flac_data *)calloc(1, sizeof(flac_data));
|
fd = (flac_data *)calloc(1, sizeof(flac_data));
|
||||||
if (!fd)
|
if (!fd)
|
||||||
{
|
{
|
||||||
MV_SetErrorCode(MV_InvalidFLACFile);
|
MV_SetErrorCode(MV_InvalidFile);
|
||||||
return MV_Error;
|
return MV_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,7 +468,7 @@ int32_t MV_PlayFLAC(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t lo
|
||||||
(void *)fd) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
|
(void *)fd) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
|
||||||
{
|
{
|
||||||
MV_Printf("MV_PlayFLAC: %s\n", FLAC__stream_decoder_get_resolved_state_string(fd->stream));
|
MV_Printf("MV_PlayFLAC: %s\n", FLAC__stream_decoder_get_resolved_state_string(fd->stream));
|
||||||
MV_SetErrorCode(MV_InvalidFLACFile);
|
MV_SetErrorCode(MV_InvalidFile);
|
||||||
return MV_Error;
|
return MV_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -540,7 +540,7 @@ int32_t MV_PlayFLAC(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t lo
|
||||||
FLAC__stream_decoder_finish(fd->stream);
|
FLAC__stream_decoder_finish(fd->stream);
|
||||||
FLAC__stream_decoder_delete(fd->stream);
|
FLAC__stream_decoder_delete(fd->stream);
|
||||||
free(fd);
|
free(fd);
|
||||||
MV_SetErrorCode(MV_InvalidFLACFile);
|
MV_SetErrorCode(MV_InvalidFile);
|
||||||
return MV_Error;
|
return MV_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -347,7 +347,7 @@ int32_t MV_PlayWAV(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t loo
|
||||||
|
|
||||||
if ((memcmp(riff.RIFF, "RIFF", 4) != 0) || (memcmp(riff.WAVE, "WAVE", 4) != 0) || (memcmp(riff.fmt, "fmt ", 4) != 0))
|
if ((memcmp(riff.RIFF, "RIFF", 4) != 0) || (memcmp(riff.WAVE, "WAVE", 4) != 0) || (memcmp(riff.fmt, "fmt ", 4) != 0))
|
||||||
{
|
{
|
||||||
MV_SetErrorCode(MV_InvalidWAVFile);
|
MV_SetErrorCode(MV_InvalidFile);
|
||||||
return MV_Error;
|
return MV_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ int32_t MV_PlayWAV(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t loo
|
||||||
if (format.wFormatTag != 1 || (format.nChannels != 1 && format.nChannels != 2) ||
|
if (format.wFormatTag != 1 || (format.nChannels != 1 && format.nChannels != 2) ||
|
||||||
((format.nBitsPerSample != 8) && (format.nBitsPerSample != 16)) || memcmp(data.DATA, "data", 4) != 0)
|
((format.nBitsPerSample != 8) && (format.nBitsPerSample != 16)) || memcmp(data.DATA, "data", 4) != 0)
|
||||||
{
|
{
|
||||||
MV_SetErrorCode(MV_InvalidWAVFile);
|
MV_SetErrorCode(MV_InvalidFile);
|
||||||
return MV_Error;
|
return MV_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,7 +455,7 @@ int32_t MV_PlayVOC(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t loo
|
||||||
// Make sure it looks like a valid VOC file.
|
// Make sure it looks like a valid VOC file.
|
||||||
if (memcmp(ptr, "Creative Voice File", 19) != 0)
|
if (memcmp(ptr, "Creative Voice File", 19) != 0)
|
||||||
{
|
{
|
||||||
MV_SetErrorCode(MV_InvalidVOCFile);
|
MV_SetErrorCode(MV_InvalidFile);
|
||||||
return MV_Error;
|
return MV_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
int32_t FX_ErrorCode = FX_Ok;
|
int32_t FX_ErrorCode = FX_Ok;
|
||||||
int32_t FX_Installed = FALSE;
|
int32_t FX_Installed = FALSE;
|
||||||
|
|
||||||
#define FX_SetErrorCode(status) FX_ErrorCode = (status);
|
|
||||||
|
|
||||||
const char *FX_ErrorString(int32_t ErrorNumber)
|
const char *FX_ErrorString(int32_t ErrorNumber)
|
||||||
{
|
{
|
||||||
const char *ErrorString;
|
const char *ErrorString;
|
||||||
|
@ -54,8 +52,6 @@ const char *FX_ErrorString(int32_t ErrorNumber)
|
||||||
|
|
||||||
case FX_Ok: ErrorString = "Fx ok."; break;
|
case FX_Ok: ErrorString = "Fx ok."; break;
|
||||||
|
|
||||||
case FX_InvalidCard: ErrorString = "Invalid Sound Fx device."; break;
|
|
||||||
|
|
||||||
case FX_MultiVocError: ErrorString = MV_ErrorString(MV_Error); break;
|
case FX_MultiVocError: ErrorString = MV_ErrorString(MV_Error); break;
|
||||||
|
|
||||||
default: ErrorString = "Unknown Fx error code."; break;
|
default: ErrorString = "Unknown Fx error code."; break;
|
||||||
|
@ -64,39 +60,19 @@ const char *FX_ErrorString(int32_t ErrorNumber)
|
||||||
return ErrorString;
|
return ErrorString;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int32_t FX_CheckMVErr(int32_t status)
|
int32_t FX_Init(int32_t numvoices, int32_t numchannels, unsigned mixrate, void *initdata)
|
||||||
{
|
|
||||||
if (status != MV_Ok)
|
|
||||||
{
|
|
||||||
FX_SetErrorCode(FX_MultiVocError);
|
|
||||||
status = FX_Warning;
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t FX_Init(int32_t SoundCard, int32_t numvoices, int32_t numchannels, unsigned mixrate, void *initdata)
|
|
||||||
{
|
{
|
||||||
if (FX_Installed)
|
if (FX_Installed)
|
||||||
FX_Shutdown();
|
FX_Shutdown();
|
||||||
|
|
||||||
if (SoundCard == ASS_AutoDetect)
|
|
||||||
{
|
|
||||||
#if defined MIXERTYPEWIN
|
#if defined MIXERTYPEWIN
|
||||||
SoundCard = ASS_DirectSound;
|
int SoundCard = ASS_DirectSound;
|
||||||
#elif defined MIXERTYPESDL
|
#elif defined MIXERTYPESDL
|
||||||
SoundCard = ASS_SDL;
|
int SoundCard = ASS_SDL;
|
||||||
#else
|
#else
|
||||||
#warning No sound driver selected!
|
#warning No sound driver selected!
|
||||||
SoundCard = ASS_NoSound;
|
int SoundCard = ASS_NoSound;
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
if (SoundCard < 0 || SoundCard >= ASS_NumSoundCards)
|
|
||||||
{
|
|
||||||
FX_SetErrorCode(FX_InvalidCard);
|
|
||||||
return FX_Error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SoundDriver_IsSupported(SoundCard) == 0)
|
if (SoundDriver_IsSupported(SoundCard) == 0)
|
||||||
{
|
{
|
||||||
|
@ -136,62 +112,12 @@ int32_t FX_Shutdown(void)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FX_SetCallBack(void (*function)(uint32_t)) { MV_SetCallBack(function); }
|
static wavefmt_t FX_DetectFormat(char const * const ptr, uint32_t length)
|
||||||
|
|
||||||
void FX_SetVolume(int32_t volume) { MV_SetVolume(volume); }
|
|
||||||
|
|
||||||
int32_t FX_GetVolume(void) { return MV_GetVolume(); }
|
|
||||||
|
|
||||||
void FX_SetReverseStereo(int32_t setting) { MV_SetReverseStereo(setting); }
|
|
||||||
|
|
||||||
int32_t FX_GetReverseStereo(void) { return MV_GetReverseStereo(); }
|
|
||||||
|
|
||||||
void FX_SetReverb(int32_t reverb) { MV_SetReverb(reverb); }
|
|
||||||
|
|
||||||
int32_t FX_GetMaxReverbDelay(void) { return MV_GetMaxReverbDelay(); }
|
|
||||||
|
|
||||||
int32_t FX_GetReverbDelay(void) { return MV_GetReverbDelay(); }
|
|
||||||
|
|
||||||
void FX_SetReverbDelay(int32_t delay) { MV_SetReverbDelay(delay); }
|
|
||||||
|
|
||||||
int32_t FX_VoiceAvailable(int32_t priority) { return MV_VoiceAvailable(priority); }
|
|
||||||
|
|
||||||
int32_t FX_PauseVoice(int32_t handle, int32_t pause) { return FX_CheckMVErr(MV_PauseVoice(handle, pause)); }
|
|
||||||
|
|
||||||
int32_t FX_GetPosition(int32_t handle, int32_t *position) { return FX_CheckMVErr(MV_GetPosition(handle, position)); }
|
|
||||||
|
|
||||||
int32_t FX_SetPosition(int32_t handle, int32_t position) { return FX_CheckMVErr(MV_SetPosition(handle, position)); }
|
|
||||||
|
|
||||||
int32_t FX_EndLooping(int32_t handle) { return FX_CheckMVErr(MV_EndLooping(handle)); }
|
|
||||||
|
|
||||||
int32_t FX_SetPan(int32_t handle, int32_t vol, int32_t left, int32_t right)
|
|
||||||
{
|
{
|
||||||
return FX_CheckMVErr(MV_SetPan(handle, vol, left, right));
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t FX_SetPitch(int32_t handle, int32_t pitchoffset) { return FX_CheckMVErr(MV_SetPitch(handle, pitchoffset)); }
|
|
||||||
|
|
||||||
int32_t FX_SetFrequency(int32_t handle, int32_t frequency) { return FX_CheckMVErr(MV_SetFrequency(handle, frequency)); }
|
|
||||||
|
|
||||||
int32_t FX_Pan3D(int32_t handle, int32_t angle, int32_t distance)
|
|
||||||
{
|
|
||||||
return FX_CheckMVErr(MV_Pan3D(handle, angle, distance));
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t FX_SoundActive(int32_t handle) { return MV_VoicePlaying(handle); }
|
|
||||||
|
|
||||||
int32_t FX_SoundsPlaying(void) { return MV_VoicesPlaying(); }
|
|
||||||
|
|
||||||
int32_t FX_StopSound(int32_t handle) { return FX_CheckMVErr(MV_Kill(handle)); }
|
|
||||||
|
|
||||||
int32_t FX_StopAllSounds(void) { return FX_CheckMVErr(MV_KillAllVoices()); }
|
|
||||||
|
|
||||||
static wavefmt_t FX_AutoDetectFormat(const char *ptr, uint32_t length)
|
|
||||||
{
|
|
||||||
wavefmt_t fmt = FMT_UNKNOWN;
|
|
||||||
|
|
||||||
if (length < 12)
|
if (length < 12)
|
||||||
return fmt;
|
return FMT_UNKNOWN;
|
||||||
|
|
||||||
|
wavefmt_t fmt = FMT_UNKNOWN;
|
||||||
|
|
||||||
switch (LITTLE32(*(int32_t const *)ptr))
|
switch (LITTLE32(*(int32_t const *)ptr))
|
||||||
{
|
{
|
||||||
|
@ -226,26 +152,18 @@ static wavefmt_t FX_AutoDetectFormat(const char *ptr, uint32_t length)
|
||||||
return fmt;
|
return fmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t FX_Play(char *ptr, uint32_t length, int32_t pitchoffset, int32_t vol,
|
int32_t FX_Play(char *ptr, uint32_t length, int32_t loopstart, int32_t loopend, int32_t pitchoffset,
|
||||||
int32_t left, int32_t right, int32_t priority, uint32_t callbackval)
|
|
||||||
{
|
|
||||||
return FX_PlayLooped(ptr, length, -1, -1, pitchoffset, vol, left, right, priority, callbackval);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t FX_PlayLooped(char *ptr, uint32_t length, int32_t loopstart, int32_t loopend, int32_t pitchoffset,
|
|
||||||
int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval)
|
int32_t vol, int32_t left, int32_t right, int32_t priority, uint32_t callbackval)
|
||||||
{
|
{
|
||||||
int32_t handle = -1;
|
|
||||||
|
|
||||||
EDUKE32_STATIC_ASSERT(FMT_MAX == 7);
|
EDUKE32_STATIC_ASSERT(FMT_MAX == 7);
|
||||||
|
|
||||||
static int32_t(*const func[FMT_MAX])(char *, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t) =
|
static int32_t(*const func[FMT_MAX])(char *, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t) =
|
||||||
{ NULL, NULL, MV_PlayVOC, MV_PlayWAV, MV_PlayVorbis, MV_PlayFLAC, MV_PlayXA };
|
{ NULL, NULL, MV_PlayVOC, MV_PlayWAV, MV_PlayVorbis, MV_PlayFLAC, MV_PlayXA };
|
||||||
|
|
||||||
wavefmt_t const fmt = FX_AutoDetectFormat(ptr, length);
|
wavefmt_t const fmt = FX_DetectFormat(ptr, length);
|
||||||
|
|
||||||
if (func[fmt])
|
int handle =
|
||||||
handle = func[fmt](ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval);
|
(func[fmt]) ? func[fmt](ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval) : -1;
|
||||||
|
|
||||||
if (handle <= MV_Ok)
|
if (handle <= MV_Ok)
|
||||||
{
|
{
|
||||||
|
@ -259,17 +177,15 @@ int32_t FX_PlayLooped(char *ptr, uint32_t length, int32_t loopstart, int32_t loo
|
||||||
int32_t FX_Play3D(char *ptr, uint32_t length, int32_t loophow, int32_t pitchoffset, int32_t angle, int32_t distance,
|
int32_t FX_Play3D(char *ptr, uint32_t length, int32_t loophow, int32_t pitchoffset, int32_t angle, int32_t distance,
|
||||||
int32_t priority, uint32_t callbackval)
|
int32_t priority, uint32_t callbackval)
|
||||||
{
|
{
|
||||||
int32_t handle = -1;
|
|
||||||
|
|
||||||
EDUKE32_STATIC_ASSERT(FMT_MAX == 7);
|
EDUKE32_STATIC_ASSERT(FMT_MAX == 7);
|
||||||
|
|
||||||
static int32_t (*const func[FMT_MAX])(char *, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t) =
|
static int32_t (*const func[FMT_MAX])(char *, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t) =
|
||||||
{ NULL, NULL, MV_PlayVOC3D, MV_PlayWAV3D, MV_PlayVorbis3D, MV_PlayFLAC3D, MV_PlayXA3D };
|
{ NULL, NULL, MV_PlayVOC3D, MV_PlayWAV3D, MV_PlayVorbis3D, MV_PlayFLAC3D, MV_PlayXA3D };
|
||||||
|
|
||||||
wavefmt_t const fmt = FX_AutoDetectFormat(ptr, length);
|
wavefmt_t const fmt = FX_DetectFormat(ptr, length);
|
||||||
|
|
||||||
if (func[fmt])
|
int handle =
|
||||||
handle = func[fmt](ptr, length, loophow, pitchoffset, angle, distance, priority, callbackval);
|
(func[fmt]) ? func[fmt](ptr, length, loophow, pitchoffset, angle, distance, priority, callbackval) : -1;
|
||||||
|
|
||||||
if (handle <= MV_Ok)
|
if (handle <= MV_Ok)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,8 +43,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "pitch.h"
|
#include "pitch.h"
|
||||||
#include "multivoc.h"
|
#include "multivoc.h"
|
||||||
#include "_multivc.h"
|
#include "_multivc.h"
|
||||||
|
#include "fx_man.h"
|
||||||
|
|
||||||
static void MV_Mix(VoiceNode *voice, int32_t buffer);
|
|
||||||
static void MV_StopVoice(VoiceNode *voice);
|
static void MV_StopVoice(VoiceNode *voice);
|
||||||
static void MV_ServiceVoc(void);
|
static void MV_ServiceVoc(void);
|
||||||
|
|
||||||
|
@ -52,8 +52,6 @@ static VoiceNode *MV_GetVoice(int32_t handle);
|
||||||
|
|
||||||
static const int16_t *MV_GetVolumeTable(int32_t vol);
|
static const int16_t *MV_GetVolumeTable(int32_t vol);
|
||||||
|
|
||||||
static void MV_CalcPanTable(void);
|
|
||||||
|
|
||||||
#define IS_QUIET(ptr) ((void const *)(ptr) == (void *)&MV_VolumeTable[0])
|
#define IS_QUIET(ptr) ((void const *)(ptr) == (void *)&MV_VolumeTable[0])
|
||||||
|
|
||||||
static int32_t MV_ReverbLevel;
|
static int32_t MV_ReverbLevel;
|
||||||
|
@ -103,13 +101,13 @@ int32_t MV_ErrorCode = MV_NotInstalled;
|
||||||
|
|
||||||
static int32_t lockdepth = 0;
|
static int32_t lockdepth = 0;
|
||||||
|
|
||||||
static inline void DisableInterrupts(void)
|
FORCE_INLINE void DisableInterrupts(void)
|
||||||
{
|
{
|
||||||
if (lockdepth++ <= 0)
|
if (lockdepth++ <= 0)
|
||||||
SoundDriver_Lock();
|
SoundDriver_Lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RestoreInterrupts(void)
|
FORCE_INLINE void RestoreInterrupts(void)
|
||||||
{
|
{
|
||||||
if (--lockdepth <= 0)
|
if (--lockdepth <= 0)
|
||||||
SoundDriver_Unlock();
|
SoundDriver_Unlock();
|
||||||
|
@ -133,22 +131,14 @@ const char *MV_ErrorString(int32_t ErrorNumber)
|
||||||
return "Out of memory in Multivoc.";
|
return "Out of memory in Multivoc.";
|
||||||
case MV_VoiceNotFound:
|
case MV_VoiceNotFound:
|
||||||
return "No voice with matching handle found.";
|
return "No voice with matching handle found.";
|
||||||
case MV_InvalidVOCFile:
|
case MV_InvalidFile:
|
||||||
return "Invalid VOC file passed in to Multivoc.";
|
return "Invalid file passed in to Multivoc.";
|
||||||
case MV_InvalidWAVFile:
|
|
||||||
return "Invalid WAV file passed in to Multivoc.";
|
|
||||||
case MV_InvalidVorbisFile:
|
|
||||||
return "Invalid OggVorbis file passed in to Multivoc.";
|
|
||||||
case MV_InvalidFLACFile:
|
|
||||||
return "Invalid FLAC file passed in to Multivoc.";
|
|
||||||
case MV_InvalidXAFile:
|
|
||||||
return "Invalid XA file passed in to Multivoc.";
|
|
||||||
default:
|
default:
|
||||||
return "Unknown Multivoc error code.";
|
return "Unknown Multivoc error code.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MV_Mix(VoiceNode *voice, int32_t buffer)
|
static void MV_Mix(VoiceNode *voice, int const buffer)
|
||||||
{
|
{
|
||||||
/* cheap fix for a crash under 64-bit linux */
|
/* cheap fix for a crash under 64-bit linux */
|
||||||
/* v v v v */
|
/* v v v v */
|
||||||
|
@ -169,11 +159,11 @@ static void MV_Mix(VoiceNode *voice, int32_t buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add this voice to the mix
|
// Add this voice to the mix
|
||||||
while (length > 0)
|
do
|
||||||
{
|
{
|
||||||
const char *start = voice->sound;
|
const char *start = voice->sound;
|
||||||
uint32_t rate = voice->RateScale;
|
uint32_t const rate = voice->RateScale;
|
||||||
uint32_t position = voice->position;
|
uint32_t const position = voice->position;
|
||||||
int32_t voclength;
|
int32_t voclength;
|
||||||
|
|
||||||
// Check if the last sample in this buffer would be
|
// Check if the last sample in this buffer would be
|
||||||
|
@ -210,7 +200,7 @@ static void MV_Mix(VoiceNode *voice, int32_t buffer)
|
||||||
FixedPointBufferSize = voice->RateScale * (length - voice->channels);
|
FixedPointBufferSize = voice->RateScale * (length - voice->channels);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} while (length > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MV_PlayVoice(VoiceNode *voice)
|
void MV_PlayVoice(VoiceNode *voice)
|
||||||
|
@ -297,11 +287,12 @@ static void MV_ServiceVoc(void)
|
||||||
// Play any waiting voices
|
// Play any waiting voices
|
||||||
//DisableInterrupts();
|
//DisableInterrupts();
|
||||||
|
|
||||||
VoiceNode *voice;
|
|
||||||
|
|
||||||
if (!VoiceList.next || (voice = VoiceList.next) == &VoiceList)
|
if (!VoiceList.next || VoiceList.next == &VoiceList)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
VoiceNode *voice = VoiceList.next;
|
||||||
|
|
||||||
int iter = 0;
|
int iter = 0;
|
||||||
|
|
||||||
VoiceNode *next;
|
VoiceNode *next;
|
||||||
|
@ -835,9 +826,7 @@ static void MV_StopPlayback(void)
|
||||||
// Make sure all callbacks are done.
|
// Make sure all callbacks are done.
|
||||||
DisableInterrupts();
|
DisableInterrupts();
|
||||||
|
|
||||||
VoiceNode *voice, *next;
|
for (VoiceNode *voice = VoiceList.next, *next; voice != &VoiceList; voice = next)
|
||||||
|
|
||||||
for (voice = VoiceList.next; voice != &VoiceList; voice = next)
|
|
||||||
{
|
{
|
||||||
next = voice->next;
|
next = voice->next;
|
||||||
|
|
||||||
|
@ -929,16 +918,13 @@ int32_t MV_Init(int32_t soundcard, int32_t MixRate, int32_t Voices, int32_t numc
|
||||||
MV_Voices = (VoiceNode *)ptr;
|
MV_Voices = (VoiceNode *)ptr;
|
||||||
ptr += Voices * sizeof(VoiceNode);
|
ptr += Voices * sizeof(VoiceNode);
|
||||||
|
|
||||||
// Set number of voices before calculating volume table
|
|
||||||
MV_MaxVoices = Voices;
|
MV_MaxVoices = Voices;
|
||||||
|
|
||||||
LL_Reset((VoiceNode*) &VoiceList, next, prev);
|
LL_Reset((VoiceNode*) &VoiceList, next, prev);
|
||||||
LL_Reset((VoiceNode*) &VoicePool, next, prev);
|
LL_Reset((VoiceNode*) &VoicePool, next, prev);
|
||||||
|
|
||||||
for (int index = 0; index < Voices; index++)
|
for (int index = 0; index < Voices; index++)
|
||||||
{
|
|
||||||
LL_Add((VoiceNode*) &VoicePool, &MV_Voices[ index ], next, prev);
|
LL_Add((VoiceNode*) &VoicePool, &MV_Voices[ index ], next, prev);
|
||||||
}
|
|
||||||
|
|
||||||
MV_SetReverseStereo(FALSE);
|
MV_SetReverseStereo(FALSE);
|
||||||
|
|
||||||
|
|
|
@ -381,7 +381,7 @@ int32_t MV_PlayVorbis(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t
|
||||||
|
|
||||||
if (!vd)
|
if (!vd)
|
||||||
{
|
{
|
||||||
MV_SetErrorCode(MV_InvalidVorbisFile);
|
MV_SetErrorCode(MV_InvalidFile);
|
||||||
return MV_Error;
|
return MV_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +395,7 @@ int32_t MV_PlayVorbis(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
{
|
{
|
||||||
MV_Printf("MV_PlayVorbis: err %d\n", status);
|
MV_Printf("MV_PlayVorbis: err %d\n", status);
|
||||||
MV_SetErrorCode(MV_InvalidVorbisFile);
|
MV_SetErrorCode(MV_InvalidFile);
|
||||||
return MV_Error;
|
return MV_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,7 +405,7 @@ int32_t MV_PlayVorbis(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t
|
||||||
{
|
{
|
||||||
ov_clear(&vd->vf);
|
ov_clear(&vd->vf);
|
||||||
free(vd);
|
free(vd);
|
||||||
MV_SetErrorCode(MV_InvalidVorbisFile);
|
MV_SetErrorCode(MV_InvalidFile);
|
||||||
return MV_Error;
|
return MV_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ int32_t MV_PlayVorbis(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t
|
||||||
{
|
{
|
||||||
ov_clear(&vd->vf);
|
ov_clear(&vd->vf);
|
||||||
free(vd);
|
free(vd);
|
||||||
MV_SetErrorCode(MV_InvalidVorbisFile);
|
MV_SetErrorCode(MV_InvalidFile);
|
||||||
return MV_Error;
|
return MV_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -460,7 +460,7 @@ int32_t MV_PlayXA
|
||||||
|
|
||||||
xad = (xa_data *) calloc( 1, sizeof(xa_data) );
|
xad = (xa_data *) calloc( 1, sizeof(xa_data) );
|
||||||
if (!xad) {
|
if (!xad) {
|
||||||
MV_SetErrorCode( MV_InvalidXAFile );
|
MV_SetErrorCode( MV_InvalidFile );
|
||||||
return MV_Error;
|
return MV_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ void S_SoundStartup(void)
|
||||||
|
|
||||||
initprintf("Initializing sound... ");
|
initprintf("Initializing sound... ");
|
||||||
|
|
||||||
if (FX_Init(ASS_AutoDetect, ud.config.NumVoices, ud.config.NumChannels, ud.config.MixRate, initdata) != FX_Ok)
|
if (FX_Init(ud.config.NumVoices, ud.config.NumChannels, ud.config.MixRate, initdata) != FX_Ok)
|
||||||
{
|
{
|
||||||
initprintf("failed! %s\n", FX_ErrorString(FX_Error));
|
initprintf("failed! %s\n", FX_ErrorString(FX_Error));
|
||||||
return;
|
return;
|
||||||
|
@ -235,7 +235,7 @@ int32_t S_PlayMusic(const char *fn)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int32_t const mvol = MASTER_VOLUME(ud.config.MusicVolume);
|
int32_t const mvol = MASTER_VOLUME(ud.config.MusicVolume);
|
||||||
MusicVoice = FX_PlayLooped(MusicPtr, MusicLen, 0, 0,
|
MusicVoice = FX_Play(MusicPtr, MusicLen, 0, 0,
|
||||||
0, mvol, mvol, mvol,
|
0, mvol, mvol, mvol,
|
||||||
FX_MUSIC_PRIORITY, MUSIC_ID);
|
FX_MUSIC_PRIORITY, MUSIC_ID);
|
||||||
if (MusicVoice > FX_Ok)
|
if (MusicVoice > FX_Ok)
|
||||||
|
@ -630,7 +630,7 @@ int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos)
|
||||||
|
|
||||||
if (repeatp && !ambsfxp)
|
if (repeatp && !ambsfxp)
|
||||||
{
|
{
|
||||||
voice = FX_PlayLooped(g_sounds[num].ptr, g_sounds[num].soundsiz, 0, -1,
|
voice = FX_Play(g_sounds[num].ptr, g_sounds[num].soundsiz, 0, -1,
|
||||||
pitch, FX_VOLUME(sndist>>6), FX_VOLUME(sndist>>6), 0, // XXX: why is 'right' 0?
|
pitch, FX_VOLUME(sndist>>6), FX_VOLUME(sndist>>6), 0, // XXX: why is 'right' 0?
|
||||||
g_sounds[num].pr, (num * MAXSOUNDINSTANCES) + j);
|
g_sounds[num].pr, (num * MAXSOUNDINSTANCES) + j);
|
||||||
}
|
}
|
||||||
|
@ -703,7 +703,7 @@ int32_t S_PlaySound(int32_t num)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_sounds[num].m & SF_LOOP)
|
if (g_sounds[num].m & SF_LOOP)
|
||||||
voice = FX_PlayLooped(g_sounds[num].ptr, g_sounds[num].soundsiz, 0, -1,
|
voice = FX_Play(g_sounds[num].ptr, g_sounds[num].soundsiz, 0, -1,
|
||||||
pitch,FX_VOLUME(LOUDESTVOLUME), FX_VOLUME(LOUDESTVOLUME), FX_VOLUME(LOUDESTVOLUME),
|
pitch,FX_VOLUME(LOUDESTVOLUME), FX_VOLUME(LOUDESTVOLUME), FX_VOLUME(LOUDESTVOLUME),
|
||||||
g_sounds[num].soundsiz, (num * MAXSOUNDINSTANCES) + j);
|
g_sounds[num].soundsiz, (num * MAXSOUNDINSTANCES) + j);
|
||||||
else
|
else
|
||||||
|
|
|
@ -73,19 +73,16 @@ void S_Callback(uint32_t);
|
||||||
int32_t S_SoundStartup(void)
|
int32_t S_SoundStartup(void)
|
||||||
{
|
{
|
||||||
int32_t status;
|
int32_t status;
|
||||||
int32_t fxdevicetype;
|
|
||||||
void *initdata = 0;
|
void *initdata = 0;
|
||||||
|
|
||||||
// TODO: read config
|
// TODO: read config
|
||||||
int32_t FXVolume=220, /*NumVoices=32,*/ NumChannels=2, ReverseStereo=0;
|
int32_t FXVolume=220, /*NumVoices=32,*/ NumChannels=2, ReverseStereo=0;
|
||||||
|
|
||||||
fxdevicetype = ASS_AutoDetect;
|
|
||||||
|
|
||||||
#ifdef MIXERTYPEWIN
|
#ifdef MIXERTYPEWIN
|
||||||
initdata = (void *) win_gethwnd(); // used for DirectSound
|
initdata = (void *) win_gethwnd(); // used for DirectSound
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
status = FX_Init(fxdevicetype, NumVoices, NumChannels, MixRate, initdata);
|
status = FX_Init(NumVoices, NumChannels, MixRate, initdata);
|
||||||
if (status == FX_Ok)
|
if (status == FX_Ok)
|
||||||
{
|
{
|
||||||
FX_SetVolume(FXVolume);
|
FX_SetVolume(FXVolume);
|
||||||
|
@ -260,7 +257,7 @@ int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos)
|
||||||
if (g_sounds[num].num > 0)
|
if (g_sounds[num].num > 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
voice = FX_PlayLooped(g_sounds[num].ptr, g_sounds[num].soundsiz, 0, -1,
|
voice = FX_Play(g_sounds[num].ptr, g_sounds[num].soundsiz, 0, -1,
|
||||||
pitch, sndist>>6, sndist>>6, 0, g_sounds[num].pr, num);
|
pitch, sndist>>6, sndist>>6, 0, g_sounds[num].pr, num);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -319,7 +316,7 @@ void S_PlaySound(int32_t num)
|
||||||
|
|
||||||
if (g_sounds[num].m & SF_LOOP)
|
if (g_sounds[num].m & SF_LOOP)
|
||||||
{
|
{
|
||||||
voice = FX_PlayLooped(g_sounds[num].ptr, g_sounds[num].soundsiz, 0, -1,
|
voice = FX_Play(g_sounds[num].ptr, g_sounds[num].soundsiz, 0, -1,
|
||||||
pitch,LOUDESTVOLUME,LOUDESTVOLUME,LOUDESTVOLUME,g_sounds[num].soundsiz,num);
|
pitch,LOUDESTVOLUME,LOUDESTVOLUME,LOUDESTVOLUME,g_sounds[num].soundsiz,num);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue