From: havoc Date: Sat, 26 Oct 2002 15:23:58 +0000 (+0000) Subject: fix for drawing explosions and sky twice as much as necessary (!), no longer does... X-Git-Tag: RELEASE_0_2_0_RC1~114 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=31395fccff216a4286722ccaa6ef5b0bb57f083e;p=xonotic%2Fdarkplaces.git fix for drawing explosions and sky twice as much as necessary (!), no longer does a 360 degree sweep on both axis, one axis is only 180 degrees git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2564 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/r_explosion.c b/r_explosion.c index aa08b1bf..b5654092 100644 --- a/r_explosion.c +++ b/r_explosion.c @@ -103,8 +103,8 @@ int R_ExplosionVert(int column, int row) int i; float a, b, c; i = row * (EXPLOSIONGRID + 1) + column; - a = row * M_PI * 2 / EXPLOSIONGRID; - b = column * M_PI * 2 / EXPLOSIONGRID; + a = ((double) row / EXPLOSIONGRID) * M_PI * 2; + b = (((double) column / EXPLOSIONGRID) + 0.5) * M_PI; c = cos(b); explosionpoint[i][0] = cos(a) * c; explosionpoint[i][1] = sin(a) * c; diff --git a/r_sky.c b/r_sky.c index 63f2820c..d47aea60 100644 --- a/r_sky.c +++ b/r_sky.c @@ -207,10 +207,10 @@ static void skyspherecalc(void) for (i = 0;i <= skygridx;i++) { b = i * skygridxrecip; - x = cos(b * M_PI * 2); + x = cos((b + 0.5) * M_PI); v[0] = ax*x * dx; v[1] = ay*x * dy; - v[2] = -sin(b * M_PI * 2) * dz; + v[2] = -sin((b + 0.5) * M_PI) * dz; length = 3.0f / sqrt(v[0]*v[0]+v[1]*v[1]+(v[2]*v[2]*9)); *texcoord++ = v[0] * length; *texcoord++ = v[1] * length;