mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-20 08:00:56 +00:00
- floatified DBloodActor::basePoint.
This commit is contained in:
parent
a860a21bde
commit
9bac3b8857
12 changed files with 25 additions and 27 deletions
|
@ -6223,7 +6223,7 @@ DBloodActor* actSpawnSprite(DBloodActor* source, int nStat)
|
|||
{
|
||||
DBloodActor* actor = InsertSprite(source->sector(), nStat);
|
||||
|
||||
actor->set_int_pos(source->int_pos());
|
||||
actor->spr.pos = source->spr.pos;
|
||||
actor->vel = source->vel;
|
||||
actor->spr.flags = 0;
|
||||
actor->addX();
|
||||
|
@ -6653,7 +6653,7 @@ bool actCheckRespawn(DBloodActor* actor)
|
|||
if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax))
|
||||
{
|
||||
actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
actor->set_int_pos(actor->basePoint);
|
||||
actor->spr.pos = actor->basePoint;
|
||||
}
|
||||
evPostActor(actor, nRespawnTime, kCallbackRespawn);
|
||||
}
|
||||
|
|
|
@ -86,6 +86,10 @@ void aiMoveTurn(DBloodActor*pXSprite);
|
|||
void aiMoveDodge(DBloodActor *actor);
|
||||
void aiActivateDude(DBloodActor *actor);
|
||||
void aiSetTarget(DBloodActor* pXSprite, int x, int y, int z);
|
||||
inline void aiSetTarget(DBloodActor* ac, const DVector3& pos)
|
||||
{
|
||||
aiSetTarget(ac, int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint));
|
||||
}
|
||||
void aiSetTarget(DBloodActor* actor, DBloodActor* target);
|
||||
int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType, int nDamage);
|
||||
void aiThinkTarget(DBloodActor* actor);
|
||||
|
|
|
@ -86,8 +86,7 @@ static void batThinkTarget(DBloodActor* actor)
|
|||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
actor->xspr.goalAng += 256;
|
||||
POINT3D* pTarget = &actor->basePoint;
|
||||
aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z);
|
||||
aiSetTarget(actor, actor->basePoint);
|
||||
aiNewState(actor, &batTurn);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -98,8 +98,7 @@ static void eelThinkTarget(DBloodActor* actor)
|
|||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
actor->xspr.goalAng += 256;
|
||||
POINT3D* pTarget = &actor->basePoint;
|
||||
aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z);
|
||||
aiSetTarget(actor, actor->basePoint);
|
||||
aiNewState(actor, &eelTurn);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -244,8 +244,7 @@ static void cerberusThinkTarget(DBloodActor* actor)
|
|||
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
||||
{
|
||||
actor->xspr.goalAng += 256;
|
||||
POINT3D* pTarget = &actor->basePoint;
|
||||
aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z);
|
||||
aiSetTarget(actor, actor->basePoint);
|
||||
if (actor->spr.type == kDudeCerberusTwoHead)
|
||||
aiNewState(actor, &cerberus139890);
|
||||
else
|
||||
|
|
|
@ -207,8 +207,7 @@ static void gargThinkTarget(DBloodActor* actor)
|
|||
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
||||
{
|
||||
actor->xspr.goalAng += 256;
|
||||
POINT3D* pTarget = &actor->basePoint;
|
||||
aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z);
|
||||
aiSetTarget(actor, actor->basePoint);
|
||||
aiNewState(actor, &gargoyleTurn);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -187,8 +187,7 @@ static void ghostThinkTarget(DBloodActor* actor)
|
|||
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
||||
{
|
||||
actor->xspr.goalAng += 256;
|
||||
POINT3D* pTarget = &actor->basePoint;
|
||||
aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z);
|
||||
aiSetTarget(actor, actor->basePoint);
|
||||
aiNewState(actor, &ghostTurn);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -214,8 +214,7 @@ static void sub_725A4(DBloodActor* actor)
|
|||
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
||||
{
|
||||
actor->xspr.goalAng += 256;
|
||||
POINT3D* pTarget = &actor->basePoint;
|
||||
aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z);
|
||||
aiSetTarget(actor, actor->basePoint);
|
||||
aiNewState(actor, &tcherno13AA28);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
GENDUDEEXTRA genDudeExtra;
|
||||
TObjPtr<DBloodActor*> prevmarker; // needed by the nnext marker code. This originally hijacked targetX in XSPRITE
|
||||
TObjPtr<DBloodActor*> ownerActor; // was previously stored in the sprite's owner field.
|
||||
POINT3D basePoint;
|
||||
DVector3 basePoint;
|
||||
EventObject condition[2];
|
||||
bool explosionhackflag; // this originally hijacked the target field which is not safe when working with pointers.
|
||||
|
||||
|
|
|
@ -298,7 +298,7 @@ void Respawn(DBloodActor* actor, sectortype*) // 9
|
|||
if (actor->IsDudeActor())
|
||||
{
|
||||
int nType = actor->spr.type - kDudeBase;
|
||||
actor->set_int_pos(actor->basePoint);
|
||||
actor->spr.pos = actor->basePoint;
|
||||
actor->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL;
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
if (!gModernMap || actor->xspr.sysData2 <= 0) actor->xspr.health = dudeInfo[actor->spr.type - kDudeBase].startHealth << 4;
|
||||
|
|
|
@ -929,12 +929,12 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
|
|||
break;
|
||||
}
|
||||
|
||||
x = actor->basePoint.X;
|
||||
y = actor->basePoint.Y;
|
||||
x = int(actor->basePoint.X * worldtoint);
|
||||
y = int(actor->basePoint.Y * worldtoint);
|
||||
if (actor->spr.cstat & CSTAT_SPRITE_MOVE_FORWARD)
|
||||
{
|
||||
if (ang)
|
||||
RotatePoint((int*)&x, (int*)&y, ang, a4, a5);
|
||||
RotatePoint(&x, &y, ang, a4, a5);
|
||||
viewBackupSpriteLoc(actor);
|
||||
actor->spr.ang = (actor->spr.ang + v14) & 2047;
|
||||
actor->set_int_xy(x + vc - a4, y + v8 - a5);
|
||||
|
@ -981,8 +981,8 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
|
|||
if (ac == nullptr)
|
||||
continue;
|
||||
|
||||
x = ac->basePoint.X;
|
||||
y = ac->basePoint.Y;
|
||||
x = int(ac->basePoint.X * worldtoint);
|
||||
y = int(ac->basePoint.Y * worldtoint);
|
||||
if (ac->spr.cstat & CSTAT_SPRITE_MOVE_FORWARD)
|
||||
{
|
||||
if (ang)
|
||||
|
@ -1242,7 +1242,7 @@ int VSpriteBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
|
|||
if (actor->spr.cstat & CSTAT_SPRITE_MOVE_FORWARD)
|
||||
{
|
||||
viewBackupSpriteLoc(actor);
|
||||
actor->set_int_z(actor->basePoint.Z + MulScale(dz1, GetWaveValue(a2, nWave), 16));
|
||||
actor->spr.pos.Z += actor->basePoint.Z + MulScale(dz1, GetWaveValue(a2, nWave), 16) * inttoworld;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1255,7 +1255,7 @@ int VSpriteBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
|
|||
if (actor->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE)
|
||||
{
|
||||
viewBackupSpriteLoc(actor);
|
||||
actor->set_int_z(actor->basePoint.Z + MulScale(dz2, GetWaveValue(a2, nWave), 16));
|
||||
actor->spr.pos.Z += actor->basePoint.Z + MulScale(dz2, GetWaveValue(a2, nWave), 16) * inttoworld;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2272,7 +2272,7 @@ static void UpdateBasePoints(sectortype* pSector)
|
|||
if (ptr1)
|
||||
{
|
||||
for (auto& ac : *ptr1)
|
||||
ac->basePoint = ac->int_pos();
|
||||
ac->basePoint = ac->spr.pos;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -2284,7 +2284,7 @@ static void UpdateBasePoints(sectortype* pSector)
|
|||
BloodSectIterator it(pSector);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
actor->basePoint = actor->int_pos();
|
||||
actor->basePoint = actor->spr.pos;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2309,7 +2309,7 @@ void trInit(TArray<DBloodActor*>& actors)
|
|||
{
|
||||
if (!actor->exists()) continue;
|
||||
actor->spr.inittype = actor->spr.type;
|
||||
actor->basePoint = actor->int_pos();
|
||||
actor->basePoint = actor->spr.pos;
|
||||
}
|
||||
for (auto& wal : wall)
|
||||
{
|
||||
|
|
|
@ -2001,7 +2001,7 @@ inline int TEST_BOOL11(DSWActor* sp) { return sp->spr.extra & SPRX_BOOL11; }
|
|||
inline int16_t SP_TAG1(DSWActor* actor) { return actor->spr.hitag; }
|
||||
inline int16_t& SP_TAG2(DSWActor* actor) { return actor->spr.lotag; }
|
||||
inline uint8_t& SP_TAG3(DSWActor* actor) { return actor->spr.clipdist; }
|
||||
inline int16_t& SP_TAG4(DSWActor* actor) { return actor->spr.ang; }
|
||||
inline int16_t& SP_TAG4(DSWActor* actor) { return actor->spr. ang; } // this may not be transitioned to a real angular type
|
||||
inline int16_t& SP_TAG5(DSWActor* actor) { return actor->spr.xvel; }
|
||||
inline int16_t& SP_TAG6(DSWActor* actor) { return actor->spr.yvel; }
|
||||
inline uint8_t& SP_TAG7(DSWActor* actor) { return MSB_VAR(actor->spr.zvel); }
|
||||
|
|
Loading…
Reference in a new issue