- data2 = format->loadfunc(f, (int)filesize);
- Mem_Free(f);
- Image_CopyAlphaFromBlueBGRA(data, data2, image_width, image_height);
- Mem_Free(data2);
+ dpsnprintf (name2, sizeof(name2), format->formatstring, va(vabuf, sizeof(vabuf), "%s_alpha", basename));
+ f = FS_LoadFile(name2, tempmempool, true, &filesize);
+ if(f)
+ {
+ int mymiplevel2 = miplevel ? *miplevel : 0;
+ int image_width_save = image_width;
+ int image_height_save = image_height;
+ data2 = format->loadfunc(f, (int)filesize, &mymiplevel2);
+ if(data2 && mymiplevel == mymiplevel2 && image_width == image_width_save && image_height == image_height_save)
+ Image_CopyAlphaFromBlueBGRA(data, data2, image_width, image_height);
+ else
+ Con_Printf("loadimagepixelsrgba: corrupt or invalid alpha image %s_alpha\n", basename);
+ image_width = image_width_save;
+ image_height = image_height_save;
+ if(data2)
+ Mem_Free(data2);
+ Mem_Free(f);
+ }