game.c: factor out 2 inst. of dup. code into G_DoEventAnimSprites().

git-svn-id: https://svn.eduke32.com/eduke32@2892 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-08-13 18:26:11 +00:00
parent 27ebcc41b4
commit 0aec79ef8f

View file

@ -6061,6 +6061,16 @@ static int32_t adult_tile_p(int32_t pic)
return 0;
}
static void G_DoEventAnimSprites(int32_t j)
{
if (display_mirror) tsprite[j].statnum = TSPR_MIRROR;
if ((unsigned)tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS)
{
spriteext[tsprite[j].owner].tspr = &tsprite[j];
VM_OnEvent(EVENT_ANIMATESPRITES, tsprite[j].owner, myconnectindex, -1, 0);
}
}
#if 0 // def _MSC_VER
// Visual C thought this was a bit too hard to optimise so we'd better
// tell it not to try... such a pussy it is.
@ -6887,25 +6897,14 @@ skip:
if (apScriptGameEvent[EVENT_ANIMATESPRITES])
{
j = spritesortcnt-1;
do
{
if (display_mirror) tsprite[j].statnum = TSPR_MIRROR;
if (tsprite[j].owner < MAXSPRITES && tsprite[j].owner >= 0 && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS)
{
spriteext[tsprite[j].owner].tspr = (spritetype *)&tsprite[j];
VM_OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1, 0);
}
}
G_DoEventAnimSprites(j);
while (j--);
if (j < 0) return;
if (display_mirror) tsprite[j].statnum = TSPR_MIRROR;
if (tsprite[j].owner >= 0 && tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS)
{
spriteext[tsprite[j].owner].tspr = (spritetype *)&tsprite[j];
VM_OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1, 0);
}
G_DoEventAnimSprites(j);
}
}
#if 0 // def _MSC_VER