Final touches

-Backported multiple per-wad/pk3 ANIMDEFS supported now, just like TEXTURES.
-Removed now-unused function.

Signed-off-by: Nev3r <apophycens@gmail.com>
This commit is contained in:
Nev3r 2018-11-24 09:26:52 +01:00
parent 0487558a98
commit cb0c31fa9a
2 changed files with 10 additions and 32 deletions

View file

@ -279,10 +279,16 @@ void P_InitPicAnims(void)
Z_Free(animatedLump); Z_Free(animatedLump);
} }
// Now find ANIMDEFS for (w = numwadfiles-1; w >= 0; w--)
animdefsLumpNum = W_CheckNumForNamePwad("ANIMDEFS", w, 0); {
if (animdefsLumpNum != INT16_MAX) // Find ANIMDEFS lump in the WAD
P_ParseANIMDEFSLump(w, animdefsLumpNum); animdefsLumpNum = W_CheckNumForNamePwad("ANIMDEFS", w, 0);
while (animdefsLumpNum != INT16_MAX)
{
P_ParseANIMDEFSLump(w, animdefsLumpNum);
animdefsLumpNum = W_CheckNumForNamePwad("ANIMDEFS", (UINT16)w, animdefsLumpNum + 1);
}
}
} }
// Define the last one // Define the last one
animdefs[maxanims].istexture = -1; animdefs[maxanims].istexture = -1;

View file

@ -753,8 +753,6 @@ else if (!stricmp(&filename[strlen(filename) - 4], ".pk3"))
} }
W_InvalidateLumpnumCache(); W_InvalidateLumpnumCache();
CONS_Printf("Ended function.\n");
return wadfile->numlumps; return wadfile->numlumps;
} }
@ -1103,32 +1101,6 @@ boolean W_IsLumpWad(lumpnum_t lumpnum)
return false; // WADs should never be inside non-PK3s as far as SRB2 is concerned return false; // WADs should never be inside non-PK3s as far as SRB2 is concerned
} }
/** Reads bytes from the head of a lump, without doing decompression.
*
* \param wad Wad number to read from.
* \param lump Lump number to read from, within wad.
* \param dest Buffer in memory to serve as destination.
* \param size Number of bytes to read.
* \param offest Number of bytes to offset.
* \return Number of bytes read (should equal size).
* \sa W_ReadLumpHeader
*/
static size_t W_RawReadLumpHeader(UINT16 wad, UINT16 lump, void *dest, size_t size, size_t offset)
{
size_t bytesread;
lumpinfo_t *l;
FILE *handle;
l = wadfiles[wad]->lumpinfo + lump;
handle = wadfiles[wad]->handle;
fseek(handle, (long)(l->position + offset), SEEK_SET);
bytesread = fread(dest, 1, size, handle);
return bytesread;
}
/* report a zlib or i/o error */ /* report a zlib or i/o error */
void zerr(int ret) void zerr(int ret)
{ {