Fixed Error Handling
This commit is contained in:
parent
19db456422
commit
019f9cb317
@ -13,7 +13,7 @@
|
|||||||
File: ZE_ZEngine.cpp <br>
|
File: ZE_ZEngine.cpp <br>
|
||||||
Description: Implementation source file for ZEngine library main singleton class. <br>
|
Description: Implementation source file for ZEngine library main singleton class. <br>
|
||||||
Author(s): James Turk <br>
|
Author(s): James Turk <br>
|
||||||
$Id: ZE_ZEngine.cpp,v 1.11 2003/01/12 07:09:04 cozman Exp $<br>
|
$Id: ZE_ZEngine.cpp,v 1.12 2003/01/12 17:27:05 cozman Exp $<br>
|
||||||
|
|
||||||
\file ZE_ZEngine.cpp
|
\file ZE_ZEngine.cpp
|
||||||
\brief Central source file for ZEngine.
|
\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
|
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);
|
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
|
#ifdef USE_SDL_MIXER
|
||||||
Mix_CloseAudio();
|
Mix_CloseAudio();
|
||||||
#endif
|
#endif
|
||||||
|
SDL_Quit();
|
||||||
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;
|
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;
|
mWidth = mScreen->w;
|
||||||
|
Loading…
Reference in New Issue
Block a user