rename cvar to r_scale

This commit is contained in:
Eric Wasylishen 2017-05-24 13:18:46 -06:00
parent 80e1c797c1
commit a97aa76668
4 changed files with 15 additions and 18 deletions

View file

@ -112,7 +112,7 @@ float map_wateralpha, map_lavaalpha, map_telealpha, map_slimealpha;
qboolean r_drawflat_cheatsafe, r_fullbright_cheatsafe, r_lightmap_cheatsafe, r_drawworld_cheatsafe; //johnfitz
extern cvar_t scr_vidscale;
cvar_t r_scale = {"r_scale", "1", CVAR_ARCHIVE};
//==============================================================================
//
@ -474,15 +474,16 @@ R_SetupGL
*/
void R_SetupGL (void)
{
int vidscale = CLAMP(1, (int)scr_vidscale.value, 4);
int scale;
//johnfitz -- rewrote this section
glMatrixMode(GL_PROJECTION);
glLoadIdentity ();
scale = CLAMP(1, (int)r_scale.value, 4);
glViewport (glx + r_refdef.vrect.x,
gly + glheight - r_refdef.vrect.y - r_refdef.vrect.height,
r_refdef.vrect.width / vidscale,
r_refdef.vrect.height / vidscale);
r_refdef.vrect.width / scale,
r_refdef.vrect.height / scale);
//johnfitz
GL_SetFrustum (r_fovx, r_fovy); //johnfitz -- use r_fov* vars
@ -962,18 +963,18 @@ R_ScaleView
void R_ScaleView (void)
{
float smax, tmax;
int vidscale;
int scale;
int srcx, srcy, srcw, srch;
if (scr_vidscale.value == 1)
if (r_scale.value == 1)
return;
// copied from R_SetupGL()
vidscale = CLAMP(1, (int)scr_vidscale.value, 4);
scale = CLAMP(1, (int)r_scale.value, 4);
srcx = glx + r_refdef.vrect.x;
srcy = gly + glheight - r_refdef.vrect.y - r_refdef.vrect.height;
srcw = r_refdef.vrect.width / vidscale;
srch = r_refdef.vrect.height / vidscale;
srcw = r_refdef.vrect.width / scale;
srch = r_refdef.vrect.height / scale;
// create render-to-texture texture if needed
if (!r_scaleview_texture)

View file

@ -236,10 +236,11 @@ void R_Init (void)
Cvar_RegisterVariable (&r_lavaalpha);
Cvar_RegisterVariable (&r_telealpha);
Cvar_RegisterVariable (&r_slimealpha);
Cvar_RegisterVariable (&r_scale);
Cvar_SetCallback (&r_lavaalpha, R_SetLavaalpha_f);
Cvar_SetCallback (&r_telealpha, R_SetTelealpha_f);
Cvar_SetCallback (&r_slimealpha, R_SetSlimealpha_f);
R_InitParticles ();
R_SetClearColor_f (&r_clearcolor); //johnfitz

View file

@ -88,10 +88,6 @@ cvar_t scr_showfps = {"scr_showfps", "0", CVAR_NONE};
cvar_t scr_clock = {"scr_clock", "0", CVAR_NONE};
//johnfitz
//ericw -- scaling
cvar_t scr_vidscale = {"scr_vidscale", "1", CVAR_ARCHIVE};
//ericw
cvar_t scr_viewsize = {"viewsize","100", CVAR_ARCHIVE};
cvar_t scr_fov = {"fov","90",CVAR_NONE}; // 10 - 170
cvar_t scr_fov_adapt = {"fov_adapt","1",CVAR_ARCHIVE};
@ -425,8 +421,6 @@ void SCR_Init (void)
Cvar_RegisterVariable (&scr_centertime);
Cvar_RegisterVariable (&scr_printspeed);
Cvar_RegisterVariable (&gl_triplebuffer);
Cvar_RegisterVariable (&scr_vidscale);
Cvar_SetCallback (&scr_vidscale, SCR_Callback_refdef);
Cmd_AddCommand ("screenshot",SCR_ScreenShot_f);
Cmd_AddCommand ("sizeup",SCR_SizeUp_f);

View file

@ -140,6 +140,7 @@ extern cvar_t r_telealpha;
extern cvar_t r_slimealpha;
extern cvar_t r_dynamic;
extern cvar_t r_novis;
extern cvar_t r_scale;
extern cvar_t gl_clear;
extern cvar_t gl_cull;