diff --git a/source/games/duke/src/animatesprites.cpp b/source/games/duke/src/animatesprites.cpp index f34af7c9f..9ab7d670b 100644 --- a/source/games/duke/src/animatesprites.cpp +++ b/source/games/duke/src/animatesprites.cpp @@ -98,12 +98,12 @@ void applyanimations(tspritetype* t, DDukeActor* h, const DVector2& viewVec, DAn else switch (l) { case 2: - k = angletorotation1(h->spr.Angles.Yaw, viewang, 8, 1); + k = angletorotation1(t->Angles.Yaw, viewang, 8, 1); break; case 3: case 4: - k = angletorotation1(h->spr.Angles.Yaw, viewang, 7); + k = angletorotation1(t->Angles.Yaw, viewang, 7); if (k > 3) { t->cstat |= CSTAT_SPRITE_XFLIP; @@ -113,8 +113,8 @@ void applyanimations(tspritetype* t, DDukeActor* h, const DVector2& viewVec, DAn break; case 5: - kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation1(h->spr.Angles.Yaw, kang); + kang = (t->pos.XY() - viewVec).Angle(); + k = angletorotation1(t->Angles.Yaw, kang); if (k > 4) { k = 8 - k; @@ -123,8 +123,8 @@ void applyanimations(tspritetype* t, DDukeActor* h, const DVector2& viewVec, DAn else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 7: - kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation2(h->spr.Angles.Yaw, kang); + kang = (t->pos.XY() - viewVec).Angle(); + k = angletorotation2(t->Angles.Yaw, kang); if (k > 6) { k = 12 - k; @@ -133,7 +133,7 @@ void applyanimations(tspritetype* t, DDukeActor* h, const DVector2& viewVec, DAn else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 8: - k = angletorotation1(h->spr.Angles.Yaw, viewang); + k = angletorotation1(t->Angles.Yaw, viewang); t->cstat &= ~CSTAT_SPRITE_XFLIP; break; default: @@ -142,8 +142,8 @@ void applyanimations(tspritetype* t, DDukeActor* h, const DVector2& viewVec, DAn bool bg = badguy(h); if (bg && h->spr.statnum == 2 && h->spr.extra > 0) { - kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation1(h->spr.Angles.Yaw, kang); + kang = (t->pos.XY() - viewVec).Angle(); + k = angletorotation1(t->Angles.Yaw, kang); if (k > 4) { k = 8 - k; diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 05ddbf14c..ed6b6eec5 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -93,17 +93,9 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi if (t->statnum == STAT_TEMP) continue; auto pp = &ps[h->PlayerIndex()]; - if (h->spr.statnum != STAT_ACTOR && h->isPlayer() && pp->newOwner == nullptr && h->GetOwner()) + if ((h->spr.statnum != STAT_ACTOR && h->isPlayer() && pp->newOwner == nullptr && h->GetOwner()) || !actorflag(h, SFLAG_NOINTERPOLATE)) { t->pos = h->interpolatedpos(interpfrac); - } - else if (!actorflag(h, SFLAG_NOINTERPOLATE)) - { - t->pos = h->interpolatedpos(interpfrac); - } - - if (actorflag(h, SFLAG2_INTERPOLATEANGLE)) - { t->Angles.Yaw = h->interpolatedyaw(interpfrac); } @@ -229,7 +221,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi } else { - k = angletorotation1(h->spr.Angles.Yaw, viewang); + k = angletorotation1(t->Angles.Yaw, viewang); if (k > 4) { k = 8 - k; diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index 2195597ab..5ad4d5c7e 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -88,15 +88,12 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi if (h->spr.statnum != STAT_ACTOR && h->isPlayer() && pp->newOwner == nullptr && h->GetOwner()) { t->pos = h->interpolatedpos(interpfrac); + t->Angles.Yaw = h->interpolatedyaw(interpfrac); h->spr.scale = DVector2(0.375, 0.265625); } else if (!actorflag(h, SFLAG_NOINTERPOLATE)) { t->pos = h->interpolatedpos(interpfrac); - } - - if (actorflag(h, SFLAG2_INTERPOLATEANGLE)) - { t->Angles.Yaw = h->interpolatedyaw(interpfrac); } @@ -223,7 +220,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi t->cstat &= ~CSTAT_SPRITE_XFLIP; } else { - k = angletorotation1(h->spr.Angles.Yaw, viewang); + k = angletorotation1(t->Angles.Yaw, viewang); if (k > 4) { k = 8 - k; diff --git a/source/games/duke/src/constants.h b/source/games/duke/src/constants.h index 43a1c3f75..2b1ac4917 100644 --- a/source/games/duke/src/constants.h +++ b/source/games/duke/src/constants.h @@ -366,7 +366,7 @@ enum sflags2_t SFLAG2_BREAKMIRRORS = 0x00000080, SFLAG2_CAMERA = 0x00000100, SFLAG2_DONTANIMATE = 0x00000200, - SFLAG2_INTERPOLATEANGLE = 0x00000400, + //SFLAG2_INTERPOLATEANGLE = 0x00000400, SFLAG2_GREENBLOOD = 0x00000800, SFLAG2_ALWAYSROTATE1 = 0x00001000, SFLAG2_DIENOW = 0x00002000, diff --git a/source/games/duke/src/flags_d.cpp b/source/games/duke/src/flags_d.cpp index dea9f5910..c646a3522 100644 --- a/source/games/duke/src/flags_d.cpp +++ b/source/games/duke/src/flags_d.cpp @@ -154,7 +154,7 @@ void initactorflags_d() setflag(SFLAG2_BREAKMIRRORS, { DTILE_RADIUSEXPLOSION, DTILE_RPG, DTILE_HYDRENT, DTILE_HEAVYHBOMB, DTILE_SEENINE, DTILE_OOZFILTER, DTILE_EXPLODINGBARREL }); setflag(SFLAG2_CAMERA, { DTILE_CAMERA1 }); setflag(SFLAG2_DONTANIMATE, { DTILE_TRIPBOMB, DTILE_LASERLINE }); - setflag(SFLAG2_INTERPOLATEANGLE, { DTILE_BEARINGPLATE }); + //setflag(SFLAG2_INTERPOLATEANGLE, { DTILE_BEARINGPLATE }); setflag(SFLAG2_GREENBLOOD, { DTILE_OOZFILTER, DTILE_NEWBEAST, DTILE_NUKEBARREL }); setflag(SFLAG2_ALWAYSROTATE1, { DTILE_RAT, DTILE_CAMERA1, DTILE_CHAIR3 }); setflag(SFLAG2_ALWAYSROTATE2, { DTILE_RPG }); diff --git a/wadsrc/static/zscript/games/duke/dukeactor.zs b/wadsrc/static/zscript/games/duke/dukeactor.zs index e0fd9bd1c..8cb51f034 100644 --- a/wadsrc/static/zscript/games/duke/dukeactor.zs +++ b/wadsrc/static/zscript/games/duke/dukeactor.zs @@ -388,7 +388,7 @@ enum sflags2_t SFLAG2_BREAKMIRRORS = 0x00000080, SFLAG2_CAMERA = 0x00000100, SFLAG2_DONTANIMATE = 0x00000200, - SFLAG2_INTERPOLATEANGLE = 0x00000400, + //SFLAG2_INTERPOLATEANGLE = 0x00000400, SFLAG2_GREENBLOOD = 0x00000800, SFLAG2_ALWAYSROTATE1 = 0x00001000, SFLAG2_DIENOW = 0x00002000,