From 72df9c26d80f14e1cd27a74f89f4f5ccd9d811eb Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 11 Dec 2020 19:17:41 +0100 Subject: [PATCH] - Duke: fixed: SE31's handler overwrote the interpolation coordinates, which rendered interpolation ineffective. Also removing some redundant coordinate copying. Since we save all sprite coordinates at the start of a frame, there is no need to do the same again in the stat handlers. Fixes #237 --- source/games/duke/src/actors.cpp | 12 ++++++------ source/games/duke/src/actors_d.cpp | 14 -------------- source/games/duke/src/actors_r.cpp | 18 ------------------ 3 files changed, 6 insertions(+), 38 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index e577c3158..0edd16b79 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -3986,7 +3986,7 @@ void handle_se17(DDukeActor* actor) ps[p].truecz += q; if (numplayers > 1) ps[p].oposz = ps[p].posz; } - if (act1->s.statnum != 3) + if (act1->s.statnum != STAT_EFFECTOR) { act1->bposz = act1->s.z; act1->s.z += q; @@ -4052,7 +4052,7 @@ void handle_se17(DDukeActor* actor) changespritesect(act3, spr2->sectnum); ps[p].cursectnum = spr2->sectnum; } - else if (spr3->statnum != 3) + else if (spr3->statnum != STAT_EFFECTOR) { spr3->x += spr2->x - s->x; spr3->y += spr2->y - s->y; @@ -4871,7 +4871,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) ps[a2->PlayerIndex()].posz += l; if (a2->s.zvel == 0 && a2->s.statnum != STAT_EFFECTOR && (!choosedir || a2->s.statnum != STAT_PROJECTILE)) { - a2->bposz = a2->s.z += l; + a2->s.z += l; a2->floorz = sec->floorz; } } @@ -4900,7 +4900,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) ps[a2->PlayerIndex()].posz += l; if (a2->s.zvel == 0 && a2->s.statnum != STAT_EFFECTOR && (!choosedir || a2->s.statnum != STAT_PROJECTILE)) { - a2->bposz = a2->s.z += l; + a2->s.z += l; a2->floorz = sec->floorz; } } @@ -4931,7 +4931,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) ps[a2->PlayerIndex()].posz += l; if (a2->s.zvel == 0 && a2->s.statnum != STAT_EFFECTOR && (!choosedir || a2->s.statnum != STAT_PROJECTILE)) { - a2->bposz = a2->s.z += l; + a2->s.z += l; a2->floorz = sec->floorz; } } @@ -4959,7 +4959,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) ps[a2->PlayerIndex()].posz -= l; if (a2->s.zvel == 0 && a2->s.statnum != STAT_EFFECTOR && (!choosedir || a2->s.statnum != STAT_PROJECTILE)) { - a2->bposz = a2->s.z -= l; + a2->s.z -= l; a2->floorz = sec->floorz; } } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 3c9b81195..9ee3294b4 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -1435,10 +1435,6 @@ void movestandables_d(void) continue; } - act->bposx = act->s.x; - act->bposy = act->s.y; - act->bposz = act->s.z; - if (picnum >= CRANE && picnum <= CRANE +3) { @@ -1942,9 +1938,6 @@ void moveweapons_d(void) continue; } - act->bposx = act->s.x; - act->bposy = act->s.y; - act->bposz = act->s.z; switch(act->s.picnum) { @@ -3069,10 +3062,6 @@ void moveactors_d(void) int *t = &act->temp_data[0]; - act->bposx = s->x; - act->bposy = s->y; - act->bposz = s->z; - switch (s->picnum) { @@ -3293,9 +3282,6 @@ void moveexplosions_d(void) // STATNUM 5 continue; } - act->bposx = s->x; - act->bposy = s->y; - act->bposz = s->z; switch (s->picnum) { diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 8f2c5612e..99729622f 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -1006,11 +1006,6 @@ void movestandables_r(void) continue; } - act->bposx = act->s.x; - act->bposy = act->s.y; - act->bposz = act->s.z; - - if (picnum >= CRANE && picnum <= CRANE +3) { movecrane(act, CRANE); @@ -1520,10 +1515,6 @@ void moveweapons_r(void) continue; } - proj->bposx = proj->s.x; - proj->bposy = proj->s.y; - proj->bposz = proj->s.z; - switch (proj->s.picnum) { case RADIUSEXPLOSION: @@ -2882,11 +2873,6 @@ void moveactors_r(void) auto t = &act->temp_data[0]; - act->bposx = s->x; - act->bposy = s->y; - act->bposz = s->z; - - switch(s->picnum) { case RESPAWNMARKERRED: @@ -3153,10 +3139,6 @@ void moveexplosions_r(void) // STATNUM 5 continue; } - act->bposx = s->x; - act->bposy = s->y; - act->bposz = s->z; - switch (s->picnum) { case SHOTGUNSPRITE: