- use floats for internal SetActor(Z) functions.

This commit is contained in:
Christoph Oelckers 2022-08-22 23:49:25 +02:00
parent 00436bfdac
commit f002425aee
2 changed files with 14 additions and 19 deletions

View file

@ -447,21 +447,21 @@ void InitSpriteLists()
//
//==========================================================================
void SetActor(DCoreActor* actor, const vec3_t* newpos)
void SetActor(DCoreActor* actor, const DVector3& newpos)
{
auto tempsector = actor->sector();
actor->set_int_pos(*newpos);
updatesector(newpos->X, newpos->Y, &tempsector);
actor->spr.pos = newpos;
updatesector(newpos, &tempsector);
if (tempsector && tempsector != actor->sector())
ChangeActorSect(actor, tempsector);
}
void SetActorZ(DCoreActor* actor, const vec3_t* newpos)
void SetActorZ(DCoreActor* actor, const DVector3& newpos)
{
auto tempsector = actor->sector();
actor->set_int_pos(*newpos);
updatesectorz(newpos->X, newpos->Y, newpos->Z, &tempsector);
actor->spr.pos = newpos;
updatesectorz(newpos, &tempsector);
if (tempsector && tempsector != actor->sector())
ChangeActorSect(actor, tempsector);

View file

@ -530,24 +530,19 @@ int ChangeActorStat(DCoreActor* actor, int nStatus, bool forcetail = false);
void InitSpriteLists();
void SetActorZ(DCoreActor* actor, const vec3_t* newpos);
void SetActor(DCoreActor* actor, const vec3_t* newpos);
void SetActorZ(DCoreActor* actor, const DVector3& newpos);
void SetActor(DCoreActor* actor, const DVector3& newpos);
inline void SetActorZ(DCoreActor* actor, const vec3_t& newpos)
inline void SetActor(DCoreActor* actor, const vec3_t* newpos)
{
SetActorZ(actor, &newpos);
DVector3 ipos = { newpos->X * inttoworld, newpos->Y * inttoworld, newpos->Z * zinttoworld };
SetActor(actor, ipos);
}
inline void SetActor(DCoreActor* actor, const DVector3& newpos)
inline void SetActorZ(DCoreActor* actor, const vec3_t* newpos)
{
vec3_t ipos = { int(newpos.X * worldtoint), int(newpos.Y * worldtoint), int(newpos.Z * zworldtoint) };
SetActor(actor, &ipos);
}
inline void SetActorZ(DCoreActor* actor, const DVector3& newpos)
{
vec3_t ipos = { int(newpos.X * worldtoint), int(newpos.Y * worldtoint), int(newpos.Z * zworldtoint) };
SetActorZ(actor, &ipos);
DVector3 ipos = { newpos->X * inttoworld, newpos->Y * inttoworld, newpos->Z * zinttoworld };
SetActorZ(actor, ipos);
}
inline int clipmove(vec3_t& pos, sectortype** const sect, int xvect, int yvect,