Set the "spritename" variable within R_AddSingleSpriteDef rather than externally to it, since R_InstallSpriteLump is the only place it gets used anyway
This way we don't have to make it some extern in order for r_skins.c to use it
This commit is contained in:
parent
37ecb47436
commit
e81ef824d6
|
@ -410,7 +410,7 @@ static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, ski
|
||||||
newlastlump++;
|
newlastlump++;
|
||||||
// load all sprite sets we are aware of... for super!
|
// load all sprite sets we are aware of... for super!
|
||||||
for (sprite2 = 0; sprite2 < free_spr2; sprite2++)
|
for (sprite2 = 0; sprite2 < free_spr2; sprite2++)
|
||||||
R_AddSingleSpriteDef((spritename = spr2names[sprite2]), &skin->sprites[FF_SPR2SUPER|sprite2], wadnum, newlastlump, *lastlump);
|
R_AddSingleSpriteDef(spr2names[sprite2], &skin->sprites[FF_SPR2SUPER|sprite2], wadnum, newlastlump, *lastlump);
|
||||||
|
|
||||||
newlastlump--;
|
newlastlump--;
|
||||||
*lastlump = newlastlump; // okay, make the normal sprite set loading end there
|
*lastlump = newlastlump; // okay, make the normal sprite set loading end there
|
||||||
|
@ -418,7 +418,7 @@ static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, ski
|
||||||
|
|
||||||
// load all sprite sets we are aware of... for normal stuff.
|
// load all sprite sets we are aware of... for normal stuff.
|
||||||
for (sprite2 = 0; sprite2 < free_spr2; sprite2++)
|
for (sprite2 = 0; sprite2 < free_spr2; sprite2++)
|
||||||
R_AddSingleSpriteDef((spritename = spr2names[sprite2]), &skin->sprites[sprite2], wadnum, *lump, *lastlump);
|
R_AddSingleSpriteDef(spr2names[sprite2], &skin->sprites[sprite2], wadnum, *lump, *lastlump);
|
||||||
|
|
||||||
if (skin->sprites[0].numframes == 0)
|
if (skin->sprites[0].numframes == 0)
|
||||||
I_Error("R_LoadSkinSprites: no frames found for sprite SPR2_%s\n", spr2names[0]);
|
I_Error("R_LoadSkinSprites: no frames found for sprite SPR2_%s\n", spr2names[0]);
|
||||||
|
|
|
@ -234,6 +234,8 @@ boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16
|
||||||
memset(sprtemp,0xFF, sizeof (sprtemp));
|
memset(sprtemp,0xFF, sizeof (sprtemp));
|
||||||
maxframe = (size_t)-1;
|
maxframe = (size_t)-1;
|
||||||
|
|
||||||
|
spritename = sprname;
|
||||||
|
|
||||||
// are we 'patching' a sprite already loaded ?
|
// are we 'patching' a sprite already loaded ?
|
||||||
// if so, it might patch only certain frames, not all
|
// if so, it might patch only certain frames, not all
|
||||||
if (spritedef->numframes) // (then spriteframes is not null)
|
if (spritedef->numframes) // (then spriteframes is not null)
|
||||||
|
@ -465,11 +467,10 @@ void R_AddSpriteDefs(UINT16 wadnum)
|
||||||
//
|
//
|
||||||
for (i = 0; i < numsprites; i++)
|
for (i = 0; i < numsprites; i++)
|
||||||
{
|
{
|
||||||
spritename = sprnames[i];
|
if (sprnames[i][4] && wadnum >= (UINT16)sprnames[i][4])
|
||||||
if (spritename[4] && wadnum >= (UINT16)spritename[4])
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (R_AddSingleSpriteDef(spritename, &sprites[i], wadnum, start, end))
|
if (R_AddSingleSpriteDef(sprnames[i], &sprites[i], wadnum, start, end))
|
||||||
{
|
{
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (rendermode == render_opengl)
|
if (rendermode == render_opengl)
|
||||||
|
@ -478,7 +479,7 @@ void R_AddSpriteDefs(UINT16 wadnum)
|
||||||
// if a new sprite was added (not just replaced)
|
// if a new sprite was added (not just replaced)
|
||||||
addsprites++;
|
addsprites++;
|
||||||
#ifndef ZDEBUG
|
#ifndef ZDEBUG
|
||||||
CONS_Debug(DBG_SETUP, "sprite %s set in pwad %d\n", spritename, wadnum);
|
CONS_Debug(DBG_SETUP, "sprite %s set in pwad %d\n", sprnames[i], wadnum);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue