From b7c2fd437f169c1c8f1d2308791540054ad0a050 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Fri, 8 Mar 2013 09:13:42 +1030 Subject: [PATCH] light: replace last CastRay user with TestLine and remove We never made use of the length argument returned. Signed-off-by: Kevin Shanahan --- light/ltface.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/light/ltface.c b/light/ltface.c index 67c22687..4ef38df7 100644 --- a/light/ltface.c +++ b/light/ltface.c @@ -102,35 +102,6 @@ solve3(const vec3_t mtx[3], const int r[3], const int c[3], / mtx[0][0]; } -/* ======================================================================== */ - - -/* - * ============ - * CastRay - * Returns the distance between the points, or -1 if blocked - * ============= - */ -static vec_t -CastRay(const vec3_t p1, const vec3_t p2) -{ - int i; - vec_t t; - qboolean trace; - - trace = TestLine(p1, p2); - if (!trace) - return -1; /* ray was blocked */ - - t = 0; - for (i = 0; i < 3; i++) - t += (p2[i] - p1[i]) * (p2[i] - p1[i]); - - if (t == 0) - t = 1; /* don't blow up... */ - return sqrt(t); -} - /* * ============================================================================ * SAMPLE POINT DETERMINATION @@ -396,7 +367,7 @@ CalcPoints(lightinfo_t *l) for (i = 0; i < 6; i++) { tex_to_world(us, ut, l, surf); - if (CastRay(facemid, surf) != -1) + if (TestLine(facemid, surf)) break; /* got it */ if (i & 1) { // i is odd if (us > mids) {