summaryrefslogtreecommitdiff
path: root/src/video/sdl_v.cpp
diff options
context:
space:
mode:
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;