mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-05-31 08:51:03 +00:00
A bit more work on PK3.
-Expanded folder recognition for PK3s. Some resources are still not loaded from them yet. -Took a glimpse at how maps are loaded, since the flat recognition is rooted somewhere there; did nothing yet about it though. -Working towards "generalizing" how new resources are handled. Some var and functionality redundancy is still present.
This commit is contained in:
parent
b60010f0f1
commit
8ef6d6fd9e
6 changed files with 200 additions and 54 deletions
|
@ -368,6 +368,38 @@ static boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef,
|
|||
return true;
|
||||
}
|
||||
|
||||
// Auxiliary function for PK3 loading - Loads sprites from a specified range.
|
||||
void R_LoadSpritsRange(UINT16 wadnum, UINT16 first, UINT16 num)
|
||||
{
|
||||
size_t i, addsprites = 0;
|
||||
char wadname[MAX_WADPATH];
|
||||
//
|
||||
// scan through lumps, for each sprite, find all the sprite frames
|
||||
//
|
||||
for (i = 0; i < numsprites; i++)
|
||||
{
|
||||
spritename = sprnames[i];
|
||||
if (spritename[4] && wadnum >= (UINT16)spritename[4])
|
||||
continue;
|
||||
|
||||
if (R_AddSingleSpriteDef(spritename, &sprites[i], wadnum, first, first + num + 1))
|
||||
{
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
HWR_AddSpriteMD2(i);
|
||||
#endif
|
||||
// if a new sprite was added (not just replaced)
|
||||
addsprites++;
|
||||
#ifndef ZDEBUG
|
||||
CONS_Debug(DBG_SETUP, "sprite %s set in pwad %d\n", spritename, wadnum);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
nameonly(strcpy(wadname, wadfiles[wadnum]->filename));
|
||||
CONS_Printf(M_GetText("%s added %d frames in %s sprites\n"), wadname, num, sizeu1(addsprites));
|
||||
}
|
||||
|
||||
//
|
||||
// Search for sprites replacements in a wad whose names are in namelist
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue