diff options
author | rubidium <rubidium@openttd.org> | 2008-11-29 01:28:13 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-11-29 01:28:13 +0000 |
commit | cdec8f6b27679513c1c33aec45eba5c3a6ba5192 (patch) | |
tree | 50c93473ffa440ee0ecb2d4c25e96d27c3fed7e4 /src/video/sdl_v.cpp | |
parent | 9140315c7bb5782031618c9811220c964d6ebfc8 (diff) | |
download | openttd-cdec8f6b27679513c1c33aec45eba5c3a6ba5192.tar.xz |
(svn r14641) -Change [Allegro]: when making a debug build revert Allegro's hooks on SIGSEGV/SIGABRT so one can actually use gdb.
-Change: make it more clear that Allegro's failing to find a driver.
Diffstat (limited to 'src/video/sdl_v.cpp')
-rw-r--r-- | src/video/sdl_v.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index 3b38e991c..353105ea3 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -156,7 +156,7 @@ static void GetAvailableVideoMode(int *w, int *h) uint delta; // all modes available? - if (_all_modes) return; + if (_all_modes || _num_resolutions == 0) return; // is the wanted mode among the available modes? for (i = 0; i != _num_resolutions; i++) { @@ -213,8 +213,10 @@ static bool CreateMainSurface(int w, int h) // DO NOT CHANGE TO HWSURFACE, IT DOES NOT WORK newscreen = SDL_CALL SDL_SetVideoMode(w, h, bpp, SDL_SWSURFACE | SDL_HWPALETTE | (_fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE)); - if (newscreen == NULL) + if (newscreen == NULL) { + DEBUG(driver, 0, "SDL: Couldn't allocate a window to draw on"); return false; + } _screen.width = newscreen->w; _screen.height = newscreen->h; |