diff options
author | tron <tron@openttd.org> | 2005-07-27 19:57:12 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-07-27 19:57:12 +0000 |
commit | 5821529859b84d9ba264bf8b0b9267c900ed4103 (patch) | |
tree | 2d81a3e658bac637585e76cd5f1b80266f4b05b6 /unix.c | |
parent | 6c52a8629d0b94d72e20809818cb0fd5c3097c93 (diff) | |
download | openttd-5821529859b84d9ba264bf8b0b9267c900ed4103.tar.xz |
(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.
Diffstat (limited to 'unix.c')
-rw-r--r-- | unix.c | 58 |
1 files changed, 0 insertions, 58 deletions
@@ -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 <dirent.h> #include <unistd.h> #include <sys/stat.h> @@ -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; |