From 019f9cb317859c1cc7a81552a5eeb352bf6590f5 Mon Sep 17 00:00:00 2001 From: James Turk Date: Sun, 12 Jan 2003 17:27:05 +0000 Subject: [PATCH] Fixed Error Handling --- src/ZE_ZEngine.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/ZE_ZEngine.cpp b/src/ZE_ZEngine.cpp index 737892f..0d1900b 100644 --- a/src/ZE_ZEngine.cpp +++ b/src/ZE_ZEngine.cpp @@ -13,7 +13,7 @@ File: ZE_ZEngine.cpp
Description: Implementation source file for ZEngine library main singleton class.
Author(s): James Turk
-$Id: ZE_ZEngine.cpp,v 1.11 2003/01/12 07:09:04 cozman Exp $
+$Id: ZE_ZEngine.cpp,v 1.12 2003/01/12 17:27:05 cozman Exp $
\file ZE_ZEngine.cpp \brief Central source file for ZEngine. @@ -172,18 +172,19 @@ bool ZEngine::CreateDisplay(string title, string icon) if(!mScreen) //try 0 for BPP if supplied bpp failed { - LogError(FormatStr("Unable to set video mode %dx%d (%dBpp): %s",mWidth,mHeight,mBPP,SDL_GetError())); mScreen = SDL_SetVideoMode(mWidth, mHeight, 0, flags); - } - if(!mScreen) //if safe screen setup fails - { + if(!mScreen) //if safe screen setup fails + { #ifdef USE_SDL_MIXER - Mix_CloseAudio(); + Mix_CloseAudio(); #endif - - SDL_Quit(); - return false; + SDL_Quit(); + LogError(FormatStr("Unable to set video mode %dx%d (%dBpp): %s. Desktop Depth (%d) failed, exit",mWidth,mHeight,mBPP,SDL_GetError())); + return false; + } + else //let them know what they wanted failed + LogError(FormatStr("Unable to set video mode %dx%d (%dBpp): %s. Desktop Depth (%d) worked.",mWidth,mHeight,mBPP,SDL_GetError())); } mWidth = mScreen->w;