static void R_InitBloodTextures (unsigned char *particletexturedata)
{
int i, j, k, m;
- unsigned char *data = Mem_Alloc(tempmempool, PARTICLETEXTURESIZE*PARTICLETEXTURESIZE*4);
+ size_t datasize = PARTICLETEXTURESIZE*PARTICLETEXTURESIZE*4;
+ unsigned char *data = Mem_Alloc(tempmempool, datasize);
// blood particles
for (i = 0;i < 8;i++)
{
- memset(data, 255, sizeof(data));
+ memset(data, 255, datasize);
for (k = 0;k < 24;k++)
particletextureblotch(data, PARTICLETEXTURESIZE/16, 96, 0, 0, 160);
//particletextureclamp(data, 32, 32, 32, 255, 255, 255);
// blood decals
for (i = 0;i < 8;i++)
{
- memset(data, 255, sizeof(data));
+ memset(data, 255, datasize);
m = 8;
for (j = 1;j < 10;j++)
for (k = min(j, m - 1);k < m;k++)
#endif
{
unsigned char *particletexturedata = (unsigned char *)Mem_Alloc(tempmempool, PARTICLEFONTSIZE*PARTICLEFONTSIZE*4);
- unsigned char *data = (unsigned char *)Mem_Alloc(tempmempool, PARTICLETEXTURESIZE*PARTICLETEXTURESIZE*4);
+ size_t datasize = PARTICLETEXTURESIZE*PARTICLETEXTURESIZE*4;
+ unsigned char *data = (unsigned char *)Mem_Alloc(tempmempool, datasize);
unsigned char *noise1 = (unsigned char *)Mem_Alloc(tempmempool, PARTICLETEXTURESIZE*2*PARTICLETEXTURESIZE*2);
unsigned char *noise2 = (unsigned char *)Mem_Alloc(tempmempool, PARTICLETEXTURESIZE*2*PARTICLETEXTURESIZE*2);
// smoke
for (i = 0;i < 8;i++)
{
- memset(data, 255, sizeof(data));
+ memset(data, 255, datasize);
do
{
fractalnoise(noise1, PARTICLETEXTURESIZE*2, PARTICLETEXTURESIZE/8);
}
// rain splash
- memset(data, 255, sizeof(data));
+ memset(data, 255, datasize);
for (y = 0;y < PARTICLETEXTURESIZE;y++)
{
dy = (y - 0.5f*PARTICLETEXTURESIZE) / (PARTICLETEXTURESIZE*0.5f-1);
setuptex(tex_rainsplash, data, particletexturedata);
// normal particle
- memset(data, 255, sizeof(data));
+ memset(data, 255, datasize);
for (y = 0;y < PARTICLETEXTURESIZE;y++)
{
dy = (y - 0.5f*PARTICLETEXTURESIZE) / (PARTICLETEXTURESIZE*0.5f-1);
setuptex(tex_particle, data, particletexturedata);
// rain
- memset(data, 255, sizeof(data));
+ memset(data, 255, datasize);
light[0] = 1;light[1] = 1;light[2] = 1;
VectorNormalize(light);
for (y = 0;y < PARTICLETEXTURESIZE;y++)
setuptex(tex_raindrop, data, particletexturedata);
// bubble
- memset(data, 255, sizeof(data));
+ memset(data, 255, datasize);
light[0] = 1;light[1] = 1;light[2] = 1;
VectorNormalize(light);
for (y = 0;y < PARTICLETEXTURESIZE;y++)
// bullet decals
for (i = 0;i < 8;i++)
{
- memset(data, 255, sizeof(data));
+ memset(data, 255, datasize);
for (k = 0;k < 12;k++)
particletextureblotch(data, PARTICLETEXTURESIZE/16, 0, 0, 0, 128);
for (k = 0;k < 3;k++)