mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-26 05:41:52 +00:00
sharkbanana found an edge case.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4766 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
3284a25b59
commit
e572332173
1 changed files with 15 additions and 10 deletions
|
@ -3571,18 +3571,23 @@ static qboolean Image_GenMip0(struct pendingtextureinfo *mips, unsigned int flag
|
|||
}
|
||||
|
||||
|
||||
Image_RoundDimensions(&mips->mip[0].width, &mips->mip[0].height, flags);
|
||||
if (mips->mip[0].width == imgwidth && mips->mip[0].height == imgheight)
|
||||
mips->mip[0].data = rgbadata;
|
||||
else
|
||||
if (rgbadata)
|
||||
{
|
||||
mips->mip[0].data = BZ_Malloc(((mips->mip[0].width+3)&~3)*mips->mip[0].height*4);
|
||||
// memset(mips->mip[0].data, 0, mips->mip[0].width*mips->mip[0].height*4);
|
||||
Image_ResampleTexture(rgbadata, imgwidth, imgheight, mips->mip[0].data, mips->mip[0].width, mips->mip[0].height);
|
||||
if (freedata)
|
||||
BZ_Free(rgbadata);
|
||||
freedata = true;
|
||||
Image_RoundDimensions(&mips->mip[0].width, &mips->mip[0].height, flags);
|
||||
if (mips->mip[0].width == imgwidth && mips->mip[0].height == imgheight)
|
||||
mips->mip[0].data = rgbadata;
|
||||
else
|
||||
{
|
||||
mips->mip[0].data = BZ_Malloc(((mips->mip[0].width+3)&~3)*mips->mip[0].height*4);
|
||||
// memset(mips->mip[0].data, 0, mips->mip[0].width*mips->mip[0].height*4);
|
||||
Image_ResampleTexture(rgbadata, imgwidth, imgheight, mips->mip[0].data, mips->mip[0].width, mips->mip[0].height);
|
||||
if (freedata)
|
||||
BZ_Free(rgbadata);
|
||||
freedata = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
mips->mip[0].data = NULL;
|
||||
mips->mip[0].datasize = mips->mip[0].width*mips->mip[0].height*4;
|
||||
|
||||
if (mips->type == PTI_3D)
|
||||
|
|
Loading…
Reference in a new issue