Patch from Striker to improve sprite interpolation

git-svn-id: https://svn.eduke32.com/eduke32@8724 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2020-03-12 00:58:32 +00:00 committed by Christoph Oelckers
parent 8c5e3116c9
commit 3941fccc4c
3 changed files with 23 additions and 6 deletions

View file

@ -8581,6 +8581,24 @@ void G_RefreshLights(void)
#endif #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) static void G_DoEventGame(int const nEventID)
{ {
if (VM_HaveEvent(nEventID)) if (VM_HaveEvent(nEventID))
@ -8621,6 +8639,8 @@ void G_MoveWorld(void)
G_DoEventGame(EVENT_PREGAME); G_DoEventGame(EVENT_PREGAME);
G_RecordOldSpritePos();
G_MoveZombieActors(); //ST 2 G_MoveZombieActors(); //ST 2
G_MoveWeapons(); //ST 4 G_MoveWeapons(); //ST 4
G_MoveTransports(); //ST 9 G_MoveTransports(); //ST 9

View file

@ -3586,8 +3586,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) - t->z += mulscale16(smoothratio,ps->pos.z-ps->opos.z) -
(ps->dead_flag ? 0 : PHEIGHT) + PHEIGHT; (ps->dead_flag ? 0 : PHEIGHT) + PHEIGHT;
} }
else if ((pSprite->statnum == STAT_DEFAULT && pSprite->picnum != CRANEPOLE) || pSprite->statnum == STAT_PLAYER || else if (pSprite->picnum != CRANEPOLE)
pSprite->statnum == STAT_STANDABLE || pSprite->statnum == STAT_PROJECTILE || pSprite->statnum == STAT_MISC || pSprite->statnum == STAT_ACTOR)
{ {
t->x -= mulscale16(65536-smoothratio,pSprite->x-actor[i].bpos.x); t->x -= mulscale16(65536-smoothratio,pSprite->x-actor[i].bpos.x);
t->y -= mulscale16(65536-smoothratio,pSprite->y-actor[i].bpos.y); t->y -= mulscale16(65536-smoothratio,pSprite->y-actor[i].bpos.y);

View file

@ -665,11 +665,9 @@ GAMEEXEC_STATIC void VM_Move(void)
if (AC_MOVE_ID(vm.pData) == 0 || movflags == 0) 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)) if (deadflag)
{
vm.pActor->bpos.vec2 = vm.pSprite->pos.vec2;
setsprite(vm.spriteNum, &vm.pSprite->pos); setsprite(vm.spriteNum, &vm.pSprite->pos);
}
return; return;
} }