Improved XTra.KrazzY's Mute-On-Pause a bit, so it won't cost any CPU time when it is not used.

Revert old Zelda-TP hack, though it really shouldn't be there...



git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4684 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx
2009-12-12 22:30:53 +00:00
parent 7be17e6531
commit fad1fa4e3d
12 changed files with 48 additions and 64 deletions

View File

@ -17,12 +17,15 @@
#include "aldlist.h"
#include "OpenALStream.h"
#include "../../../PluginSpecs/pluginspecs_dsp.h"
#if defined HAVE_OPENAL && HAVE_OPENAL
#define AUDIO_NUMBUFFERS (4)
//#define AUDIO_SERVICE_UPDATE_PERIOD (20)
extern DSPInitialize g_dspInitialize;
bool OpenALStream::Start()
{
ALDeviceList *pDeviceList = NULL;
@ -96,9 +99,14 @@ void OpenALStream::Update()
void OpenALStream::Clear()
{
memset(realtimeBuffer, 0, sizeof(realtimeBuffer));
Update();
if(!*g_dspInitialize.pEmulatorState)
{
alSourcePlay(g_uiSource);
}
else
{
alSourceStop(g_uiSource);
}
}
THREAD_RETURN OpenALStream::ThreadFunc(void* args)
@ -178,17 +186,5 @@ void OpenALStream::SoundLoop()
}
void OpenALStream::Mute(bool bMute) {
if((bMute && g_muted) || (!bMute && !g_muted))
return;
if(bMute && g_uiSource)
alSourceStop(g_uiSource);
else if(g_uiSource)
alSourcePlay(g_uiSource);
g_muted = bMute;
}
#endif //HAVE_OPENAL