diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_drawtools.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/cgame/cg_drawtools.c b/src/cgame/cg_drawtools.c index 06ae0713..b7b980f9 100644 --- a/src/cgame/cg_drawtools.c +++ b/src/cgame/cg_drawtools.c @@ -321,30 +321,30 @@ CG_WorldToScreen */ qboolean CG_WorldToScreen( vec3_t point, float *x, float *y ) { - vec3_t trans; - float xc, yc; - float px, py; - float z; + vec3_t trans; + float xc, yc; + float px, py; + float z; - px = tan( cg.refdef.fov_x * M_PI / 360.0 ); - py = tan( cg.refdef.fov_y * M_PI / 360.0 ); + px = tan( cg.refdef.fov_x * M_PI / 360.0f ); + py = tan( cg.refdef.fov_y * M_PI / 360.0f ); - VectorSubtract( point, cg.refdef.vieworg, trans ); + VectorSubtract( point, cg.refdef.vieworg, trans ); - xc = 640.0f / 2.0f; - yc = 480.0f / 2.0f; + xc = 640.0f / 2.0f; + yc = 480.0f / 2.0f; - z = DotProduct( trans, cg.refdef.viewaxis[ 0 ] ); - if( z <= 0.001f ) - return qfalse; + z = DotProduct( trans, cg.refdef.viewaxis[ 0 ] ); + if( z <= 0.001f ) + return qfalse; if( x ) - *x = xc - DotProduct( trans, cg.refdef.viewaxis[ 1 ] ) * xc / ( z * px ); + *x = xc - DotProduct( trans, cg.refdef.viewaxis[ 1 ] ) * xc / ( z * px ); if( y ) - *y = yc - DotProduct( trans, cg.refdef.viewaxis[ 2 ] ) * yc / ( z * py ); + *y = yc - DotProduct( trans, cg.refdef.viewaxis[ 2 ] ) * yc / ( z * py ); - return qtrue; + return qtrue; } /* |