mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-19 14:53:56 -07:00
sound code: now uses DX5 (instead of default of DX8), more error checking vs. bug #33
This was SVN commit r1371.
This commit is contained in:
parent
b99699cacc
commit
bfd2a43dfb
1 changed files with 18 additions and 14 deletions
|
|
@ -250,6 +250,8 @@ int win_get_gfx_info()
|
|||
#define MMNOMMIO // Multimedia file I/O support
|
||||
#define MMNOMMSYSTEM // General MMSYSTEM functions
|
||||
#include <MMSystem.h>
|
||||
|
||||
#define DIRECTSOUND_VERSION 0x0500
|
||||
#include <dsound.h>
|
||||
|
||||
|
||||
|
|
@ -297,28 +299,30 @@ static void add_drv(const char* module)
|
|||
|
||||
int win_get_snd_info()
|
||||
{
|
||||
DirectSoundEnumerate((LPDSENUMCALLBACK)ds_enum, (void*)0);
|
||||
if(DirectSoundEnumerate((LPDSENUMCALLBACK)ds_enum, (void*)0) != DS_OK)
|
||||
debug_warn("DirectSoundEnumerate failed");
|
||||
|
||||
// find all DLLs related to OpenAL and retrieve their versions.
|
||||
// (search system dir for *oal.dll and *OpenAL*,
|
||||
// which is also how the router finds implementations).
|
||||
add_drv(ds_drv_name);
|
||||
DIR* dir = opendir(win_sys_dir);
|
||||
if(dir)
|
||||
if(!dir)
|
||||
{
|
||||
while(dirent* ent = readdir(dir))
|
||||
{
|
||||
const char* fn = ent->d_name;
|
||||
const size_t len = strlen(fn);
|
||||
|
||||
const bool oal = len > 7 && !stricmp(fn+len-7, "oal.dll");
|
||||
const bool openal = strstr(fn, "OpenAL") != 0;
|
||||
if(oal || openal)
|
||||
add_drv(fn);
|
||||
}
|
||||
|
||||
closedir(dir);
|
||||
assert(0);
|
||||
return -1;
|
||||
}
|
||||
while(dirent* ent = readdir(dir))
|
||||
{
|
||||
const char* fn = ent->d_name;
|
||||
const size_t len = strlen(fn);
|
||||
|
||||
const bool oal = len > 7 && !stricmp(fn+len-7, "oal.dll");
|
||||
const bool openal = strstr(fn, "OpenAL") != 0;
|
||||
if(oal || openal)
|
||||
add_drv(fn);
|
||||
}
|
||||
closedir(dir);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue