remove RageSoundManager::MixAudio
This commit is contained in:
@@ -172,30 +172,6 @@ void RageSoundManager::PlayOnceFromDir( CString sDir )
|
|||||||
|
|
||||||
/* Standalone helpers: */
|
/* Standalone helpers: */
|
||||||
|
|
||||||
/* Mix audio. This is from SDL, but doesn't depend on the sound being
|
|
||||||
* initialized. */
|
|
||||||
void RageSoundManager::MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume)
|
|
||||||
{
|
|
||||||
if ( volume == 0 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
int factor = int(volume * 256);
|
|
||||||
len /= 2;
|
|
||||||
while ( len-- ) {
|
|
||||||
Sint16 src1 = *src;
|
|
||||||
src1 = Sint16((src1*factor)/256);
|
|
||||||
Sint16 src2 = *dst;
|
|
||||||
|
|
||||||
int dst_sample = src1+src2;
|
|
||||||
dst_sample = clamp(dst_sample, -32768, 32767);
|
|
||||||
*dst = Sint16(dst_sample);
|
|
||||||
|
|
||||||
src++;
|
|
||||||
dst++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RageSoundManager::SetPrefs(float MixVol)
|
void RageSoundManager::SetPrefs(float MixVol)
|
||||||
{
|
{
|
||||||
MixVolume = MixVol;
|
MixVolume = MixVol;
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ public:
|
|||||||
set<RageSound *> playing_sounds;
|
set<RageSound *> playing_sounds;
|
||||||
void GetCopies(RageSound &snd, vector<RageSound *> &snds);
|
void GetCopies(RageSound &snd, vector<RageSound *> &snds);
|
||||||
|
|
||||||
static void MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume);
|
|
||||||
static void AttenuateBuf( Sint16 *buf, int samples, float vol );
|
static void AttenuateBuf( Sint16 *buf, int samples, float vol );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user