Commit 5793cd04 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

Patch from Striker to improve sprite interpolation

From-SVN: r8724
parent 668a29af
......@@ -8609,6 +8609,24 @@ void G_RefreshLights(void)
#endif
}
static void G_RecordOldSpritePos(void)
{
int statNum = 0;
do
{
int spriteNum = headspritestat[statNum++];
while (spriteNum >= 0)
{
int const nextSprite = nextspritestat[spriteNum];
actor[spriteNum].bpos = sprite[spriteNum].pos;
spriteNum = nextSprite;
}
}
while (statNum < MAXSTATUS);
}
static void G_DoEventGame(int const nEventID)
{
if (VM_HaveEvent(nEventID))
......@@ -8649,6 +8667,8 @@ void G_MoveWorld(void)
G_DoEventGame(EVENT_PREGAME);
G_RecordOldSpritePos();
G_MoveZombieActors(); //ST 2
G_MoveWeapons(); //ST 4
G_MoveTransports(); //ST 9
......
......@@ -3777,8 +3777,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura
t->z += mulscale16(smoothratio,ps->pos.z-ps->opos.z) -
(ps->dead_flag ? 0 : PHEIGHT) + PHEIGHT;
}
else if ((pSprite->statnum == STAT_DEFAULT && pSprite->picnum != CRANEPOLE) || pSprite->statnum == STAT_PLAYER ||
pSprite->statnum == STAT_STANDABLE || pSprite->statnum == STAT_PROJECTILE || pSprite->statnum == STAT_MISC || pSprite->statnum == STAT_ACTOR)
else if (pSprite->picnum != CRANEPOLE)
{
t->x -= mulscale16(65536-smoothratio,pSprite->x-actor[i].bpos.x);
t->y -= mulscale16(65536-smoothratio,pSprite->y-actor[i].bpos.y);
......
......@@ -652,11 +652,9 @@ GAMEEXEC_STATIC void VM_Move(void)
if (AC_MOVE_ID(vm.pData) == 0 || movflags == 0)
{
if (deadflag || (vm.pActor->bpos.x != vm.pSprite->x) || (vm.pActor->bpos.y != vm.pSprite->y))
{
vm.pActor->bpos.vec2 = vm.pSprite->pos.vec2;
if (deadflag)
setsprite(vm.spriteNum, &vm.pSprite->pos);
}
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment