Skip to content
Snippets Groups Projects
Commit ae748d6d authored by Lactozilla's avatar Lactozilla :speech_balloon:
Browse files

Fix patch generation

parent ce7f81c7
Branches
No related tags found
1 merge request!675PNG conversion refactoring
......@@ -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
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment