From 7676958f40dcd3f21f9e3dc867d24003b5f42b19 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Dec 2021 11:28:09 +0100 Subject: [PATCH] - changed try_facespr_intersect's sprite argument to DCoreActor. --- source/build/include/build.h | 2 +- source/build/src/clip.cpp | 10 +++++----- source/build/src/engine.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index d1fb85624..24f80e227 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -263,7 +263,7 @@ void neartag(const vec3_t& pos, sectortype* sect, int angle, HitInfoBase& result int cansee(int x1, int y1, int z1, sectortype* sect1, int x2, int y2, int z2, sectortype* sect2); int32_t inside(int32_t x, int32_t y, const sectortype* sectnum); -int32_t try_facespr_intersect(uspriteptr_t const spr, vec3_t const in, +int32_t try_facespr_intersect(DCoreActor* spr, vec3_t const in, int32_t vx, int32_t vy, int32_t vz, vec3_t * const intp, int32_t strictly_smaller_than_p); diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 718fa03af..a74b61f05 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -1219,11 +1219,11 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas // intp: point of currently best (closest) intersection -int32_t try_facespr_intersect(uspriteptr_t const spr, vec3_t const in, +int32_t try_facespr_intersect(DCoreActor* spr, vec3_t const in, int32_t vx, int32_t vy, int32_t vz, vec3_t * const intp, int32_t strictly_smaller_than_p) { - vec3_t const sprpos = spr->pos; + vec3_t const sprpos = spr->spr.pos; int32_t const topt = vx * (sprpos.X - in.X) + vy * (sprpos.Y - in.Y); @@ -1235,7 +1235,7 @@ int32_t try_facespr_intersect(uspriteptr_t const spr, vec3_t const in, vec3_t newpos = { 0, 0, in.Z + Scale(vz, topt, bot) }; int32_t siz; - int32_t const z1 = sprpos.Z + spriteheightofsptr(spr, &siz, 1); + int32_t const z1 = sprpos.Z + spriteheightofsptr(&spr->spr, &siz, 1); if (newpos.Z < z1 - siz || newpos.Z > z1) return 0; @@ -1244,7 +1244,7 @@ int32_t try_facespr_intersect(uspriteptr_t const spr, vec3_t const in, vec2_t const off = { Scale(vx, topu, bot), Scale(vy, topu, bot) }; int32_t const dist = off.X * off.X + off.Y * off.Y; - siz = tileWidth(spr->picnum) * spr->xrepeat; + siz = tileWidth(spr->spr.picnum) * spr->spr.xrepeat; if (dist > MulScale(siz, siz, 7)) return 0; @@ -1420,7 +1420,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire { case 0: { - if (try_facespr_intersect(spr, *sv, vx, vy, vz, &hitinfo.hitpos, 0)) + if (try_facespr_intersect(actor, *sv, vx, vy, vz, &hitinfo.hitpos, 0)) { hitinfo.hitSector = sec; hitinfo.hitWall = nullptr; diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index f05e95699..8a4b5e946 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -597,7 +597,7 @@ void neartag(const vec3_t& sv, sectortype* sect, int ange, HitInfoBase& result, if (((tagsearch&1) && actor->spr.lotag) || ((tagsearch&2) && actor->spr.hitag)) { - if (try_facespr_intersect(&actor->spr, sv, vx, vy, 0, &hitv, 1)) + if (try_facespr_intersect(actor, sv, vx, vy, 0, &hitv, 1)) { result.hitActor = actor; result.hitpos.X = DMulScale(hitv.X-sv.X, bcos(ange), hitv.Y-sv.Y, bsin(ange), 14);