mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-02 09:40:35 +00:00
(svn r16699) -Fix [FS#3001]: if SDL fails to allocate a surface due to it being too large (and SDL doesn't crash!) fall back to another video driver.
This commit is contained in:
parent
6ce7df1153
commit
231626f98c
@ -426,11 +426,14 @@ const char *VideoDriver_SDL::Start(const char * const *parm)
|
||||
const char *s = SdlOpen(SDL_INIT_VIDEO);
|
||||
if (s != NULL) return s;
|
||||
|
||||
GetVideoModes();
|
||||
if (!CreateMainSurface(_cur_resolution.width, _cur_resolution.height)) {
|
||||
return SDL_CALL SDL_GetError();
|
||||
}
|
||||
|
||||
SDL_CALL SDL_VideoDriverName(buf, 30);
|
||||
DEBUG(driver, 1, "SDL: using driver '%s'", buf);
|
||||
|
||||
GetVideoModes();
|
||||
CreateMainSurface(_cur_resolution.width, _cur_resolution.height);
|
||||
MarkWholeScreenDirty();
|
||||
|
||||
SDL_CALL SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
|
Loading…
Reference in New Issue
Block a user