public static void Init( ) { Com.Printf("\\n------- sound initialization -------\\n"); cvar_t cv = Cvar.Get("s_initsound", "1", 0); if (cv.value == 0F) { Com.Printf("not initializing.\\n"); UseDriver("dummy"); return; } var defaultDriver = "dummy"; if (drivers.Count > 1) { defaultDriver = (( ISound )drivers.Last()).GetName(); } s_impl = Cvar.Get("s_impl", defaultDriver, Defines.CVAR_ARCHIVE); UseDriver(s_impl.string_renamed); if (impl.Init()) { Cvar.Set("s_impl", impl.GetName()); } else { UseDriver("dummy"); } Com.Printf("\\n------- use sound driver \\\"" + impl.GetName() + "\\\" -------\\n"); StopAllSounds(); }
public static void UseDriver(String driverName) { ISound driver = null; var count = drivers.Count; for (var i = 0; i < count; i++) { driver = ( ISound )drivers[i]; if (driver.GetName().Equals(driverName)) { impl = driver; return; } } impl = ( ISound )drivers.Last(); }