mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 13:21:10 +00:00
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:
parent
0487558a98
commit
cb0c31fa9a
2 changed files with 10 additions and 32 deletions
14
src/p_spec.c
14
src/p_spec.c
|
@ -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;
|
||||||
|
|
28
src/w_wad.c
28
src/w_wad.c
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue