mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-25 04:41:15 +00:00
SW: Fix audiolib bindings, again.
git-svn-id: https://svn.eduke32.com/eduke32@6050 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
4faab2beb8
commit
382404f813
1 changed files with 14 additions and 38 deletions
|
@ -472,7 +472,7 @@ PlaySong(char *song_file_name, int cdaudio_track, SWBOOL loop, SWBOOL restart)
|
||||||
|
|
||||||
if (LoadSong(waveformtrack))
|
if (LoadSong(waveformtrack))
|
||||||
{
|
{
|
||||||
SongVoice = FX_PlayLoopedAuto(SongPtr, SongLength, 0, 0, 0,
|
SongVoice = FX_Play(SongPtr, SongLength, 0, 0, 0,
|
||||||
255, 255, 255, FX_MUSIC_PRIORITY, MUSIC_ID);
|
255, 255, 255, FX_MUSIC_PRIORITY, MUSIC_ID);
|
||||||
if (SongVoice > FX_Ok)
|
if (SongVoice > FX_Ok)
|
||||||
{
|
{
|
||||||
|
@ -508,7 +508,7 @@ PlaySong(char *song_file_name, int cdaudio_track, SWBOOL loop, SWBOOL restart)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SongVoice = FX_PlayLoopedAuto(SongPtr, SongLength, 0, 0, 0,
|
SongVoice = FX_Play(SongPtr, SongLength, 0, 0, 0,
|
||||||
255, 255, 255, FX_MUSIC_PRIORITY, MUSIC_ID);
|
255, 255, 255, FX_MUSIC_PRIORITY, MUSIC_ID);
|
||||||
if (SongVoice > FX_Ok)
|
if (SongVoice > FX_Ok)
|
||||||
{
|
{
|
||||||
|
@ -1020,7 +1020,7 @@ PlaySound(int num, int *x, int *y, int *z, Voc3D_Flags flags)
|
||||||
|
|
||||||
if (sound_dist < 255 || (flags & v3df_init))
|
if (sound_dist < 255 || (flags & v3df_init))
|
||||||
{
|
{
|
||||||
voice = FX_PlayLoopedAuto((char *)vp->data, vp->datalen, 0, 0,
|
voice = FX_Play((char *)vp->data, vp->datalen, 0, 0,
|
||||||
pitch, loopvol, loopvol, loopvol, priority, num);
|
pitch, loopvol, loopvol, loopvol, priority, num);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1031,13 +1031,13 @@ PlaySound(int num, int *x, int *y, int *z, Voc3D_Flags flags)
|
||||||
//if(!flags & v3df_init) // If not initing sound, play it
|
//if(!flags & v3df_init) // If not initing sound, play it
|
||||||
if (tx==0 && ty==0 && tz==0) // It's a non-inlevel sound
|
if (tx==0 && ty==0 && tz==0) // It's a non-inlevel sound
|
||||||
{
|
{
|
||||||
voice = FX_PlayAuto((char *)vp->data, vp->datalen, pitch, 255, 255, 255, priority, num);
|
voice = FX_Play((char *)vp->data, vp->datalen, -1, -1, pitch, 255, 255, 255, priority, num);
|
||||||
}
|
}
|
||||||
else // It's a 3d sound
|
else // It's a 3d sound
|
||||||
{
|
{
|
||||||
if (sound_dist < 255)
|
if (sound_dist < 255)
|
||||||
{
|
{
|
||||||
voice = FX_PlayAuto3D((char *)vp->data, vp->datalen, FX_ONESHOT, pitch, angle, sound_dist, priority, num);
|
voice = FX_Play3D((char *)vp->data, vp->datalen, FX_ONESHOT, pitch, angle, sound_dist, priority, num);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
voice = -1;
|
voice = -1;
|
||||||
|
@ -1076,7 +1076,7 @@ void PlaySoundRTS(int rts_num)
|
||||||
|
|
||||||
ASSERT(rtsptr);
|
ASSERT(rtsptr);
|
||||||
|
|
||||||
voice = FX_PlayAuto3D(rtsptr, RTS_SoundLength(rts_num - 1), FX_ONESHOT, 0, 0, 0, 255, -rts_num);
|
voice = FX_Play3D(rtsptr, RTS_SoundLength(rts_num - 1), FX_ONESHOT, 0, 0, 0, 255, -rts_num);
|
||||||
|
|
||||||
if (voice <= FX_Ok)
|
if (voice <= FX_Ok)
|
||||||
{
|
{
|
||||||
|
@ -1165,7 +1165,6 @@ SoundStartup(void)
|
||||||
{
|
{
|
||||||
int32_t status;
|
int32_t status;
|
||||||
void *initdata = 0;
|
void *initdata = 0;
|
||||||
int fxdevicetype;
|
|
||||||
|
|
||||||
// if they chose None lets return
|
// if they chose None lets return
|
||||||
if (FXDevice < 0)
|
if (FXDevice < 0)
|
||||||
|
@ -1173,14 +1172,6 @@ SoundStartup(void)
|
||||||
gs.FxOn = FALSE;
|
gs.FxOn = FALSE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (FXDevice == 0)
|
|
||||||
{
|
|
||||||
fxdevicetype = ASS_AutoDetect;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fxdevicetype = FXDevice - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MIXERTYPEWIN
|
#ifdef MIXERTYPEWIN
|
||||||
initdata = (void *) win_gethwnd();
|
initdata = (void *) win_gethwnd();
|
||||||
|
@ -1188,7 +1179,7 @@ SoundStartup(void)
|
||||||
|
|
||||||
//gs.FxOn = TRUE;
|
//gs.FxOn = TRUE;
|
||||||
|
|
||||||
status = FX_Init(fxdevicetype, NumVoices, NumChannels, NumBits, MixRate, initdata);
|
status = FX_Init(NumVoices, NumChannels, MixRate, initdata);
|
||||||
if (status == FX_Ok)
|
if (status == FX_Ok)
|
||||||
{
|
{
|
||||||
FxInitialized = TRUE;
|
FxInitialized = TRUE;
|
||||||
|
@ -1202,13 +1193,7 @@ SoundStartup(void)
|
||||||
buildprintf("Sound error: %s\n",FX_ErrorString(FX_Error));
|
buildprintf("Sound error: %s\n",FX_ErrorString(FX_Error));
|
||||||
}
|
}
|
||||||
|
|
||||||
status = FX_SetCallBack(SoundCallBack);
|
FX_SetCallBack(SoundCallBack);
|
||||||
|
|
||||||
if (status != FX_Ok)
|
|
||||||
{
|
|
||||||
buildprintf("Sound error: %s\n",FX_ErrorString(FX_Error));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1249,6 +1234,7 @@ SoundShutdown(void)
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if 0
|
||||||
void loadtmb(void)
|
void loadtmb(void)
|
||||||
{
|
{
|
||||||
char tmb[8000];
|
char tmb[8000];
|
||||||
|
@ -1258,35 +1244,23 @@ void loadtmb(void)
|
||||||
if (fil == -1)
|
if (fil == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
l = min(kfilelength(fil), sizeof(tmb));
|
l = min((size_t)kfilelength(fil), sizeof(tmb));
|
||||||
kread(fil,tmb,l);
|
kread(fil,tmb,l);
|
||||||
MUSIC_RegisterTimbreBank(tmb);
|
MUSIC_RegisterTimbreBank(tmb);
|
||||||
kclose(fil);
|
kclose(fil);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void MusicStartup(void)
|
void MusicStartup(void)
|
||||||
{
|
{
|
||||||
int32_t status;
|
|
||||||
int devicetype;
|
|
||||||
|
|
||||||
// if they chose None lets return
|
// if they chose None lets return
|
||||||
if (MusicDevice < 0)
|
if (MusicDevice < 0)
|
||||||
{
|
{
|
||||||
gs.MusicOn = FALSE;
|
gs.MusicOn = FALSE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (MusicDevice == 0)
|
|
||||||
{
|
|
||||||
devicetype = ASS_AutoDetect;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
devicetype = MusicDevice - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = MUSIC_Init(devicetype, 0);
|
if (MUSIC_Init(0, 0) == MUSIC_Ok || MUSIC_Init(1, 0) == MUSIC_Ok)
|
||||||
|
|
||||||
if (status == MUSIC_Ok)
|
|
||||||
{
|
{
|
||||||
MusicInitialized = TRUE;
|
MusicInitialized = TRUE;
|
||||||
MUSIC_SetVolume(gs.MusicVolume);
|
MUSIC_SetVolume(gs.MusicVolume);
|
||||||
|
@ -1297,8 +1271,10 @@ void MusicStartup(void)
|
||||||
gs.MusicOn = FALSE;
|
gs.MusicOn = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (MusicInitialized)
|
if (MusicInitialized)
|
||||||
loadtmb();
|
loadtmb();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void COVER_SetReverb(int amt)
|
void COVER_SetReverb(int amt)
|
||||||
|
|
Loading…
Reference in a new issue