- deleted redundant sprite inlines.

All calls have been transitioned to actors.
This commit is contained in:
Christoph Oelckers 2021-12-24 20:47:32 +01:00
parent 8a1c602dc8
commit 1e938e2b44
2 changed files with 15 additions and 27 deletions

View file

@ -2038,17 +2038,13 @@ struct GameInterface : public ::GameInterface
};
END_SW_NS
#include "swactor.h"
BEGIN_SW_NS
// OVER and UNDER water macros
inline bool SpriteInDiveArea(SPRITEp sp)
{
return (TEST(sp->sector()->extra, SECTFX_DIVE_AREA) ? true : false);
}
inline bool SpriteInUnderwaterArea(SPRITEp sp)
{
return (TEST(sp->sector()->extra, SECTFX_UNDERWATER | SECTFX_UNDERWATER2) ? true : false);
}
inline bool SectorIsDiveArea(sectortype* sect)
{
return (TEST(sect->extra, SECTFX_DIVE_AREA) ? true : false);
@ -2060,12 +2056,6 @@ inline bool SectorIsUnderwaterArea(sectortype* sect)
return (TEST(sect->extra, SECTFX_UNDERWATER | SECTFX_UNDERWATER2) ? true : false);
}
END_SW_NS
#include "swactor.h"
BEGIN_SW_NS
inline int PlayerFacingRange(PLAYERp pp, DSWActor* a, int range)
{
return (abs(getincangle(getangle(a->spr.pos.X - (pp)->pos.X, a->spr.pos.Y - (pp)->pos.Y), (pp)->angle.ang.asbuild())) < (range));

View file

@ -1696,8 +1696,9 @@ void DoPlayerSpriteBob(PLAYERp pp, short player_height, short bob_amt, short bob
void UpdatePlayerUnderSprite(PLAYERp pp)
{
SPRITEp over_sp = &pp->Actor()->s();
USERp over_u = pp->Actor()->u();
auto actor = pp->actor;
SPRITEp over_sp = &actor->s();
USERp over_u = actor->u();
SPRITEp sp;
USERp u;
@ -1708,15 +1709,14 @@ void UpdatePlayerUnderSprite(PLAYERp pp)
if (Prediction)
return;
ASSERT(over_sp);
ASSERT(over_u);
// dont bother spawning if you ain't really in the water
water_level_z = over_sp->sector()->floorz; // - Z(pp->WadeDepth);
water_level_z = actor->spr.sector()->floorz; // - Z(pp->WadeDepth);
// if not below water
above_water = (GetSpriteZOfBottom(over_sp) <= water_level_z);
in_dive_area = SpriteInDiveArea(over_sp);
above_water = (ActorZOfBottom(actor) <= water_level_z);
in_dive_area = SpriteInDiveArea(actor);
// if not in dive area OR (in dive area AND above the water) - Kill it
if (!in_dive_area || (in_dive_area && above_water))
@ -1742,10 +1742,8 @@ void UpdatePlayerUnderSprite(PLAYERp pp)
sp = &pp->PlayerUnderActor->s();
u = pp->PlayerUnderActor->u();
sp->pos.X = over_sp->pos.X;
sp->pos.Y = over_sp->pos.Y;
sp->pos.Z = over_sp->pos.Z;
ChangeActorSect(pp->PlayerUnderActor, over_sp->sector());
sp->pos = actor->spr.pos;
ChangeActorSect(pp->PlayerUnderActor, actor->spr.sector());
SpriteWarpToUnderwater(pp->PlayerUnderActor);
@ -1760,7 +1758,7 @@ void UpdatePlayerUnderSprite(PLAYERp pp)
u->Rot = over_u->Rot;
u->StateStart = over_u->StateStart;
sp->picnum = over_sp->picnum;
sp->picnum = actor->spr.picnum;
}