mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
fix vid_fullscreen toggling (sgl) and archiving (all)
This commit is contained in:
parent
1c30d89149
commit
a98c5bb4c1
3 changed files with 17 additions and 6 deletions
|
@ -159,7 +159,7 @@ VID_UpdateFullscreen (cvar_t *vid_fullscreen)
|
|||
void
|
||||
VID_Init_Cvars ()
|
||||
{
|
||||
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_NONE,
|
||||
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ARCHIVE,
|
||||
VID_UpdateFullscreen,
|
||||
"Toggles fullscreen game mode");
|
||||
vid_system_gamma = Cvar_Get ("vid_system_gamma", "1", CVAR_ARCHIVE, NULL,
|
||||
|
|
|
@ -200,7 +200,7 @@ VID_UpdateFullscreen (cvar_t *vid_fullscreen)
|
|||
void
|
||||
VID_Init_Cvars ()
|
||||
{
|
||||
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_NONE,
|
||||
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ARCHIVE,
|
||||
VID_UpdateFullscreen,
|
||||
"Toggles fullscreen game mode");
|
||||
vid_bitdepth = Cvar_Get ("vid_bitdepth", "8", CVAR_ROM, NULL, "Sets "
|
||||
|
|
|
@ -68,7 +68,7 @@ HWND mainwindow;
|
|||
int VID_options_items = 1;
|
||||
int modestate;
|
||||
|
||||
|
||||
static SDL_Surface *screen = NULL;
|
||||
|
||||
void
|
||||
VID_SDL_GammaCheck (void)
|
||||
|
@ -189,7 +189,7 @@ VID_Init (unsigned char *palette)
|
|||
SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);
|
||||
SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 1);
|
||||
|
||||
if (SDL_SetVideoMode (scr_width, scr_height, 8, flags) == NULL) {
|
||||
if (!(screen = SDL_SetVideoMode (scr_width, scr_height, 8, flags))) {
|
||||
Sys_Error ("Couldn't set video mode: %s\n", SDL_GetError ());
|
||||
SDL_Quit ();
|
||||
}
|
||||
|
@ -231,11 +231,22 @@ VID_Init (unsigned char *palette)
|
|||
vid.recalc_refdef = 1; // force a surface cache flush
|
||||
}
|
||||
|
||||
void
|
||||
VID_UpdateFullscreen (cvar_t *vid_fullscreen)
|
||||
{
|
||||
if (!vid.initialized)
|
||||
return;
|
||||
if ((vid_fullscreen->int_val && !(screen->flags & SDL_FULLSCREEN))
|
||||
|| (!vid_fullscreen->int_val && screen->flags & SDL_FULLSCREEN))
|
||||
if (!SDL_WM_ToggleFullScreen (screen))
|
||||
Con_Printf ("VID_UpdateFullscreen: error setting fullscreen\n");
|
||||
}
|
||||
|
||||
void
|
||||
VID_Init_Cvars ()
|
||||
{
|
||||
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, NULL,
|
||||
"Toggles fullscreen mode");
|
||||
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ARCHIVE,
|
||||
VID_UpdateFullscreen, "Toggles fullscreen mode");
|
||||
vid_system_gamma = Cvar_Get ("vid_system_gamma", "1", CVAR_ARCHIVE, NULL,
|
||||
"Use system gamma control if available");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue