mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- use texture IDs in the sprite animator
This commit is contained in:
parent
cc83438e31
commit
bfc8862071
1 changed files with 11 additions and 5 deletions
|
@ -187,21 +187,27 @@ void applyanimations(tspritetype* t, DDukeActor* h, const DVector2& viewVec, DAn
|
||||||
}
|
}
|
||||||
|
|
||||||
k += action->offset + l * h->curframe;
|
k += action->offset + l * h->curframe;
|
||||||
t->picnum += k;
|
int texid = t->spritetexture().GetIndex() + k; // we cannot work with texture IDs here because their arithmetics are limited.
|
||||||
|
|
||||||
if (isRRRA() && RRRAFullbrightHack(t, k)) t->shade = -127;
|
if (isRRRA() && RRRAFullbrightHack(t, k)) t->shade = -127;
|
||||||
|
|
||||||
|
FGameTexture* tex = TexMan.GameByIndex(texid);
|
||||||
if (l > 0)
|
if (l > 0)
|
||||||
{
|
{
|
||||||
while (t->picnum >= 0 && t->picnum < MAXTILES && !tileGetTexture(t->picnum)->isValid())
|
while(1)
|
||||||
t->picnum -= l; //back up one frame if this one is invald.
|
{
|
||||||
|
if (!tex || tex->isValid()) break;
|
||||||
|
texid -= l; //back up one frame if this one is invald.
|
||||||
|
tex = TexMan.GameByIndex(texid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t->picnum < 0 || t->picnum >= MAXTILES)
|
if (!tex)
|
||||||
{
|
{
|
||||||
t->picnum = 0;
|
t->setspritetexture(FNullTextureID());
|
||||||
t->scale = DVector2(0, 0);
|
t->scale = DVector2(0, 0);
|
||||||
}
|
}
|
||||||
|
else t->setspritetexture(tex->GetID());
|
||||||
|
|
||||||
if (h->dispictex.isValid())
|
if (h->dispictex.isValid())
|
||||||
h->dispictex = t->spritetexture();
|
h->dispictex = t->spritetexture();
|
||||||
|
|
Loading…
Reference in a new issue