X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=image.c;h=366e80dd8380c16211b0e2f617f074846127b0c8;hp=988fbef8e7f27b4a8abcfaf89edb8e92cecea14e;hb=69186940288ada493ea357d63db2055c0d31da1f;hpb=cfee52a1ec9db338098789cae89ae5cf1f7a6fbf diff --git a/image.c b/image.c index 988fbef8..366e80dd 100644 --- a/image.c +++ b/image.c @@ -537,8 +537,6 @@ unsigned char *LoadTGA_BGRA (const unsigned char *f, int filesize, int *miplevel row_inci = 0; } - x = 0; - y = 0; pix_inc = 1; if ((targa_header.image_type & ~8) == 2) pix_inc = (targa_header.pixel_size + 7) / 8; @@ -966,11 +964,13 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo { int mymiplevel2 = miplevel ? *miplevel : 0; data2 = format->loadfunc(f, (int)filesize, &mymiplevel2); - if(mymiplevel != mymiplevel2) - Host_Error("loadimagepixelsbgra: miplevels differ"); + if(data2 && mymiplevel == mymiplevel2) + Image_CopyAlphaFromBlueBGRA(data, data2, image_width, image_height); + else + Con_Printf("loadimagepixelsrgba: corrupt or invalid alpha image %s_alpha\n", basename); + if(data2) + Mem_Free(data2); Mem_Free(f); - Image_CopyAlphaFromBlueBGRA(data, data2, image_width, image_height); - Mem_Free(data2); } } if (developer_loading.integer)