X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=vid_sdl.c;h=56d1ad6129505c5701d37550b388d899d0baebf4;hb=464fe3007c4483fab6829671027ea7eca4db6081;hp=d6123be70d8829eb87be09fc6b8b51536d7d1a82;hpb=fe01d340dc1e4674160027051cbb0d745ebfa1ec;p=xonotic%2Fdarkplaces.git diff --git a/vid_sdl.c b/vid_sdl.c index d6123be7..56d1ad61 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -373,7 +373,7 @@ void Sys_SendKeyEvents( void ) Key_Event( MapKey( event.key.keysym.sym ), (char)event.key.keysym.unicode, (event.key.state == SDL_PRESSED) ); break; case SDL_ACTIVEEVENT: - if( event.active.state == SDL_APPACTIVE ) + if( event.active.state & SDL_APPACTIVE ) { if( event.active.gain ) vid_hidden = false; @@ -537,7 +537,7 @@ static void VID_SetIcon() for(i = 0; i < colors; ++i) { - int r, g, b; + unsigned int r, g, b; char idx; if(sscanf(idata[i+1], "%c c #%02x%02x%02x", &idx, &r, &g, &b) != 4) @@ -624,15 +624,15 @@ static void VID_OutputVersion() version->major, version->minor, version->patch ); } -int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate, int stereobuffer, int samples) +int VID_InitMode(int fullscreen, int *width, int *height, int bpp, int refreshrate, int stereobuffer, int samples) { int i; static int notfirstvideomode = false; int flags = SDL_OPENGL; const char *drivername; - win_half_width = width>>1; - win_half_height = height>>1; + win_half_width = *width>>1; + win_half_height = *height>>1; if(vid_resizable.integer) flags |= SDL_RESIZABLE; @@ -709,11 +709,11 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate video_bpp = bpp; video_flags = flags; VID_SetIcon(); - screen = SDL_SetVideoMode(width, height, bpp, flags); + screen = SDL_SetVideoMode(*width, *height, bpp, flags); if (screen == NULL) { - Con_Printf("Failed to set video mode to %ix%i: %s\n", width, height, SDL_GetError()); + Con_Printf("Failed to set video mode to %ix%i: %s\n", *width, *height, SDL_GetError()); VID_Shutdown(); return false; } @@ -801,7 +801,7 @@ void VID_Finish (void) if (r_render.integer && !vid_hidden) { CHECKGLERROR - if (r_speeds.integer || gl_finish.integer) + if (r_speeds.integer == 2 || gl_finish.integer) { qglFinish();CHECKGLERROR }