From 186d0dbb3f6b37b382585f94fa4a0b6ee2f1bd01 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Wed, 5 Sep 2007 02:09:57 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1296 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/src/main.cpp b/source/src/main.cpp index 26b86e4b..f138226c 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -294,6 +294,9 @@ int main(int argc, char **argv) } if(!hasmode) { scr_w = modes[0]->w; scr_h = modes[0]->h; } } + bool hasbpp = true; + if(colorbits && modes) + hasbpp = SDL_VideoModeOK(modes!=(SDL_Rect **)-1 ? modes[0]->w : scr_w, modes!=(SDL_Rect **)-1 ? modes[0]->h : scr_h, colorbits, SDL_OPENGL|resize|fs)==colorbits; SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); #if SDL_VERSION_ATLEAST(1, 2, 11) @@ -317,12 +320,13 @@ int main(int argc, char **argv) SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, config&2 ? 1 : 0); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, config&2 ? fsaa : 0); } - screen = SDL_SetVideoMode(scr_w, scr_h, colorbits, SDL_OPENGL|resize|fs); + screen = SDL_SetVideoMode(scr_w, scr_h, hasbpp ? colorbits : 0, SDL_OPENGL|resize|fs); if(screen) break; } if(!screen) fatal("Unable to create OpenGL screen: ", SDL_GetError()); else { + if(!hasbpp) conoutf("%d bit color buffer not supported - disabling", colorbits); if(depthbits && (config&1)==0) conoutf("%d bit z-buffer not supported - disabling", depthbits); if(fsaa && (config&2)==0) conoutf("%dx anti-aliasing not supported - disabling", fsaa); } @@ -344,7 +348,7 @@ int main(int argc, char **argv) initlog("gl"); - gl_init(scr_w, scr_h, colorbits, config&1 ? depthbits : 0, config&2 ? fsaa : 0); + gl_init(scr_w, scr_h, hasbpp ? colorbits : 0, config&1 ? depthbits : 0, config&2 ? fsaa : 0); notexture = textureload("packages/misc/notexture.png"); if(!notexture) fatal("could not find core textures (hint: run AssaultCube from the parent of the bin directory)");