Fix patch generation

This commit is contained in:
Jaime Passos 2020-01-07 19:00:57 -03:00
parent ce7f81c78d
commit ae748d6d5c
2 changed files with 11 additions and 1 deletions

View file

@ -708,7 +708,8 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm
{
// Dummy variables.
INT32 pngwidth, pngheight;
patch = (patch_t *)Picture_PNGConvert((const UINT8 *)patch, PICFMT_PATCH, &pngwidth, &pngheight, NULL, NULL, len, NULL, 0);
INT16 topoffset, leftoffset;
patch = (patch_t *)Picture_PNGConvert((const UINT8 *)patch, PICFMT_PATCH, &pngwidth, &pngheight, &topoffset, &leftoffset, len, NULL, 0);
}
#endif

View file

@ -1478,6 +1478,15 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp
patch = (patch_t *)W_CacheLumpNum(lump, PU_STATIC);
lumplength = W_LumpLength(lump);
#ifndef NO_PNG_LUMPS
if (Picture_IsLumpPNG((const UINT8 *)patch, lumplength))
{
INT32 pngwidth, pngheight;
INT16 topoffset, leftoffset;
patch = (patch_t *)Picture_PNGConvert((const UINT8 *)patch, PICFMT_PATCH, &pngwidth, &pngheight, &topoffset, &leftoffset, lumplength, NULL, 0);
}
else
#endif
// Because there's something wrong with SPR_DFLM, I guess
if (!Picture_CheckIfPatch(patch, lumplength))
return;