r854 - trunk/code/client
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat Aug 19 09:44:10 EDT 2006
Author: thilo
Date: 2006-08-19 09:44:10 -0400 (Sat, 19 Aug 2006)
New Revision: 854
Modified:
trunk/code/client/snd_main.c
trunk/code/client/snd_openal.c
Log:
- tweak enumeration support, remove win32 dependency
- fix two typos in status message in snd_main.c
Modified: trunk/code/client/snd_main.c
===================================================================
--- trunk/code/client/snd_main.c 2006-08-19 11:02:20 UTC (rev 853)
+++ trunk/code/client/snd_main.c 2006-08-19 13:44:10 UTC (rev 854)
@@ -404,9 +404,9 @@
}
S_SoundInfo( );
- Com_Printf( "Sound intialization successful.\n" );
+ Com_Printf( "Sound initialization successful.\n" );
} else {
- Com_Printf( "Sound intialization failed.\n" );
+ Com_Printf( "Sound initialization failed.\n" );
}
}
Modified: trunk/code/client/snd_openal.c
===================================================================
--- trunk/code/client/snd_openal.c 2006-08-19 11:02:20 UTC (rev 853)
+++ trunk/code/client/snd_openal.c 2006-08-19 13:44:10 UTC (rev 854)
@@ -38,10 +38,8 @@
cvar_t *s_alMinDistance;
cvar_t *s_alRolloff;
cvar_t *s_alDriver;
-#ifdef _WIN32
cvar_t *s_alDevice;
cvar_t *s_alAvailableDevices;
-#endif
cvar_t *s_alMaxSpeakerDistance;
/*
@@ -1677,10 +1675,8 @@
Com_Printf( " Vendor: %s\n", qalGetString( AL_VENDOR ) );
Com_Printf( " Version: %s\n", qalGetString( AL_VERSION ) );
Com_Printf( " Renderer: %s\n", qalGetString( AL_RENDERER ) );
-#ifdef _WIN32
if(qalcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT"))
Com_Printf( " Device: %s\n", qalcGetString(alDevice, ALC_DEVICE_SPECIFIER) );
-#endif
Com_Printf( " Extensions: %s\n", qalGetString( AL_EXTENSIONS ) );
}
@@ -1723,9 +1719,7 @@
{
#if USE_OPENAL
-#ifdef _WIN32
qboolean enumsupport, founddev = qfalse;
-#endif
if( !si ) {
return qfalse;
@@ -1750,11 +1744,10 @@
return qfalse;
}
-#ifdef _WIN32
- // Device enumeration support on windows.
+ // Device enumeration support (extension currently only exists for windows).
if((enumsupport = qalcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT")))
{
- char *devicelist, devicenames[8192] = "";
+ char *devicelist, devicenames[1024] = "";
char *defaultdevice;
int curlen;
qboolean hasbegun = qfalse;
@@ -1763,6 +1756,7 @@
devicelist = qalcGetString(NULL, ALC_DEVICE_SPECIFIER);
defaultdevice = qalcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
+#ifdef _WIN32
// check whether the default device is generic hardware. If it is, change to
// Generic Software as that one works more reliably with various sound systems.
// If it's not, use OpenAL's default selection as we don't want to ignore
@@ -1770,6 +1764,7 @@
if(!strcmp(defaultdevice, "Generic Hardware"))
s_alDevice = Cvar_Get("s_alDevice", ALDEVICE_DEFAULT, CVAR_ARCHIVE | CVAR_LATCH);
else
+#endif
s_alDevice = Cvar_Get("s_alDevice", defaultdevice, CVAR_ARCHIVE | CVAR_LATCH);
// dump a list of available devices to a cvar for the user to see.
@@ -1785,7 +1780,6 @@
if(!strcmp(s_alDevice->string, devicelist))
founddev = qtrue;
- s_alDevice->string;
devicelist += curlen + 1;
}
@@ -1802,12 +1796,7 @@
alDevice = qalcOpenDevice(s_alDevice->string);
else
alDevice = qalcOpenDevice(NULL);
-#else // _WIN32
- // Open default device
- alDevice = qalcOpenDevice( NULL );
-#endif
-
if( !alDevice )
{
QAL_Shutdown( );
@@ -1815,10 +1804,8 @@
return qfalse;
}
-#ifdef _WIN32
if(enumsupport)
Cvar_Set("s_alDevice", qalcGetString(alDevice, ALC_DEVICE_SPECIFIER));
-#endif
// Create OpenAL context
alContext = qalcCreateContext( alDevice, NULL );
More information about the quake3-commits
mailing list