summaryrefslogtreecommitdiff
path: root/os2.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-27 19:57:12 +0000
committertron <tron@openttd.org>2005-07-27 19:57:12 +0000
commit5fd69294ee2e4a8687d27c33557065ff3352519d (patch)
tree2d81a3e658bac637585e76cd5f1b80266f4b05b6 /os2.c
parent8afa32d470ee5d38d858ec0ef1bddd8544a89d84 (diff)
downloadopenttd-5fd69294ee2e4a8687d27c33557065ff3352519d.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 'os2.c')
-rw-r--r--os2.c43
1 files changed, 1 insertions, 42 deletions
diff --git a/os2.c b/os2.c
index 2d33ca593..c942672f4 100644
--- a/os2.c
+++ b/os2.c
@@ -2,6 +2,7 @@
#include "stdafx.h"
#include "openttd.h"
+#include "hal.h"
#include "variables.h"
#include "string.h"
#include "table/strings.h"
@@ -28,16 +29,6 @@
#include <i86.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 "music/null_m.h"
-#include "music/os2_m.h"
-
static inline int strcasecmp(const char* s1, const char* s2)
{
return stricmp(s1, s2);
@@ -432,38 +423,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}
-};
-
-const DriverDesc _music_driver_descs[] = {
- { "os2", "OS/2 Music Driver", &_os2_music_driver, 0},
- { "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 OS/2. */
-byte GetOSVersion(void)
-{
- return 2; // any arbitrary number bigger then 0
-}
-
bool FileExists(const char *filename)
{
return access(filename, 0) == 0;