1
0
Fork 0
forked from fte/fteqw

Fixed gl_font changes not taking affect until a conres change.

Fixed saved games.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3590 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2010-08-17 20:40:27 +00:00
parent 223ac397af
commit fc6d1f48e8
3 changed files with 16 additions and 6 deletions

View file

@ -467,6 +467,7 @@ void GLVID_Conwidth_Callback(struct cvar_s *var, char *oldvalue);
void GLVID_Conautoscale_Callback(struct cvar_s *var, char *oldvalue);
void GLVID_Conheight_Callback(struct cvar_s *var, char *oldvalue);
void GLV_Gamma_Callback(struct cvar_s *var, char *oldvalue);
void GL_Font_Callback(struct cvar_s *var, char *oldvalue);
void GLR_DeInit (void)
{
@ -525,6 +526,7 @@ void GLR_Init (void)
// Cvar_Hook(&r_drawflat, GLR_Drawflat_Callback);
Cvar_Hook(&v_gamma, GLV_Gamma_Callback);
Cvar_Hook(&v_contrast, GLV_Gamma_Callback);
Cvar_Hook(&gl_font, GL_Font_Callback);
R_InitBubble();

View file

@ -45,7 +45,6 @@ extern cvar_t scr_chatmodecvar;
extern cvar_t vid_conautoscale;
extern qboolean scr_con_forcedraw;
// console size manipulation callbacks
void GLVID_Console_Resize(void)
{
@ -104,15 +103,24 @@ void GLVID_Console_Resize(void)
font_tiny = NULL;
if (font_conchar)
Font_Free(font_conchar);
font_conchar = Font_LoadFont(8*vid.pixelheight/vid.height, gl_font.string);
if (!font_conchar && *gl_font.string)
font_conchar = Font_LoadFont(8*vid.pixelheight/vid.height, "");
font_conchar = NULL;
Cvar_ForceCallback(&gl_font);
#ifdef PLUGINS
Plug_ResChanged();
#endif
}
void GL_Font_Callback(struct cvar_s *var, char *oldvalue)
{
if (font_conchar)
Font_Free(font_conchar);
font_conchar = Font_LoadFont(8*vid.pixelheight/vid.height, var->string);
if (!font_conchar && *var->string)
font_conchar = Font_LoadFont(8*vid.pixelheight/vid.height, "");
}
void GLVID_Conheight_Callback(struct cvar_s *var, char *oldvalue)
{
if (var->value > 1536) //anything higher is unreadable.

View file

@ -995,6 +995,8 @@ void SV_Savegame_f (void)
VFS_PRINTF (f, "set nextserver \"%s\"\n", Cvar_Get("nextserver", "", 0, "")->string);
VFS_PRINTF (f, "}\n");
SV_SaveLevelCache(savename, true); //add the current level.
cache = svs.levcache; //state from previous levels - just copy it all accross.
VFS_PRINTF(f, "{\n");
while(cache)
@ -1008,8 +1010,6 @@ void SV_Savegame_f (void)
}
VFS_PRINTF(f, "}\n");
SV_SaveLevelCache(savename, true); //add the current level.
VFS_PRINTF (f, "%s\n", sv.name);
VFS_CLOSE(f);