mirror of
https://github.com/nzp-team/glquake.git
synced 2024-11-26 05:50:51 +00:00
Fix zoom rendering error (issue #5)
This commit is contained in:
parent
b989a18aca
commit
b80bf2a51b
6 changed files with 12 additions and 12 deletions
BIN
nzportable.3dsx
BIN
nzportable.3dsx
Binary file not shown.
BIN
nzportable.elf
BIN
nzportable.elf
Binary file not shown.
|
@ -735,6 +735,8 @@ void CL_Init (void)
|
|||
Cvar_RegisterVariable (&cl_name);
|
||||
Cvar_RegisterVariable (&cl_color);
|
||||
Cvar_RegisterVariable (&cl_upspeed);
|
||||
Cvar_RegisterVariable (&cl_backspeed);
|
||||
Cvar_RegisterVariable (&cl_forwardspeed);
|
||||
Cvar_RegisterVariable (&cl_movespeedkey);
|
||||
Cvar_RegisterVariable (&cl_yawspeed);
|
||||
Cvar_RegisterVariable (&cl_pitchspeed);
|
||||
|
|
|
@ -780,14 +780,16 @@ void R_SetFrustum (void)
|
|||
}
|
||||
else
|
||||
{
|
||||
// naievil -- hi, this is floored because any basically non integer(? i think short precision float) value made the rendering all fucked up
|
||||
// so hope this helps (it does). This reduces some accuracy but it is not as important
|
||||
// rotate VPN right by FOV_X/2 degrees
|
||||
RotatePointAroundVector( frustum[0].normal, vup, vpn, -(90-r_refdef.fov_x / 2 ) );
|
||||
RotatePointAroundVector( frustum[0].normal, vup, vpn, floor(-(90-r_refdef.fov_x / 2 )) );
|
||||
// rotate VPN left by FOV_X/2 degrees
|
||||
RotatePointAroundVector( frustum[1].normal, vup, vpn, 90-r_refdef.fov_x / 2 );
|
||||
RotatePointAroundVector( frustum[1].normal, vup, vpn, floor(90-r_refdef.fov_x / 2) );
|
||||
// rotate VPN up by FOV_X/2 degrees
|
||||
RotatePointAroundVector( frustum[2].normal, vright, vpn, 90-r_refdef.fov_y / 2 );
|
||||
RotatePointAroundVector( frustum[2].normal, vright, vpn, floor(90-r_refdef.fov_y / 2) );
|
||||
// rotate VPN down by FOV_X/2 degrees
|
||||
RotatePointAroundVector( frustum[3].normal, vright, vpn, -( 90 - r_refdef.fov_y / 2 ) );
|
||||
RotatePointAroundVector( frustum[3].normal, vright, vpn, floor(-( 90 - r_refdef.fov_y / 2 )) );
|
||||
}
|
||||
|
||||
for (i=0 ; i<4 ; i++)
|
||||
|
|
|
@ -1263,10 +1263,6 @@ void SCR_UpdateScreen (void)
|
|||
}
|
||||
}
|
||||
|
||||
// naievil -- FIXME: the scr_fov is really bugged and only works with integer values
|
||||
// this should have a weird workaround
|
||||
//Con_Printf("Original fov: %d\tscr_fov: %f\tzoom: %d\n", original_fov, scr_fov.value, cl.stats[STAT_ZOOM]);
|
||||
|
||||
if (oldfov != scr_fov.value)
|
||||
{
|
||||
oldfov = scr_fov.value;
|
||||
|
|
|
@ -131,10 +131,10 @@ void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
|
|||
memset( zrot, 0, sizeof( zrot ) );
|
||||
zrot[0][0] = zrot[1][1] = zrot[2][2] = 1.0F;
|
||||
|
||||
zrot[0][0] = cos( DEG2RAD( degrees ) );
|
||||
zrot[0][1] = sin( DEG2RAD( degrees ) );
|
||||
zrot[1][0] = -sin( DEG2RAD( degrees ) );
|
||||
zrot[1][1] = cos( DEG2RAD( degrees ) );
|
||||
zrot[0][0] = cosf( DEG2RAD( degrees ) );
|
||||
zrot[0][1] = sinf( DEG2RAD( degrees ) );
|
||||
zrot[1][0] = -sinf( DEG2RAD( degrees ) );
|
||||
zrot[1][1] = cosf( DEG2RAD( degrees ) );
|
||||
|
||||
R_ConcatRotations( m, zrot, tmpmat );
|
||||
R_ConcatRotations( tmpmat, im, rot );
|
||||
|
|
Loading…
Reference in a new issue