mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
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:
parent
8c5e3116c9
commit
3941fccc4c
3 changed files with 23 additions and 6 deletions
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue