#ifdef MAX_EXPLOSIONS
static cvar_t r_drawexplosions = {0, "r_drawexplosions", "1", "enables rendering of explosion shells (see also cl_particles_explosions_shell)"};
+extern qboolean r_loadfog;
static void r_explosion_start(void)
{
int x, y;
unsigned char noise1[128][128], noise2[128][128], noise3[128][128], data[128][128][4];
explosiontexturepool = R_AllocTexturePool();
+ explosiontexture = NULL;
+ explosiontexturefog = NULL;
fractalnoise(&noise1[0][0], 128, 32);
fractalnoise(&noise2[0][0], 128, 4);
fractalnoise(&noise3[0][0], 128, 4);
}
}
explosiontexture = R_LoadTexture2D(explosiontexturepool, "explosiontexture", 128, 128, &data[0][0][0], TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE | TEXF_FORCELINEAR, 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_LoadTexture2D(explosiontexturepool, "explosiontexturefog", 128, 128, &data[0][0][0], TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE | TEXF_FORCELINEAR, NULL);
+ if (r_loadfog)
+ {
+ 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_LoadTexture2D(explosiontexturepool, "explosiontexture_fog", 128, 128, &data[0][0][0], TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE | TEXF_FORCELINEAR, NULL);
+ }
// note that explosions survive the restart
}