From: havoc Date: Fri, 30 Aug 2002 13:17:32 +0000 (+0000) Subject: commented out bit-hacking 1/sqrt code X-Git-Tag: RELEASE_0_2_0_RC1~286 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ed67cc8325ba6c8cbdd36f2271703b3814b57940;p=xonotic%2Fdarkplaces.git commented out bit-hacking 1/sqrt code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2318 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/r_light.c b/r_light.c index 965b8191..f6b8d480 100644 --- a/r_light.c +++ b/r_light.c @@ -918,12 +918,12 @@ void R_LightModel(const entity_render_t *ent, int numverts, float colorr, float f = (1.0f / (dist2 * nl->falloff + nl->offset)) - nl->subtract; if (f > 0) { - #if SLOWMATH + //#if SLOWMATH t = 1.0f / sqrt(dist2); - #else - *((int *)&t) = 0x5f3759df - ((* (int *) &dist2) >> 1); - t = t * (1.5f - (dist2 * 0.5f * t * t)); - #endif + //#else + //*((int *)&t) = 0x5f3759df - ((* (int *) &dist2) >> 1); + //t = t * (1.5f - (dist2 * 0.5f * t * t)); + //#endif // dot * t is dotproduct with a normalized v. // (the result would be -1 to +1, but we already