From 3420032f02e69b585c79270c3ea5c18148a02895 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 2 Feb 2022 00:40:18 +0100 Subject: [PATCH] - replace most spr.pos in the global code. --- source/core/actorlist.cpp | 6 +++--- source/core/automap.cpp | 4 ++-- source/core/interpolate.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/core/actorlist.cpp b/source/core/actorlist.cpp index 7d8ce67b6..a3c15cc8d 100644 --- a/source/core/actorlist.cpp +++ b/source/core/actorlist.cpp @@ -366,7 +366,7 @@ DCoreActor* InsertActor(PClass* type, sectortype* sector, int stat, bool tail) void DCoreActor::OnDestroy() { - FVector3 pos = GetSoundPos(spr.pos); + FVector3 pos = GetSoundPos(int_pos()); soundEngine->RelinkSound(SOURCE_Actor, this, nullptr, &pos); // also scan all other sounds if they have this actor as source. If so, null the source and stop looped sounds. @@ -450,7 +450,7 @@ void InitSpriteLists() void SetActor(DCoreActor* actor, const vec3_t* newpos) { auto tempsector = actor->sector(); - actor->spr.pos = *newpos; + actor->set_int_pos(*newpos); updatesector(newpos->X, newpos->Y, &tempsector); if (tempsector && tempsector != actor->sector()) @@ -460,7 +460,7 @@ void SetActor(DCoreActor* actor, const vec3_t* newpos) void SetActorZ(DCoreActor* actor, const vec3_t* newpos) { auto tempsector = actor->sector(); - actor->spr.pos = *newpos; + actor->set_int_pos(*newpos); updatesectorz(newpos->X, newpos->Y, newpos->Z, &tempsector); if (tempsector && tempsector != actor->sector()) diff --git a/source/core/automap.cpp b/source/core/automap.cpp index 03e0292a2..38ddc33da 100644 --- a/source/core/automap.cpp +++ b/source/core/automap.cpp @@ -607,7 +607,7 @@ void renderDrawMapView(int cposx, int cposy, int czoom, int cang) { auto A = *(DCoreActor**)a; auto B = *(DCoreActor**)b; - if (A->spr.pos.Z != B->spr.pos.Z) return B->spr.pos.Z - A->spr.pos.Z; + if (A->int_pos().Z != B->int_pos().Z) return B->int_pos().Z - A->int_pos().Z; return A->time - B->time; // ensures stable sort. }); @@ -616,7 +616,7 @@ void renderDrawMapView(int cposx, int cposy, int czoom, int cang) { if (!gFullMap && !(actor->spr.cstat2 & CSTAT2_SPRITE_MAPPED)) continue; vec2_t pp[4]; - GetFlatSpritePosition(actor, actor->spr.pos.vec2, pp, true); + GetFlatSpritePosition(actor, actor->int_pos().vec2, pp, true); for (unsigned j = 0; j < 4; j++) { diff --git a/source/core/interpolate.cpp b/source/core/interpolate.cpp index 6b7dba8cd..50113b8cb 100644 --- a/source/core/interpolate.cpp +++ b/source/core/interpolate.cpp @@ -55,7 +55,7 @@ double Get(int index, DCoreActor* actor, int type) case Interp_Wall_PanX: return wall[index].xpan_; case Interp_Wall_PanY: return wall[index].ypan_; - case Interp_Sprite_Z: return !actor? 0 : actor->spr.pos.Z; + case Interp_Sprite_Z: return !actor? 0 : actor->int_pos().Z; default: return 0; } } @@ -79,7 +79,7 @@ void Set(int index, DCoreActor* actor, int type, double val) case Interp_Wall_PanX: wall[index].xpan_ = float(val); break; case Interp_Wall_PanY: wall[index].ypan_ = float(val); break; - case Interp_Sprite_Z: if (actor) actor->spr.pos.Z = xs_CRoundToInt(val); break; + case Interp_Sprite_Z: if (actor) actor->set_int_z(xs_CRoundToInt(val)); break; } }