mirror of
https://github.com/id-Software/Wolf3D-iOS.git
synced 2026-03-20 00:49:35 +01:00
Source release of Wolfenstein 3D Classic Platinum for iOS, 2.1
This commit is contained in:
13
wolf3d/code/env/openal_main.c
vendored
13
wolf3d/code/env/openal_main.c
vendored
@@ -76,12 +76,16 @@ W16 numSoundDevices, numDefaultSoundDevice;
|
||||
PRIVATE void Sound_Device_getDeviceList( void )
|
||||
{
|
||||
char deviceName[ 256 ];
|
||||
|
||||
ALboolean isExtensionPresent = AL_FALSE;
|
||||
|
||||
my_strlcpy( deviceName, s_device->string, sizeof( deviceName ) );
|
||||
if( pfalcIsExtensionPresent( NULL, (ALubyte*)"ALC_ENUMERATION_EXT") == AL_TRUE )
|
||||
isExtensionPresent = pfalcIsExtensionPresent( NULL, (ALubyte*)"ALC_ENUMERATION_EXT");
|
||||
ALC_CheckErrors();
|
||||
if( isExtensionPresent == AL_TRUE )
|
||||
{
|
||||
// try out enumeration extension
|
||||
deviceList = (char *)pfalcGetString( NULL, ALC_DEVICE_SPECIFIER );
|
||||
ALC_CheckErrors();
|
||||
for( numSoundDevices = 0 ; numSoundDevices < 12 ; ++numSoundDevices )
|
||||
{
|
||||
sound_devices[ numSoundDevices ] = NULL;
|
||||
@@ -200,12 +204,14 @@ failed:
|
||||
if( Context )
|
||||
{
|
||||
pfalcDestroyContext( Context );
|
||||
ALC_CheckErrors();
|
||||
Context = NULL;
|
||||
}
|
||||
|
||||
if( Device )
|
||||
{
|
||||
pfalcCloseDevice( Device );
|
||||
ALC_CheckErrors();
|
||||
Device = NULL;
|
||||
}
|
||||
|
||||
@@ -230,7 +236,9 @@ PUBLIC void Sound_Device_Shutdown( void )
|
||||
if( Context )
|
||||
{
|
||||
pfalcMakeContextCurrent( NULL );
|
||||
ALC_CheckErrors();
|
||||
pfalcDestroyContext( Context );
|
||||
ALC_CheckErrors();
|
||||
|
||||
Context = NULL;
|
||||
}
|
||||
@@ -238,6 +246,7 @@ PUBLIC void Sound_Device_Shutdown( void )
|
||||
if( Device )
|
||||
{
|
||||
pfalcCloseDevice( Device );
|
||||
ALC_CheckErrors();
|
||||
|
||||
Device = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user