From 9e4995e51f280989ca00a06c9d7c853c65799145 Mon Sep 17 00:00:00 2001 From: Pawel Kolodziejski Date: Sun, 20 Jul 2014 20:08:32 +0200 Subject: [PATCH] SDL: don't call error() inside setupScreen(), it will crash if debugger is used --- .../graphics/surfacesdl/surfacesdl-graphics.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index 85332174e32..daaea6e644e 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -226,8 +226,10 @@ Graphics::PixelBuffer SurfaceSdlGraphicsManager::setupScreen(uint screenW, uint } #endif - if (!_screen) - error("Could not initialize video: %s", SDL_GetError()); + if (!_screen) { + warning("Error: %s", SDL_GetError()); + g_system->quit(); + } #ifdef USE_OPENGL if (_opengl) { @@ -266,9 +268,9 @@ Graphics::PixelBuffer SurfaceSdlGraphicsManager::setupScreen(uint screenW, uint // GLEW needs to be initialized to use shaders GLenum err = glewInit(); if (err != GLEW_OK) { - error("Error: %s\n", glewGetErrorString(err)); + warning("Error: %s", glewGetErrorString(err)); + g_system->quit(); } - assert(GLEW_OK == err); const GLfloat vertices[] = { 0.0, 0.0, @@ -315,8 +317,10 @@ Graphics::PixelBuffer SurfaceSdlGraphicsManager::setupScreen(uint screenW, uint _screen->format->Rmask, _screen->format->Gmask, _screen->format->Bmask, _screen->format->Amask); } - if (!_overlayscreen) - error("allocating _overlayscreen failed"); + if (!_overlayscreen) { + warning("Error: %s", SDL_GetError()); + g_system->quit(); + } /*_overlayFormat.bytesPerPixel = _overlayscreen->format->BytesPerPixel;