]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix for drawing explosions and sky twice as much as necessary (!), no longer does...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 26 Oct 2002 15:23:58 +0000 (15:23 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 26 Oct 2002 15:23:58 +0000 (15:23 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2564 d7cf8633-e32d-0410-b094-e92efae38249

r_explosion.c
r_sky.c

index aa08b1bfcd1204fd50cc9ba30de96795be2cea7f..b5654092e18eb945874d5ed0d9b96387cfd1ead3 100644 (file)
@@ -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 63f2820c311013951328a084ffffa243330fcbdb..d47aea60d2c07cedde6ac9068198afe35caeb152 100644 (file)
--- 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;