r_gunfov shouldn't be CVAR_USERINFO, only CVAR_ARCHIVE

this happens when you just copypaste and adapt r_lefthand

also did some minor changes to R_AliasDrawModel in the soft renderer
to make sure alias[xy]scale is reset properly in the early out cases
This commit is contained in:
Daniel Gibson 2018-04-27 23:42:27 +02:00
parent 12a8da7180
commit 1e3135d4fc
4 changed files with 9 additions and 6 deletions

View File

@ -1200,7 +1200,7 @@ void
R_Register(void)
{
gl_lefthand = ri.Cvar_Get("hand", "0", CVAR_USERINFO | CVAR_ARCHIVE);
r_gunfov = ri.Cvar_Get("r_gunfov", "80", CVAR_USERINFO | CVAR_ARCHIVE);
r_gunfov = ri.Cvar_Get("r_gunfov", "80", CVAR_ARCHIVE);
r_farsee = ri.Cvar_Get("r_farsee", "0", CVAR_LATCH | CVAR_ARCHIVE);
r_norefresh = ri.Cvar_Get("r_norefresh", "0", 0);
r_fullbright = ri.Cvar_Get("r_fullbright", "0", 0);

View File

@ -191,7 +191,7 @@ static void
GL3_Register(void)
{
gl_lefthand = ri.Cvar_Get("hand", "0", CVAR_USERINFO | CVAR_ARCHIVE);
r_gunfov = ri.Cvar_Get("r_gunfov", "80", CVAR_USERINFO | CVAR_ARCHIVE);
r_gunfov = ri.Cvar_Get("r_gunfov", "80", CVAR_ARCHIVE);
r_farsee = ri.Cvar_Get("r_farsee", "0", CVAR_LATCH | CVAR_ARCHIVE);
gl_drawbuffer = ri.Cvar_Get("gl_drawbuffer", "GL_BACK", 0);

View File

@ -733,7 +733,7 @@ void R_AliasDrawModel (void)
return;
}
float fov = 2.0*tan((r_gunfov->value*(4.0/3.0))/360.0*M_PI);
float fov = 2.0*tan(r_gunfov->value*((4.0/3.0)*M_PI/360.0));
aliasxscale = ((float)r_refdef.vrect.width / fov) * r_aliasuvscale;
aliasyscale = aliasxscale;
@ -752,9 +752,10 @@ void R_AliasDrawModel (void)
// trivial accept status
if ( R_AliasCheckBBox() == BBOX_TRIVIAL_REJECT )
{
if ( ( currententity->flags & RF_WEAPONMODEL ) && ( r_lefthand->value == 1.0F ) )
if ( currententity->flags & RF_WEAPONMODEL )
{
aliasxscale = -aliasxscale;
aliasxscale = oldAliasxscale;
aliasyscale = oldAliasyscale;
}
return;
}
@ -764,6 +765,8 @@ void R_AliasDrawModel (void)
{
R_Printf( PRINT_ALL, "R_AliasDrawModel %s: NULL skin found\n",
currentmodel->name);
aliasxscale = oldAliasxscale;
aliasyscale = oldAliasyscale;
return;
}

View File

@ -275,7 +275,7 @@ R_Register (void)
r_mode = ri.Cvar_Get( "r_mode", "0", CVAR_ARCHIVE );
r_lefthand = ri.Cvar_Get( "hand", "0", CVAR_USERINFO | CVAR_ARCHIVE );
r_gunfov = ri.Cvar_Get( "r_gunfov", "80", CVAR_USERINFO | CVAR_ARCHIVE );
r_gunfov = ri.Cvar_Get( "r_gunfov", "80", CVAR_ARCHIVE );
r_speeds = ri.Cvar_Get ("r_speeds", "0", 0);
r_fullbright = ri.Cvar_Get ("r_fullbright", "0", 0);
r_drawentities = ri.Cvar_Get ("r_drawentities", "1", 0);