mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-29 20:20:43 +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
|
void
|
||||||
VID_Init_Cvars ()
|
VID_Init_Cvars ()
|
||||||
{
|
{
|
||||||
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_NONE,
|
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ARCHIVE,
|
||||||
VID_UpdateFullscreen,
|
VID_UpdateFullscreen,
|
||||||
"Toggles fullscreen game mode");
|
"Toggles fullscreen game mode");
|
||||||
vid_system_gamma = Cvar_Get ("vid_system_gamma", "1", CVAR_ARCHIVE, NULL,
|
vid_system_gamma = Cvar_Get ("vid_system_gamma", "1", CVAR_ARCHIVE, NULL,
|
||||||
|
|
|
@ -200,7 +200,7 @@ VID_UpdateFullscreen (cvar_t *vid_fullscreen)
|
||||||
void
|
void
|
||||||
VID_Init_Cvars ()
|
VID_Init_Cvars ()
|
||||||
{
|
{
|
||||||
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_NONE,
|
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ARCHIVE,
|
||||||
VID_UpdateFullscreen,
|
VID_UpdateFullscreen,
|
||||||
"Toggles fullscreen game mode");
|
"Toggles fullscreen game mode");
|
||||||
vid_bitdepth = Cvar_Get ("vid_bitdepth", "8", CVAR_ROM, NULL, "Sets "
|
vid_bitdepth = Cvar_Get ("vid_bitdepth", "8", CVAR_ROM, NULL, "Sets "
|
||||||
|
|
|
@ -68,7 +68,7 @@ HWND mainwindow;
|
||||||
int VID_options_items = 1;
|
int VID_options_items = 1;
|
||||||
int modestate;
|
int modestate;
|
||||||
|
|
||||||
|
static SDL_Surface *screen = NULL;
|
||||||
|
|
||||||
void
|
void
|
||||||
VID_SDL_GammaCheck (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_DOUBLEBUFFER, 1);
|
||||||
SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 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 ());
|
Sys_Error ("Couldn't set video mode: %s\n", SDL_GetError ());
|
||||||
SDL_Quit ();
|
SDL_Quit ();
|
||||||
}
|
}
|
||||||
|
@ -231,11 +231,22 @@ VID_Init (unsigned char *palette)
|
||||||
vid.recalc_refdef = 1; // force a surface cache flush
|
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
|
void
|
||||||
VID_Init_Cvars ()
|
VID_Init_Cvars ()
|
||||||
{
|
{
|
||||||
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, NULL,
|
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ARCHIVE,
|
||||||
"Toggles fullscreen mode");
|
VID_UpdateFullscreen, "Toggles fullscreen mode");
|
||||||
vid_system_gamma = Cvar_Get ("vid_system_gamma", "1", CVAR_ARCHIVE, NULL,
|
vid_system_gamma = Cvar_Get ("vid_system_gamma", "1", CVAR_ARCHIVE, NULL,
|
||||||
"Use system gamma control if available");
|
"Use system gamma control if available");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue