From d4033f5dcae2be5558d4f33c714beb474559a2df Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 5 Dec 2004 08:20:40 +0000 Subject: [PATCH] Fixes by Black's directive. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@560 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/pr_menu.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/engine/client/pr_menu.c b/engine/client/pr_menu.c index e6269620f..8b223424c 100644 --- a/engine/client/pr_menu.c +++ b/engine/client/pr_menu.c @@ -354,6 +354,7 @@ void PF_print (progfuncs_t *prinst, struct globalvars_s *pr_globals) static void PF_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) { + cvar_t *var; char *str; str = PR_GetStringOfs(prinst, OFS_PARM0); @@ -362,13 +363,23 @@ static void PF_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) else if (!strcmp("vid_conheight", str)) G_FLOAT(OFS_RETURN) = vid.conheight; else - G_FLOAT(OFS_RETURN) = Cvar_VariableValue (str); + { + var = Cvar_Get(str, "", 0, "menu cvars"); + if (var) + { + if (var->latched_string) + G_FLOAT(OFS_RETURN) = atof(var->latched_string); else + G_FLOAT(OFS_RETURN) = var->value; + } + else + G_FLOAT(OFS_RETURN) = 0; + } } void PF_getresolution (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float mode = G_FLOAT(OFS_PARM0); float *ret = G_VECTOR(OFS_RETURN); - +#pragma message("fixme: PF_getresolution should return other modes") if (mode > 0) { ret[0] = 0; @@ -377,8 +388,8 @@ void PF_getresolution (progfuncs_t *prinst, struct globalvars_s *pr_globals) } else { - ret[0] = vid.conwidth; - ret[1] = vid.conheight; + ret[0] = vid.width; + ret[1] = vid.height; ret[2] = 0; } }