From 929fe237ce8352865c19475dde09e5c6e229dacb Mon Sep 17 00:00:00 2001 From: olsner Date: Sat, 10 Jul 2004 21:33:31 +0000 Subject: [PATCH] SDL_ACTIVE => SDL_ACTIVEEVENT (wsdl called it SDL_ACTIVE - official SDL has it as *EVENT). Support for the "windowed" config value, and a bool fullscreen argument for set_vmode. This was SVN commit r696. --- source/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/main.cpp b/source/main.cpp index 42420f076d..57db5e69d3 100755 --- a/source/main.cpp +++ b/source/main.cpp @@ -201,12 +201,12 @@ static void display_startup_error(const char* msg) } -static int set_vmode(int w, int h, int bpp) +static int set_vmode(int w, int h, int bpp, bool fullscreen) { SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - if(!SDL_SetVideoMode(w, h, bpp, SDL_OPENGL|SDL_FULLSCREEN)) + if(!SDL_SetVideoMode(w, h, bpp, SDL_OPENGL|(fullscreen?SDL_FULLSCREEN:0))) return -1; glViewport(0, 0, w, h); @@ -268,7 +268,7 @@ static int handler(const SDL_Event* ev) switch(ev->type) { - case SDL_ACTIVE: + case SDL_ACTIVEEVENT: active = ev->active.gain != 0; break; @@ -701,7 +701,11 @@ PREVTSC=TSC; new CGUI; #endif - if(set_vmode(g_xres, g_yres, 32) < 0) + CConfigValue *val=g_ConfigDB.GetValue(CFG_SYSTEM, "windowed"); + bool windowed=false; + if (val) val->GetBool(windowed); + + if(set_vmode(g_xres, g_yres, 32, !windowed) < 0) { swprintf(err_msg, ERR_MSG_SIZE, L"could not set %dx%d graphics mode: %s\n", g_xres, g_yres, SDL_GetError()); display_startup_error(err_msg);