- data2 = format->loadfunc(f, filesize);
- Mem_Free(f);
- Image_CopyAlphaFromBlueBGRA(data, data2, image_width, image_height);
- Mem_Free(data2);
+ dpsnprintf (name2, sizeof(name2), format->formatstring, va("%s_alpha", basename));
+ f = FS_LoadFile(name2, tempmempool, true, &filesize);
+ if(f)
+ {
+ int mymiplevel2 = miplevel ? *miplevel : 0;
+ data2 = format->loadfunc(f, (int)filesize, &mymiplevel2);
+ if(mymiplevel != mymiplevel2)
+ Host_Error("loadimagepixelsbgra: miplevels differ");
+ Mem_Free(f);
+ Image_CopyAlphaFromBlueBGRA(data, data2, image_width, image_height);
+ Mem_Free(data2);
+ }