fixed a memory leak on s->maskpixels (due to memory pools this leak was probably not too bad)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2999
d7cf8633-e32d-0410-b094-
e92efae38249
s->basepixels_height = image_height;
bumppixels = NULL;bumppixels_width = 0;bumppixels_height = 0;
- for (j = 3;j < s->basepixels_width * s->basepixels_height * 4;j += 4)
- if (s->basepixels[j] < 255)
- break;
- if (j < s->basepixels_width * s->basepixels_height * 4)
+ if (Image_HasAlpha(s->basepixels, s->basepixels_width * s->basepixels_height, true))
{
s->maskpixels = Mem_Alloc(loadmodel->mempool, s->basepixels_width * s->basepixels_height * 4);
s->maskpixels_width = s->basepixels_width;
{
if (s->basepixels)
Mem_Free(s->basepixels);
+ if (s->maskpixels)
+ Mem_Free(s->maskpixels);
if (s->nmappixels)
Mem_Free(s->nmappixels);
if (s->glowpixels)