mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Read PNG and patch header in one go for sprites
This commit is contained in:
parent
4f6121cef2
commit
84ccf18b76
1 changed files with 3 additions and 5 deletions
|
|
@ -284,14 +284,13 @@ boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16
|
||||||
// store sprite info in lookup tables
|
// store sprite info in lookup tables
|
||||||
//FIXME : numspritelumps do not duplicate sprite replacements
|
//FIXME : numspritelumps do not duplicate sprite replacements
|
||||||
|
|
||||||
|
W_ReadLumpHeaderPwad(wadnum, l, &patch, PNG_HEADER_SIZE, 0);
|
||||||
|
|
||||||
#ifndef NO_PNG_LUMPS
|
#ifndef NO_PNG_LUMPS
|
||||||
{
|
{
|
||||||
UINT8 header[PNG_HEADER_SIZE];
|
|
||||||
size_t len = W_LumpLengthPwad(wadnum, l);
|
size_t len = W_LumpLengthPwad(wadnum, l);
|
||||||
|
|
||||||
W_ReadLumpHeaderPwad(wadnum, l, header, sizeof header, 0);
|
if (Picture_IsLumpPNG((UINT8*)&patch, len))
|
||||||
|
|
||||||
if (Picture_IsLumpPNG(header, len))
|
|
||||||
{
|
{
|
||||||
UINT8 *png = W_CacheLumpNumPwad(wadnum, l, PU_STATIC);
|
UINT8 *png = W_CacheLumpNumPwad(wadnum, l, PU_STATIC);
|
||||||
Picture_PNGDimensions((UINT8 *)png, &width, &height, &topoffset, &leftoffset, len);
|
Picture_PNGDimensions((UINT8 *)png, &width, &height, &topoffset, &leftoffset, len);
|
||||||
|
|
@ -303,7 +302,6 @@ boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16
|
||||||
if (!isPNG)
|
if (!isPNG)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
W_ReadLumpHeaderPwad(wadnum, l, &patch, sizeof(INT16) * 4, 0);
|
|
||||||
width = (INT32)(SHORT(patch.width));
|
width = (INT32)(SHORT(patch.width));
|
||||||
height = (INT32)(SHORT(patch.height));
|
height = (INT32)(SHORT(patch.height));
|
||||||
topoffset = (INT16)(SHORT(patch.topoffset));
|
topoffset = (INT16)(SHORT(patch.topoffset));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue