From 5821529859b84d9ba264bf8b0b9267c900ed4103 Mon Sep 17 00:00:00 2001 From: tron Date: Wed, 27 Jul 2005 19:57:12 +0000 Subject: (svn r2728) -Fix/Feature: Change the driver probing algorithm Instead of trying to start a single driver and bailing out if that fails, try to initialise one by one and use the first one which succeeds. This should fix problems on machines with no sound card, where -s null had to be specified manually. --- unix.c | 58 ---------------------------------------------------------- 1 file changed, 58 deletions(-) (limited to 'unix.c') diff --git a/unix.c b/unix.c index 51ed2d1e1..1a6104a40 100644 --- a/unix.c +++ b/unix.c @@ -9,17 +9,6 @@ #include "hal.h" #include "variables.h" -#include "music/bemidi.h" -#include "music/extmidi.h" -#include "music/null_m.h" - -#include "sound/null_s.h" -#include "sound/sdl_s.h" - -#include "video/dedicated_v.h" -#include "video/null_v.h" -#include "video/sdl_v.h" - #include #include #include @@ -369,53 +358,6 @@ void FiosDelete(const char *name) unlink(path); } -const DriverDesc _video_driver_descs[] = { - {"null", "Null Video Driver", &_null_video_driver, 0}, -#if defined(WITH_SDL) - { "sdl", "SDL Video Driver", &_sdl_video_driver, 1}, -#endif -#ifdef ENABLE_NETWORK - { "dedicated", "Dedicated Video Driver", &_dedicated_video_driver, 0}, -#endif - { NULL, NULL, NULL, 0} -}; - -const DriverDesc _sound_driver_descs[] = { - {"null", "Null Sound Driver", &_null_sound_driver, 0}, -#if defined(WITH_SDL) - { "sdl", "SDL Sound Driver", &_sdl_sound_driver, 1}, -#endif - { NULL, NULL, NULL, 0} -}; - -#if defined(__APPLE__) -#define EXTMIDI_PRI 2 -#else -#define EXTMIDI_PRI 0 -#endif - -const DriverDesc _music_driver_descs[] = { -#ifndef __BEOS__ -#if !defined(__MORPHOS__) && !defined(__AMIGA__) -// MorphOS and AmigaOS have no music support - {"extmidi", "External MIDI Driver", &_extmidi_music_driver, EXTMIDI_PRI}, -#endif -#endif -#ifdef __BEOS__ - { "bemidi", "BeOS MIDI Driver", &_bemidi_music_driver, 1}, -#endif - { "null", "Null Music Driver", &_null_music_driver, 1}, - { NULL, NULL, NULL, 0} -}; - -/* GetOSVersion returns the minimal required version of OS to be able to use that driver. - Not needed for *nix. */ -byte GetOSVersion(void) -{ - return 2; // any arbitrary number bigger than 0 - // numbers lower than 2 breaks default music selection on mac -} - bool FileExists(const char *filename) { return access(filename, 0) == 0; -- cgit v1.2.3-70-g09d2