From 21764358311adfe9ebde6418a70c93baa1f4afff Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 15 Apr 2021 18:02:16 +1000 Subject: [PATCH] - Duke: Replace sprite z pos numeric values with correct enum values for each game. --- source/games/duke/src/animatesprites_d.cpp | 4 ++-- source/games/duke/src/animatesprites_r.cpp | 4 ++-- source/games/duke/src/player.cpp | 2 +- source/games/duke/src/spawn.cpp | 2 +- source/games/duke/src/spawn_d.cpp | 2 +- source/games/duke/src/spawn_r.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index ec371975e..02436d078 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -178,7 +178,7 @@ void animatesprites_d(spritetype* tsprite, int& spritesortcnt, int x, int y, int t->x -= MulScale(MaxSmoothRatio - smoothratio, ps[s->yvel].posx - ps[s->yvel].oposx, 16); t->y -= MulScale(MaxSmoothRatio - smoothratio, ps[s->yvel].posy - ps[s->yvel].oposy, 16); t->z = interpolatedvalue(ps[s->yvel].oposz, ps[s->yvel].posz, smoothratio); - t->z += (40 << 8); + t->z += PHEIGHT_DUKE; } else if (s->picnum != CRANEPOLE) { @@ -330,7 +330,7 @@ void animatesprites_d(spritetype* tsprite, int& spritesortcnt, int x, int y, int { t->x = interpolatedvalue(omyx, myx, smoothratio); t->y = interpolatedvalue(omyy, myy, smoothratio); - t->z = interpolatedvalue(omyz, myz, smoothratio) + (40 << 8); + t->z = interpolatedvalue(omyz, myz, smoothratio) + PHEIGHT_DUKE; t->ang = interpolatedangle(omyang, myang, smoothratio).asbuild(); t->sectnum = mycursectnum; } diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index ebbdae136..37f903ccf 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -164,7 +164,7 @@ void animatesprites_r(spritetype* tsprite, int& spritesortcnt, int x, int y, int t->x -= MulScale(MaxSmoothRatio - smoothratio, ps[s->yvel].posx - ps[s->yvel].oposx, 16); t->y -= MulScale(MaxSmoothRatio - smoothratio, ps[s->yvel].posy - ps[s->yvel].oposy, 16); t->z = interpolatedvalue(ps[s->yvel].oposz, ps[s->yvel].posz, smoothratio); - t->z += (40 << 8); + t->z += PHEIGHT_RR; s->xrepeat = 24; s->yrepeat = 17; } @@ -376,7 +376,7 @@ void animatesprites_r(spritetype* tsprite, int& spritesortcnt, int x, int y, int { t->x = interpolatedvalue(omyx, myx, smoothratio); t->y = interpolatedvalue(omyy, myy, smoothratio); - t->z = interpolatedvalue(omyz, myz, smoothratio) + (40 << 8); + t->z = interpolatedvalue(omyz, myz, smoothratio) + PHEIGHT_RR; t->ang = interpolatedangle(omyang, myang, smoothratio).asbuild(); t->sectnum = mycursectnum; } diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 11f2e157c..9f642ed95 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -174,7 +174,7 @@ int hits(DDukeActor* actor) int zoff; DDukeActor* d; - if (sp->picnum == TILE_APLAYER) zoff = (40 << 8); + if (sp->picnum == TILE_APLAYER) zoff = isRR() ? PHEIGHT_RR : PHEIGHT_DUKE; else zoff = 0; hitscan(sp->x, sp->y, sp->z - zoff, sp->sectnum, bcos(sp->ang), bsin(sp->ang), 0, §, &hw, &d, &sx, &sy, &sz, CLIPMASK1); diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 11f64ca7d..7cf3f57ae 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -306,7 +306,7 @@ void spawntransporter(DDukeActor *actj, DDukeActor* acti, bool beam) { sp->xrepeat = 31; sp->yrepeat = 1; - sp->z = sector[spj->sectnum].floorz - (40 << 8); + sp->z = sector[spj->sectnum].floorz - isRR() ? PHEIGHT_RR : PHEIGHT_DUKE; } else { diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index e9bdd497d..bc861e7f1 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -210,7 +210,7 @@ int spawn_d(int j, int pn) case TONGUE: if(j >= 0) sp->ang = spj->ang; - sp->z -= 38<<8; + sp->z -= PHEIGHT_DUKE; sp->zvel = 256-(krand()&511); sp->xvel = 64-(krand()&127); changespritestat(i,4); diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index f6bfec5ed..4b8f2c4cc 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -293,7 +293,7 @@ int spawn_r(int j, int pn) case TONGUE: if(j >= 0) sp->ang = spj->ang; - sp->z -= 38<<8; + sp->z -= PHEIGHT_RR; sp->zvel = 256-(krand()&511); sp->xvel = 64-(krand()&127); changespritestat(i,4);