From 4a9fc1e1d137a78cd2b75900345c8cf4c0e4b8a1 Mon Sep 17 00:00:00 2001 From: janwas Date: Fri, 19 Nov 2004 22:40:00 +0000 Subject: [PATCH] add sound card info; remove central detect() call This was SVN commit r1357. --- source/lib/detect.cpp | 24 ++++++++++++++++-------- source/lib/detect.h | 11 ++++++++++- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/source/lib/detect.cpp b/source/lib/detect.cpp index cb9622be44..d52adf5059 100755 --- a/source/lib/detect.cpp +++ b/source/lib/detect.cpp @@ -33,10 +33,12 @@ extern void ia32_get_cpu_info(); #ifdef _WIN32 extern int win_get_gfx_info(); extern int win_get_cpu_info(); +extern int win_get_snd_info(); #endif extern "C" int ogl_get_gfx_info(); + // // memory // @@ -71,12 +73,13 @@ void get_mem_status() #endif } + // // graphics card // -char gfx_card[64] = ""; -char gfx_drv_ver[64] = ""; +char gfx_card[GFX_CARD_LEN] = ""; +char gfx_drv_ver[GFX_DRV_VER_LEN] = ""; // attempt to detect graphics card without OpenGL (in case ogl init fails, @@ -106,7 +109,7 @@ void get_gfx_info() // CPU // -char cpu_type[64] = ""; // processor brand string is 48 chars +char cpu_type[49] = ""; // processor brand string is <= 48 chars double cpu_freq = 0.f; // -1 if detect not yet called, or cannot be determined @@ -116,7 +119,7 @@ int cpu_smp = -1; // are there actually multiple physical processors, // not only logical hyperthreaded CPUs? relevant for wtime. -static inline void get_cpu_info() +inline void get_cpu_info() { #ifdef _WIN32 win_get_cpu_info(); @@ -128,11 +131,16 @@ static inline void get_cpu_info() } +// +// sound +// +char snd_card[SND_CARD_LEN]; +char snd_drv_ver[SND_DRV_VER_LEN]; -void detect() +inline void get_snd_info() { - get_mem_status(); - get_gfx_info(); - get_cpu_info(); +#ifdef _WIN32 + win_get_snd_info(); +#endif } diff --git a/source/lib/detect.h b/source/lib/detect.h index 1381d0e04c..26fe9c6ed7 100755 --- a/source/lib/detect.h +++ b/source/lib/detect.h @@ -31,8 +31,17 @@ extern "C" { #include "sysdep/os.h" #include "sysdep/cpu.h" +extern void get_cpu_info(); -extern void detect(); + + +const size_t SND_CARD_LEN = 16; +extern char snd_card[SND_CARD_LEN]; + +const size_t SND_DRV_VER_LEN = 128; +extern char snd_drv_ver[SND_DRV_VER_LEN]; + +extern void get_snd_info(); #ifdef __cplusplus