mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-21 00:41:05 +00:00
r_gunfov for the software renderer
This commit is contained in:
parent
c59c1bfda1
commit
12a8da7180
3 changed files with 18 additions and 4 deletions
|
@ -444,6 +444,7 @@ extern cvar_t *sw_waterwarp;
|
|||
|
||||
extern cvar_t *r_fullbright;
|
||||
extern cvar_t *r_lefthand;
|
||||
extern cvar_t *r_gunfov;
|
||||
extern cvar_t *r_drawworld;
|
||||
extern cvar_t *r_lerpmodels;
|
||||
extern cvar_t *r_lightlevel;
|
||||
|
|
|
@ -723,12 +723,22 @@ void R_AliasDrawModel (void)
|
|||
if ( r_lerpmodels->value == 0 )
|
||||
currententity->backlerp = 0;
|
||||
|
||||
float oldAliasxscale = aliasxscale;
|
||||
float oldAliasyscale = aliasyscale;
|
||||
|
||||
if ( currententity->flags & RF_WEAPONMODEL )
|
||||
{
|
||||
if ( r_lefthand->value == 2.0F )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
float fov = 2.0*tan((r_gunfov->value*(4.0/3.0))/360.0*M_PI);
|
||||
aliasxscale = ((float)r_refdef.vrect.width / fov) * r_aliasuvscale;
|
||||
aliasyscale = aliasxscale;
|
||||
|
||||
if ( r_lefthand->value == 1.0F )
|
||||
aliasxscale = -aliasxscale;
|
||||
else if ( r_lefthand->value == 2.0F )
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -851,8 +861,9 @@ void R_AliasDrawModel (void)
|
|||
|
||||
R_AliasPreparePoints ();
|
||||
|
||||
if ( ( currententity->flags & RF_WEAPONMODEL ) && ( r_lefthand->value == 1.0F ) )
|
||||
if ( currententity->flags & RF_WEAPONMODEL )
|
||||
{
|
||||
aliasxscale = -aliasxscale;
|
||||
aliasxscale = oldAliasxscale;
|
||||
aliasyscale = oldAliasyscale;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,6 +109,7 @@ float da_time1, da_time2, dp_time1, dp_time2, db_time1, db_time2, rw_time1, rw_t
|
|||
float se_time1, se_time2, de_time1, de_time2;
|
||||
|
||||
cvar_t *r_lefthand;
|
||||
cvar_t *r_gunfov;
|
||||
static cvar_t *sw_aliasstats;
|
||||
cvar_t *sw_clearcolor;
|
||||
cvar_t *sw_drawflat;
|
||||
|
@ -274,6 +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_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);
|
||||
|
|
Loading…
Reference in a new issue