mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-25 03:41:02 +00:00
Merge branch 'sound-handle-fix' into 'master'
Handle fix for SDL Mixer See merge request STJr/SRB2!301
This commit is contained in:
commit
423403eab5
12 changed files with 25 additions and 15 deletions
|
@ -21,13 +21,14 @@ void I_ShutdownSound(void){}
|
|||
// SFX I/O
|
||||
//
|
||||
|
||||
INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority)
|
||||
INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority, INT32 channel)
|
||||
{
|
||||
(void)id;
|
||||
(void)vol;
|
||||
(void)sep;
|
||||
(void)pitch;
|
||||
(void)priority;
|
||||
(void)channel;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -165,9 +165,11 @@ INT32 I_StartSound ( sfxenum_t id,
|
|||
INT32 vol,
|
||||
INT32 sep,
|
||||
INT32 pitch,
|
||||
INT32 priority )
|
||||
INT32 priority,
|
||||
INT32 channel)
|
||||
{
|
||||
int voice;
|
||||
(void)channel;
|
||||
|
||||
if (nosound)
|
||||
return 0;
|
||||
|
|
|
@ -23,13 +23,14 @@ void I_UpdateSound(void){};
|
|||
// SFX I/O
|
||||
//
|
||||
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority)
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
|
||||
{
|
||||
(void)id;
|
||||
(void)vol;
|
||||
(void)sep;
|
||||
(void)pitch;
|
||||
(void)priority;
|
||||
(void)channel;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ void I_ShutdownSound(void);
|
|||
|
||||
\return sfx handle
|
||||
*/
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority);
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel);
|
||||
|
||||
/** \brief Stops a sound channel.
|
||||
|
||||
|
|
|
@ -21,13 +21,14 @@ void I_ShutdownSound(void){}
|
|||
// SFX I/O
|
||||
//
|
||||
|
||||
INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority)
|
||||
INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority, INT32 channel)
|
||||
{
|
||||
(void)id;
|
||||
(void)vol;
|
||||
(void)sep;
|
||||
(void)pitch;
|
||||
(void)priority;
|
||||
(void)channel;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -529,7 +529,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
|
|||
|
||||
// Assigns the handle to one of the channels in the
|
||||
// mix/output buffer.
|
||||
channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority);
|
||||
channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority, cnum);
|
||||
}
|
||||
|
||||
dontplay:
|
||||
|
@ -579,7 +579,7 @@ dontplay:
|
|||
|
||||
// Assigns the handle to one of the channels in the
|
||||
// mix/output buffer.
|
||||
channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority);
|
||||
channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority, cnum);
|
||||
}
|
||||
|
||||
void S_StartSound(const void *origin, sfxenum_t sfx_id)
|
||||
|
|
|
@ -419,10 +419,10 @@ void I_FreeSfx(sfxinfo_t *sfx)
|
|||
sfx->lumpnum = LUMPERROR;
|
||||
}
|
||||
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority)
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
|
||||
{
|
||||
UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127
|
||||
INT32 handle = Mix_PlayChannel(-1, S_sfx[id].data, 0);
|
||||
INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0);
|
||||
Mix_Volume(handle, volume);
|
||||
Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff));
|
||||
(void)pitch; // Mixer can't handle pitch
|
||||
|
|
|
@ -604,10 +604,11 @@ void I_FreeSfx(sfxinfo_t * sfx)
|
|||
// Pitching (that is, increased speed of playback)
|
||||
// is set, but currently not used by mixing.
|
||||
//
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority)
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
|
||||
{
|
||||
(void)priority;
|
||||
(void)pitch;
|
||||
(void)channel;
|
||||
|
||||
if (nosound)
|
||||
return 0;
|
||||
|
|
|
@ -376,10 +376,10 @@ void I_FreeSfx(sfxinfo_t *sfx)
|
|||
sfx->data = NULL;
|
||||
}
|
||||
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority)
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
|
||||
{
|
||||
UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127
|
||||
INT32 handle = Mix_PlayChannel(-1, S_sfx[id].data, 0);
|
||||
INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0);
|
||||
Mix_Volume(handle, volume);
|
||||
Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff));
|
||||
(void)pitch; // Mixer can't handle pitch
|
||||
|
|
|
@ -621,10 +621,11 @@ void I_FreeSfx(sfxinfo_t * sfx)
|
|||
// Pitching (that is, increased speed of playback)
|
||||
// is set, but currently not used by mixing.
|
||||
//
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority)
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
|
||||
{
|
||||
(void)priority;
|
||||
(void)pitch;
|
||||
(void)channel;
|
||||
|
||||
if (nosound)
|
||||
return 0;
|
||||
|
|
|
@ -353,12 +353,13 @@ void I_FreeSfx(sfxinfo_t *sfx)
|
|||
sfx->data = NULL;
|
||||
}
|
||||
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority)
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
|
||||
{
|
||||
FMOD_SOUND *sound;
|
||||
FMOD_CHANNEL *chan;
|
||||
INT32 i;
|
||||
float frequency;
|
||||
(void)channel;
|
||||
|
||||
sound = (FMOD_SOUND *)S_sfx[id].data;
|
||||
I_Assert(sound != NULL);
|
||||
|
|
|
@ -538,7 +538,8 @@ INT32 I_StartSound (sfxenum_t id,
|
|||
INT32 vol,
|
||||
INT32 sep,
|
||||
INT32 pitch,
|
||||
INT32 priority)
|
||||
INT32 priority,
|
||||
INT32 channel)
|
||||
{
|
||||
HRESULT hr;
|
||||
LPDIRECTSOUNDBUFFER dsbuffer;
|
||||
|
@ -549,6 +550,7 @@ INT32 I_StartSound (sfxenum_t id,
|
|||
#ifdef SURROUND
|
||||
LPDIRECTSOUNDBUFFER dssurround;
|
||||
#endif
|
||||
(void)channel;
|
||||
|
||||
if (nosound)
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue