From ac5ea2f1c967a8b6f1179fc72b6ef37ffd50d70e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 2 Nov 2020 23:10:19 +0100 Subject: [PATCH] - 3 more wrappers gone. --- source/games/duke/src/dispatch.cpp | 2 -- source/games/duke/src/duke3d.h | 1 - source/games/duke/src/dukeactor.h | 19 ------------------- source/games/duke/src/player_d.cpp | 6 +++--- source/games/duke/src/player_r.cpp | 8 ++++---- 5 files changed, 7 insertions(+), 29 deletions(-) diff --git a/source/games/duke/src/dispatch.cpp b/source/games/duke/src/dispatch.cpp index d8f31f59d..b19a80e46 100644 --- a/source/games/duke/src/dispatch.cpp +++ b/source/games/duke/src/dispatch.cpp @@ -141,7 +141,6 @@ void SetDispatcher() floorspace_d, addweapon_d, hitradius_d, - movesprite_d, lotsofmoney_d, lotsofmail_d, lotsofpaper_d, @@ -189,7 +188,6 @@ void SetDispatcher() floorspace_r, addweapon_r, hitradius_r, - movesprite_r, lotsoffeathers_r, lotsoffeathers_r, lotsoffeathers_r, diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index f6389be0c..17a513a12 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -87,7 +87,6 @@ struct Dispatcher bool (*floorspace)(int sectnum); void (*addweapon)(struct player_struct *p, int weapon); void (*hitradius)(DDukeActor* i, int r, int hp1, int hp2, int hp3, int hp4); - int (*movesprite)(int spritenum, int xchange, int ychange, int zchange, unsigned int cliptype); void (*lotsofmoney)(DDukeActor *s, short n); void (*lotsofmail)(DDukeActor *s, short n); void (*lotsofpaper)(DDukeActor *s, short n); diff --git a/source/games/duke/src/dukeactor.h b/source/games/duke/src/dukeactor.h index 2f13b40ae..0525f4f97 100644 --- a/source/games/duke/src/dukeactor.h +++ b/source/games/duke/src/dukeactor.h @@ -199,20 +199,6 @@ inline int ssp(int i, unsigned int cliptype) //The set sprite function int movesprite_ex_d(DDukeActor* actor, int xchange, int ychange, int zchange, unsigned int cliptype, Collision& result); int movesprite_ex_r(DDukeActor* actor, int xchange, int ychange, int zchange, unsigned int cliptype, Collision& result); -inline int movesprite_d(int actor, int xchange, int ychange, int zchange, unsigned int cliptype) -{ - Collision c; - movesprite_ex_d(&hittype[actor], xchange, ychange, zchange, cliptype, c); - return c.legacyVal; -} - -inline int movesprite_r(int actor, int xchange, int ychange, int zchange, unsigned int cliptype) -{ - Collision c; - movesprite_ex_r(&hittype[actor], xchange, ychange, zchange, cliptype, c); - return c.legacyVal; -} - inline int movesprite_ex(DDukeActor* actor, int xchange, int ychange, int zchange, unsigned int cliptype, Collision& result) { auto f = isRR() ? movesprite_ex_r : movesprite_ex_d; @@ -233,11 +219,6 @@ inline void getzrange_ex(int x, int y, int z, int16_t sectnum, int32_t* ceilz, C florhit.setFromEngine(fh); } -inline int findplayer(spritetype* act, int* x) -{ - return findplayer(&hittype[act - sprite], x); -} - inline int hitscan(int x, int y, int z, int16_t sectnum, int32_t vx, int32_t vy, int32_t vz, short* hitsect, short* hitwall, DDukeActor** hitspr, int* hitx, int* hity, int* hitz, uint32_t cliptype) { diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 3d5a9b6a9..787990679 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -107,7 +107,7 @@ static void shootfireball(DDukeActor *actor, int p, int sx, int sy, int sz, int { sa += 16 - (krand() & 31); int scratch; - int j = findplayer(s, &scratch); + int j = findplayer(actor, &scratch); zvel = (((ps[j].oposz - sz + (3 << 8))) * vel) / ldist(ps[j].GetActor(), actor); } else @@ -245,7 +245,7 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa) else { int x; - auto pactor = ps[findplayer(s, &x)].GetActor(); + auto pactor = ps[findplayer(actor, &x)].GetActor(); zvel = ((pactor->s.z - sz) << 8) / (x + 1); sa = getangle(pactor->s.x - sx, pactor->s.y - sy); } @@ -952,7 +952,7 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int else { int x; - int j = findplayer(s, &x); + int j = findplayer(actor, &x); sz -= (4 << 8); zvel = ((ps[j].posz - sz) << 8) / (ldist(ps[p].GetActor(), actor)); zvel += 128 - (krand() & 255); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 0e58ca586..b31aa4489 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -106,7 +106,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, else { int x; - auto pspr = ps[findplayer(s, &x)].GetActor(); + auto pspr = ps[findplayer(actor, &x)].GetActor(); zvel = ((pspr->s.z - sz) << 8) / (x + 1); sa = getangle(pspr->s.x - sx, pspr->s.y - sy); } @@ -528,7 +528,7 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, else { int x; - int j = findplayer(s, &x); + int j = findplayer(actor, &x); // sa = getangle(ps[j].oposx-sx,ps[j].oposy-sy); if (s->picnum == HULK) sa -= (krand() & 31); @@ -651,7 +651,7 @@ static void shootrpg(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i else { int x; - int j = findplayer(s, &x); + int j = findplayer(actor, &x); sa = getangle(ps[j].oposx - sx, ps[j].oposy - sy); if (s->picnum == BOSS3) sz -= (32 << 8); @@ -795,7 +795,7 @@ static void shootwhip(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, else { int x; - int j = findplayer(s, &x); + int j = findplayer(actor, &x); // sa = getangle(ps[j].oposx-sx,ps[j].oposy-sy); if (s->picnum == VIXEN) sa -= (krand() & 16);