diff --git a/include/ZE_ZEngine.h b/include/ZE_ZEngine.h index 1bd0446..9550d33 100644 --- a/include/ZE_ZEngine.h +++ b/include/ZE_ZEngine.h @@ -13,7 +13,7 @@ File: ZE_ZEngine.h
Description: Header file for ZEngine class, the core of the ZEngine.
Author(s): James Turk
-$Id: ZE_ZEngine.h,v 1.15 2003/01/24 11:05:25 cozman Exp $
+$Id: ZE_ZEngine.h,v 1.16 2003/01/24 19:43:59 cozman Exp $
\file ZE_ZEngine.h \brief Definition file for core ZEngine class. @@ -117,7 +117,7 @@ class ZEngine \param width Desired width of screen or window. \param height Desired height of screen or window. - \param bpp Desired BPP for screen (generally use 32). + \param bpp Desired BPP for screen, generally use 8,16 or 32, pass -1 if you want ZEngine to guess the best choice. \param fullscreen A bool for fullscreen setting. **/ void SetupDisplay(int width, int height, int bpp, bool fullscreen); @@ -139,7 +139,7 @@ class ZEngine SetupDisplay and SetupSound should be called prior to this to change settings, settings from those do not go into effect until this function is called. Specify no icon file to use default icon. Returns result of setting up ZEngine, and logs - error if false is returned (returns bool in versions >= 0.8.2). + error if false is returned (Trys not to fail + returns bool in versions >= 0.8.2). \param title Window Title. \param icon Path to Icon File. diff --git a/src/ZE_ZEngine.cpp b/src/ZE_ZEngine.cpp index f52e4a4..51dc0cc 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.21 2003/01/24 11:05:25 cozman Exp $
+$Id: ZE_ZEngine.cpp,v 1.22 2003/01/24 19:41:54 cozman Exp $
\file ZE_ZEngine.cpp \brief Central source file for ZEngine. @@ -124,13 +124,16 @@ bool ZEngine::CreateDisplay(string title, string icon) //set flags and bpp// if(mFullscreen) flags |= SDL_FULLSCREEN; - if(mBPP != 8 && mBPP != 15 && mBPP != 16 && mBPP != 24 && mBPP !=32) + if(mBPP != -1 && mBPP != 8 && mBPP != 15 && mBPP != 16 && mBPP != 24 && mBPP !=32) { - ReportError(ZERR_VIDMODE,FormatStr("%d is invalid BPP, must be 8,15,16,24 or 32, trying desktop BPP.",mBPP)); - mBPP = 0; + ReportError(ZERR_VIDMODE,FormatStr("%d is invalid BPP, must be 8,15,16,24 or 32, trying best BPP.",mBPP)); + mBPP = -1; } else { + if(mBPP == -1) + mBPP = SDL_GetVideoInfo()->vfmt->BitsPerPixel; + bpp = SDL_VideoModeOK(mWidth, mHeight, mBPP, flags); if(!bpp) {