]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_explosion.c
faster number to edict lookup (sv.edictstable) and faster edict to number lookup...
[xonotic/darkplaces.git] / r_explosion.c
index 168a9ff38304864ded562ab0036c1805c96f09fc..b5654092e18eb945874d5ed0d9b96387cfd1ead3 100644 (file)
@@ -80,11 +80,11 @@ void r_explosion_start(void)
                        data[y][x][3] = bound(0, a, 255);
                }
        }
-       explosiontexture = R_LoadTexture (explosiontexturepool, "explosiontexture", 128, 128, &data[0][0][0], TEXTYPE_RGBA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE);
+       explosiontexture = R_LoadTexture2D(explosiontexturepool, "explosiontexture", 128, 128, &data[0][0][0], TEXTYPE_RGBA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE, NULL);
        for (y = 0;y < 128;y++)
                for (x = 0;x < 128;x++)
                        data[y][x][0] = data[y][x][1] = data[y][x][2] = 255;
-       explosiontexturefog = R_LoadTexture (explosiontexturepool, "explosiontexturefog", 128, 128, &data[0][0][0], TEXTYPE_RGBA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE);
+       explosiontexturefog = R_LoadTexture2D(explosiontexturepool, "explosiontexturefog", 128, 128, &data[0][0][0], TEXTYPE_RGBA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE, NULL);
        // note that explosions survive the restart
 }
 
@@ -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;