mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-19 15:40:58 +00:00
- use ActorVect… functions in a few more places
This commit is contained in:
parent
3f2d970b4f
commit
0c8a76dc9c
6 changed files with 20 additions and 17 deletions
|
@ -1977,6 +1977,11 @@ inline double ActorZOfBottom(DSWActor* actor)
|
||||||
return GetSpriteZOfBottom(&actor->spr);
|
return GetSpriteZOfBottom(&actor->spr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline DVector3 ActorVectOfBottom(DSWActor* actor)
|
||||||
|
{
|
||||||
|
return DVector3(actor->spr.pos.XY(), ActorZOfBottom(actor));
|
||||||
|
}
|
||||||
|
|
||||||
inline double ActorZOfMiddle(DSWActor* actor)
|
inline double ActorZOfMiddle(DSWActor* actor)
|
||||||
{
|
{
|
||||||
return (ActorZOfTop(actor) + ActorZOfBottom(actor)) * 0.5;
|
return (ActorZOfTop(actor) + ActorZOfBottom(actor)) * 0.5;
|
||||||
|
|
|
@ -302,8 +302,7 @@ int DoWallBloodDrip(DSWActor* actor)
|
||||||
|
|
||||||
void SpawnMidSplash(DSWActor* actor)
|
void SpawnMidSplash(DSWActor* actor)
|
||||||
{
|
{
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreSplash, actor->sector(),
|
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreSplash, actor->sector(), ActorVectOfMiddle(actor), actor->spr.angle);
|
||||||
DVector3(actor->spr.pos.XY(), ActorZOfMiddle(actor)), actor->spr.angle);
|
|
||||||
|
|
||||||
actorNew->spr.shade = -12;
|
actorNew->spr.shade = -12;
|
||||||
actorNew->spr.scale.X = ((70 - RandomRange(20)) * REPEAT_SCALE);
|
actorNew->spr.scale.X = ((70 - RandomRange(20)) * REPEAT_SCALE);
|
||||||
|
@ -1915,7 +1914,7 @@ int DoCarryFlag(DSWActor* actor)
|
||||||
// if no Owner then die
|
// if no Owner then die
|
||||||
if (attached != nullptr)
|
if (attached != nullptr)
|
||||||
{
|
{
|
||||||
DVector3 pos(attached->spr.pos.XY(), ActorZOfMiddle(attached));
|
DVector3 pos = ActorVectOfMiddle(attached);
|
||||||
SetActorZ(actor, pos);
|
SetActorZ(actor, pos);
|
||||||
actor->spr.angle = attached->spr.angle + DAngle270;
|
actor->spr.angle = attached->spr.angle + DAngle270;
|
||||||
}
|
}
|
||||||
|
@ -2070,7 +2069,7 @@ int DoCarryFlagNoDet(DSWActor* actor)
|
||||||
// if no Owner then die
|
// if no Owner then die
|
||||||
if (attached != nullptr)
|
if (attached != nullptr)
|
||||||
{
|
{
|
||||||
SetActorZ(actor, DVector3(attached->spr.pos.XY(), ActorZOfMiddle(attached)));
|
SetActorZ(actor, ActorVectOfMiddle(attached));
|
||||||
actor->spr.angle = attached->spr.angle + DAngle270;
|
actor->spr.angle = attached->spr.angle + DAngle270;
|
||||||
actor->spr.pos.Z = attached->spr.pos.Z - (ActorSizeZ(attached) * 0.5);
|
actor->spr.pos.Z = attached->spr.pos.Z - (ActorSizeZ(attached) * 0.5);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3120,7 +3120,7 @@ void StackedWaterSplash(PLAYER* pp)
|
||||||
{
|
{
|
||||||
auto sect = pp->cursector;
|
auto sect = pp->cursector;
|
||||||
|
|
||||||
updatesectorz(DVector3(pp->pos.XY(), ActorZOfBottom(pp->actor)), §);
|
updatesectorz(ActorVectOfBottom(pp->actor), §);
|
||||||
|
|
||||||
if (SectorIsUnderwaterArea(sect))
|
if (SectorIsUnderwaterArea(sect))
|
||||||
{
|
{
|
||||||
|
@ -4024,7 +4024,7 @@ int PlayerCanDiveNoWarp(PLAYER* pp)
|
||||||
{
|
{
|
||||||
auto sect = pp->cursector;
|
auto sect = pp->cursector;
|
||||||
|
|
||||||
updatesectorz(DVector3(pp->pos.XY(), ActorZOfBottom(pp->actor)), §);
|
updatesectorz(ActorVectOfBottom(pp->actor), §);
|
||||||
|
|
||||||
if (SectorIsUnderwaterArea(sect))
|
if (SectorIsUnderwaterArea(sect))
|
||||||
{
|
{
|
||||||
|
|
|
@ -3592,7 +3592,7 @@ int ActorCoughItem(DSWActor* actor)
|
||||||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||||
actorNew->spr.cstat = 0;
|
actorNew->spr.cstat = 0;
|
||||||
actorNew->spr.extra = 0;
|
actorNew->spr.extra = 0;
|
||||||
actorNew->spr.pos = { actor->spr.pos.XY(), ActorZOfMiddle(actor) };
|
actorNew->spr.pos = ActorVectOfMiddle(actor);
|
||||||
actorNew->spr.angle = nullAngle;
|
actorNew->spr.angle = nullAngle;
|
||||||
actorNew->spr.extra = 0;
|
actorNew->spr.extra = 0;
|
||||||
|
|
||||||
|
@ -3631,7 +3631,7 @@ int ActorCoughItem(DSWActor* actor)
|
||||||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||||
actorNew->spr.cstat = 0;
|
actorNew->spr.cstat = 0;
|
||||||
actorNew->spr.extra = 0;
|
actorNew->spr.extra = 0;
|
||||||
actorNew->spr.pos = { actor->spr.pos.XY(), ActorZOfMiddle(actor) };
|
actorNew->spr.pos = ActorVectOfMiddle(actor);
|
||||||
actorNew->spr.angle = nullAngle;
|
actorNew->spr.angle = nullAngle;
|
||||||
actorNew->spr.extra = 0;
|
actorNew->spr.extra = 0;
|
||||||
|
|
||||||
|
@ -3657,7 +3657,7 @@ int ActorCoughItem(DSWActor* actor)
|
||||||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||||
actorNew->spr.cstat = 0;
|
actorNew->spr.cstat = 0;
|
||||||
actorNew->spr.extra = 0;
|
actorNew->spr.extra = 0;
|
||||||
actorNew->spr.pos = { actor->spr.pos.XY(), ActorZOfMiddle(actor) };
|
actorNew->spr.pos = ActorVectOfMiddle(actor);
|
||||||
actorNew->spr.angle = nullAngle;
|
actorNew->spr.angle = nullAngle;
|
||||||
actorNew->spr.extra = 0;
|
actorNew->spr.extra = 0;
|
||||||
|
|
||||||
|
@ -3686,7 +3686,7 @@ int ActorCoughItem(DSWActor* actor)
|
||||||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||||
actorNew->spr.cstat = 0;
|
actorNew->spr.cstat = 0;
|
||||||
actorNew->spr.extra = 0;
|
actorNew->spr.extra = 0;
|
||||||
actorNew->spr.pos = { actor->spr.pos.XY(), ActorZOfMiddle(actor) };
|
actorNew->spr.pos = ActorVectOfMiddle(actor);
|
||||||
actorNew->spr.angle = nullAngle;
|
actorNew->spr.angle = nullAngle;
|
||||||
actorNew->spr.extra = 0;
|
actorNew->spr.extra = 0;
|
||||||
|
|
||||||
|
@ -3746,7 +3746,7 @@ int ActorCoughItem(DSWActor* actor)
|
||||||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||||
actorNew->spr.cstat = 0;
|
actorNew->spr.cstat = 0;
|
||||||
actorNew->spr.extra = 0;
|
actorNew->spr.extra = 0;
|
||||||
actorNew->spr.pos = { actor->spr.pos.XY(), ActorZOfMiddle(actor) };
|
actorNew->spr.pos = ActorVectOfMiddle(actor);
|
||||||
actorNew->spr.angle = nullAngle;
|
actorNew->spr.angle = nullAngle;
|
||||||
actorNew->spr.extra = 0;
|
actorNew->spr.extra = 0;
|
||||||
|
|
||||||
|
|
|
@ -797,7 +797,7 @@ void BossHealthMeter(void)
|
||||||
DSWActor* actor = BossSpriteNum[i];
|
DSWActor* actor = BossSpriteNum[i];
|
||||||
if (actor != nullptr && !bosswasseen[i])
|
if (actor != nullptr && !bosswasseen[i])
|
||||||
{
|
{
|
||||||
if (cansee(DVector3(actor->spr.pos.XY(), ActorZOfTop(actor)), actor->sector(), pp->pos.plusZ(-40), pp->cursector))
|
if (cansee(ActorVectOfTop(actor), actor->sector(), pp->pos.plusZ(-40), pp->cursector))
|
||||||
{
|
{
|
||||||
if (i == 0 && !bosswasseen[0])
|
if (i == 0 && !bosswasseen[0])
|
||||||
{
|
{
|
||||||
|
|
|
@ -4535,7 +4535,7 @@ int DoFireballFlames(DSWActor* actor)
|
||||||
DSWActor* attach = actor->user.attachActor;
|
DSWActor* attach = actor->user.attachActor;
|
||||||
if (attach != nullptr)
|
if (attach != nullptr)
|
||||||
{
|
{
|
||||||
actor->spr.pos = DVector3(attach->spr.pos.XY(), ActorZOfMiddle(attach));
|
actor->spr.pos = ActorVectOfMiddle(attach);
|
||||||
|
|
||||||
if ((attach->spr.extra & SPRX_BURNABLE))
|
if ((attach->spr.extra & SPRX_BURNABLE))
|
||||||
{
|
{
|
||||||
|
@ -8061,8 +8061,7 @@ int DoBlurExtend(DSWActor* actor, int16_t interval, int16_t blur_num)
|
||||||
|
|
||||||
int InitPlasmaFountain(DSWActor* wActor, DSWActor* sActor)
|
int InitPlasmaFountain(DSWActor* wActor, DSWActor* sActor)
|
||||||
{
|
{
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, PLASMA_FOUNTAIN, s_PlasmaFountain, sActor->sector(),
|
auto actorNew = SpawnActor(STAT_MISSILE, PLASMA_FOUNTAIN, s_PlasmaFountain, sActor->sector(), ActorVectOfBottom(sActor), sActor->spr.angle, 0);
|
||||||
DVector3(sActor->spr.pos.XY(), ActorZOfBottom(sActor)), sActor->spr.angle, 0);
|
|
||||||
|
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
if (wActor)
|
if (wActor)
|
||||||
|
@ -12621,7 +12620,7 @@ int InitSumoSkull(DSWActor* actor)
|
||||||
|
|
||||||
PlaySound(DIGI_SERPSUMMONHEADS, actor, v3df_none);
|
PlaySound(DIGI_SERPSUMMONHEADS, actor, v3df_none);
|
||||||
|
|
||||||
auto actorNew = SpawnActor(STAT_ENEMY, SKULL_R0, &s_SkullWait[0][0], actor->sector(), DVector3(actor->spr.pos, ActorZOfMiddle(actor)), actor->spr.angle, 0);
|
auto actorNew = SpawnActor(STAT_ENEMY, SKULL_R0, &s_SkullWait[0][0], actor->sector(), ActorVectOfMiddle(actor), actor->spr.angle, 0);
|
||||||
|
|
||||||
actorNew->vel.X = 31.25;
|
actorNew->vel.X = 31.25;
|
||||||
SetOwner(actor, actorNew);
|
SetOwner(actor, actorNew);
|
||||||
|
@ -14505,7 +14504,7 @@ int SpawnDemonFist(DSWActor* actor)
|
||||||
if (actor->user.Flags & (SPR_SUICIDE))
|
if (actor->user.Flags & (SPR_SUICIDE))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
auto expActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), DVector3(actor->spr.pos.XY(), ActorZOfMiddle(actor)), actor->spr.angle, 0);
|
auto expActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), ActorVectOfMiddle(actor), actor->spr.angle, 0);
|
||||||
|
|
||||||
expActor->spr.hitag = LUMINOUS; //Always full brightness
|
expActor->spr.hitag = LUMINOUS; //Always full brightness
|
||||||
expActor->spr.shade = -40;
|
expActor->spr.shade = -40;
|
||||||
|
|
Loading…
Reference in a new issue