(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.
This commit is contained in:
tron
2005-07-27 19:57:12 +00:00
parent 8afa32d470
commit 5fd69294ee
10 changed files with 104 additions and 214 deletions

View File

@@ -86,14 +86,14 @@ static void CreateWindowsConsoleThread(void)
if (hThread == NULL)
error("Cannot create console thread!");
DEBUG(misc, 0) ("Windows console thread started...");
DEBUG(driver, 1) ("Windows console thread started...");
}
static void CloseWindowsConsoleThread(void)
{
CloseHandle(hThread);
CloseHandle(hEvent);
DEBUG(misc, 0) ("Windows console thread shut down...");
DEBUG(driver, 1) ("Windows console thread shut down...");
}
#endif
@@ -126,7 +126,7 @@ static const char *DedicatedVideoStart(const char * const *parm)
OS2_SwitchToConsoleMode();
#endif
DEBUG(misc,0)("Loading dedicated server...");
DEBUG(driver, 1)("Loading dedicated server...");
return NULL;
}

View File

@@ -169,7 +169,7 @@ static bool CreateMainSurface(int w, int h)
GetAvailableVideoMode(&w, &h);
DEBUG(misc, 1) ("sdl: using mode %dx%d", w, h);
DEBUG(driver, 1) ("sdl: using mode %dx%d", w, h);
// DO NOT CHANGE TO HWSURFACE, IT DOES NOT WORK
newscreen = SDL_CALL SDL_SetVideoMode(w, h, 8, SDL_SWSURFACE | SDL_HWPALETTE | (_fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE));
@@ -385,7 +385,7 @@ static const char *SdlVideoStart(const char * const *parm)
if (s != NULL) return s;
SDL_CALL SDL_VideoDriverName(buf, 30);
DEBUG(misc, 1) ("sdl: using driver '%s'", buf);
DEBUG(driver, 1) ("sdl: using driver '%s'", buf);
GetVideoModes();
CreateMainSurface(_cur_resolution[0], _cur_resolution[1]);