From 712d28ff40bb86915c4562af88097e8643cd37b8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 3 Sep 2022 10:47:36 +0200 Subject: [PATCH] - clean out some stuff --- source/build/src/clip.cpp | 12 ++++++------ source/core/coreactor.h | 7 ------- source/games/duke/src/player_d.cpp | 2 +- source/games/sw/src/game.h | 2 +- source/games/sw/src/player.cpp | 2 +- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 1431eb35c..d28d5e963 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -1133,7 +1133,9 @@ static inline void hit_set(HitInfoBase *hit, sectortype* sect, walltype* wal, DC hit->hitSector = sect; hit->hitWall = wal; hit->hitActor = actor; - hit->set_int_hitpos(x, y, z); + hit->hitpos.X = x * inttoworld; + hit->hitpos.Y = y * inttoworld; + hit->hitpos.Z = z * zinttoworld; } static int32_t hitscan_hitsectcf=-1; @@ -1212,7 +1214,8 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire if (startsect == nullptr) return -1; - hitinfo. set_int_hitpos_xy(hitscangoal.X, hitscangoal.Y); + hitinfo.hitpos.X = hitscangoal.X * inttoworld; + hitinfo.hitpos.Y = hitscangoal.Y * inttoworld; BFSSectorSearch search(startsect); while (auto sec = search.GetNext()) @@ -1282,10 +1285,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire auto v = hitinfo.int_hitpos(); if (try_facespr_intersect(actor, *sv, vx, vy, vz, &v, 0)) { - hitinfo.hitSector = sec; - hitinfo.hitWall = nullptr; - hitinfo.hitActor = actor; - hitinfo.set_int_hitpos(v.X, v.Y, v.Z); + hit_set(&hitinfo, sec, nullptr, actor, v.X, v.Y, v.Z); } break; diff --git a/source/core/coreactor.h b/source/core/coreactor.h index 5428bb7e1..822c47048 100644 --- a/source/core/coreactor.h +++ b/source/core/coreactor.h @@ -352,13 +352,6 @@ struct HitInfoBase return { int(hitpos.X * worldtoint), int(hitpos.Y * worldtoint), int(hitpos.Z * zworldtoint), }; } - void set_int_hitpos(int x, int y, int z) - { - hitpos.X = x * inttoworld; - hitpos.Y = y * inttoworld; - hitpos.Z = z * zinttoworld; - } - void set_int_hitpos_xy(int x, int y) { hitpos.X = x * inttoworld; diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 8bce38911..c0920b4f9 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -3039,7 +3039,7 @@ HORIZONLY: if (ud.clipping) { p->player_add_int_xy({ p->vel.X >> 14, p->vel.Y >> 14 }); - updatesector(p->player_int_pos().X, p->player_int_pos().Y, &p->cursector); + updatesector(p->pos, &p->cursector); ChangeActorSect(pact, p->cursector); } else diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 87142e525..c7bce63da 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -625,7 +625,7 @@ struct PLAYER DVector3 si; // save player interp position for PlayerSprite DAngle siang; - vec2_t vect, ovect, slide_vect; // these need floatification, but must be done together. + vec2_t vect, ovect, slide_vect; // these need floatification, but must be done together. vect is in 14.18 format! int friction; int16_t slide_ang; // todo: floatify int slide_dec; diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 2ae962d49..27bc63898 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -2001,7 +2001,7 @@ void DoPlayerMove(PLAYER* pp) pp->opos.XY() = pp->pos.XY(); } pp->add_int_ppos_XY({ pp->vect.X >> 14, pp->vect.Y >> 14 }); - updatesector(pp->int_ppos().X, pp->int_ppos().Y, §); + updatesector(pp->pos, §); if (sect != nullptr) pp->cursector = sect; }