summaryrefslogtreecommitdiff
path: root/src/video/sdl_v.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-11-29 01:28:13 +0000
committerrubidium <rubidium@openttd.org>2008-11-29 01:28:13 +0000
commit913f51b2fbbe80d4dffa2589bc61f86455cae5ad (patch)
tree50c93473ffa440ee0ecb2d4c25e96d27c3fed7e4 /src/video/sdl_v.cpp
parentbacd1d185d093d45c866bf538ac5ea9ae200d5ac (diff)
downloadopenttd-913f51b2fbbe80d4dffa2589bc61f86455cae5ad.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.cpp6
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;