Refactor : remove and rename certain globals

This commit is contained in:
Aaron Culliney 2015-06-13 13:21:24 -07:00
parent 4d0ca2b6e3
commit 93a578d40a
3 changed files with 9 additions and 16 deletions

View File

@ -1371,7 +1371,7 @@ static bool MB_DSInit()
unsigned long dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer
int16_t* pDSLockedBuffer;
if(!g_bDSAvailable)
if(!soundcore_isAvailable)
return false;
int hr = DSGetSoundBuffer(&MockingboardVoice, DSBCAPS_CTRLVOLUME, g_dwDSBufferSize, SAMPLE_RATE, 2);
@ -1672,8 +1672,7 @@ void MB_Initialize()
#ifdef APPLE2IX
memset(SSI263Voice, 0x0, sizeof(VOICE)*MAX_VOICES);
#endif
LOG("MB_Initialize: g_bDisableDirectSound=%d, g_bDisableDirectSoundMockingboard=%d\n", g_bDisableDirectSound, g_bDisableDirectSoundMockingboard);
if (g_bDisableDirectSound || g_bDisableDirectSoundMockingboard)
if (g_bDisableDirectSoundMockingboard)
{
MockingboardVoice.bMute = true;
g_SoundcardType = CT_Empty;
@ -1758,7 +1757,7 @@ static void ResetState()
void MB_Reset()
{
if(!g_bDSAvailable)
if(!soundcore_isAvailable)
return;
for(int i=0; i<NUM_AY8910; i++)

View File

@ -50,9 +50,7 @@ static VOICE* g_pSpeakerVoice = NULL;
//-------------------------------------
bool g_bDSAvailable = false;
bool g_bDisableDirectSound = false;
bool soundcore_isAvailable = false;
//-----------------------------------------------------------------------------
@ -241,7 +239,7 @@ static void _destroy_enumerated_sound_devices(void) {
bool DSInit()
{
if(g_bDSAvailable)
if(soundcore_isAvailable)
{
g_uDSInitRefCount++;
return true; // Already initialised successfully
@ -280,7 +278,7 @@ bool DSInit()
return false;
}
g_bDSAvailable = true;
soundcore_isAvailable = true;
g_uDSInitRefCount = 1;
@ -293,7 +291,7 @@ void DSUninit()
{
_destroy_enumerated_sound_devices();
if(!g_bDSAvailable)
if(!soundcore_isAvailable)
return;
assert(g_uDSInitRefCount);
@ -311,7 +309,7 @@ void DSUninit()
assert(g_uNumVoices == 0);
SoundSystemDestroy((SoundSystemStruct**)&g_lpDS);
g_bDSAvailable = false;
soundcore_isAvailable = false;
}
//=============================================================================

View File

@ -21,8 +21,6 @@
#define MAX_SAMPLES (8*1024)
extern bool g_bDisableDirectSound;
typedef struct
{
LPDIRECTSOUNDBUFFER lpDSBvoice;
@ -62,9 +60,7 @@ void SoundCore_SetErrorMax(const int nErrorMax);
bool DSInit();
void DSUninit();
//
extern bool g_bDSAvailable;
extern bool soundcore_isAvailable;
#ifdef APPLE2IX
typedef struct IDirectSound SoundSystemStruct;