mirror of
https://github.com/DrBeef/Raze.git
synced 2025-03-02 23:32:01 +00:00
- SW: handle getzrangepoint
This commit is contained in:
parent
53be5d1622
commit
02ef323086
7 changed files with 18 additions and 22 deletions
source/games/sw/src
|
@ -1860,7 +1860,7 @@ short AnimSetVelAdj(short anim_ndx, short vel_adj);
|
||||||
|
|
||||||
void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SETp action, PERSONALITYp person);
|
void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SETp action, PERSONALITYp person);
|
||||||
|
|
||||||
void getzrangepoint(int x, int y, int z, short sectnum, int32_t* ceilz, Collision* ceilhit, int32_t* florz, Collision* florhit);
|
void getzrangepoint(int x, int y, int z, sectortype* sect, int32_t* ceilz, Collision* ceilhit, int32_t* florz, Collision* florhit);
|
||||||
Collision move_sprite(DSWActor* , int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics);
|
Collision move_sprite(DSWActor* , int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics);
|
||||||
Collision move_missile(DSWActor*, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics);
|
Collision move_missile(DSWActor*, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics);
|
||||||
DSWActor* DoPickTarget(DSWActor*, uint32_t max_delta_ang, int skip_targets);
|
DSWActor* DoPickTarget(DSWActor*, uint32_t max_delta_ang, int skip_targets);
|
||||||
|
|
|
@ -3002,12 +3002,12 @@ void StackedWaterSplash(PLAYERp pp)
|
||||||
{
|
{
|
||||||
if (FAF_ConnectArea(pp->cursector))
|
if (FAF_ConnectArea(pp->cursector))
|
||||||
{
|
{
|
||||||
auto sectnum = pp->cursector;
|
auto sect = pp->cursector;
|
||||||
|
|
||||||
auto psp = &pp->Actor()->s();
|
auto psp = &pp->Actor()->s();
|
||||||
updatesectorz(pp->posx, pp->posy, SPRITEp_BOS(psp), §num);
|
updatesectorz(pp->posx, pp->posy, SPRITEp_BOS(psp), §);
|
||||||
|
|
||||||
if (SectorIsUnderwaterArea(sectnum))
|
if (SectorIsUnderwaterArea(sect))
|
||||||
{
|
{
|
||||||
PlaySound(DIGI_SPLASH1, pp, v3df_dontpan);
|
PlaySound(DIGI_SPLASH1, pp, v3df_dontpan);
|
||||||
}
|
}
|
||||||
|
|
|
@ -532,7 +532,6 @@ void FAFgetzrangepoint(int32_t x, int32_t y, int32_t z, sectortype* const sect,
|
||||||
int32_t* hiz, Collision* ceilhit,
|
int32_t* hiz, Collision* ceilhit,
|
||||||
int32_t* loz, Collision* florhit)
|
int32_t* loz, Collision* florhit)
|
||||||
{
|
{
|
||||||
int sectnum = ::sectnum(sect);
|
|
||||||
int foo1;
|
int foo1;
|
||||||
Collision foo2;
|
Collision foo2;
|
||||||
bool SkipFAFcheck;
|
bool SkipFAFcheck;
|
||||||
|
@ -545,13 +544,13 @@ void FAFgetzrangepoint(int32_t x, int32_t y, int32_t z, sectortype* const sect,
|
||||||
// early out to regular routine
|
// early out to regular routine
|
||||||
if (!FAF_ConnectArea(sect))
|
if (!FAF_ConnectArea(sect))
|
||||||
{
|
{
|
||||||
getzrangepoint(x, y, z, sectnum, hiz, ceilhit, loz, florhit);
|
getzrangepoint(x, y, z, sect, hiz, ceilhit, loz, florhit);
|
||||||
SectorZadjust(*ceilhit, hiz, *florhit, loz);
|
SectorZadjust(*ceilhit, hiz, *florhit, loz);
|
||||||
WaterAdjust(*florhit, loz);
|
WaterAdjust(*florhit, loz);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getzrangepoint(x, y, z, sectnum, hiz, ceilhit, loz, florhit);
|
getzrangepoint(x, y, z, sect, hiz, ceilhit, loz, florhit);
|
||||||
SkipFAFcheck = SectorZadjust(*ceilhit, hiz, *florhit, loz);
|
SkipFAFcheck = SectorZadjust(*ceilhit, hiz, *florhit, loz);
|
||||||
WaterAdjust(*florhit, loz);
|
WaterAdjust(*florhit, loz);
|
||||||
|
|
||||||
|
@ -560,25 +559,25 @@ void FAFgetzrangepoint(int32_t x, int32_t y, int32_t z, sectortype* const sect,
|
||||||
|
|
||||||
if (FAF_ConnectCeiling(sect))
|
if (FAF_ConnectCeiling(sect))
|
||||||
{
|
{
|
||||||
int uppersect = sectnum;
|
auto uppersect = sect;
|
||||||
int newz = *hiz - Z(2);
|
int newz = *hiz - Z(2);
|
||||||
if (ceilhit->type == kHitSprite)
|
if (ceilhit->type == kHitSprite)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updatesectorz(x, y, newz, &uppersect);
|
updatesectorz(x, y, newz, &uppersect);
|
||||||
if (uppersect < 0)
|
if (uppersect == nullptr)
|
||||||
return;
|
return;
|
||||||
getzrangepoint(x, y, newz, uppersect, hiz, ceilhit, &foo1, &foo2);
|
getzrangepoint(x, y, newz, uppersect, hiz, ceilhit, &foo1, &foo2);
|
||||||
SectorZadjust(*ceilhit, hiz, trash, nullptr);
|
SectorZadjust(*ceilhit, hiz, trash, nullptr);
|
||||||
}
|
}
|
||||||
else if (FAF_ConnectFloor(sect) && !TEST(sect->floorstat, FLOOR_STAT_FAF_BLOCK_HITSCAN))
|
else if (FAF_ConnectFloor(sect) && !TEST(sect->floorstat, FLOOR_STAT_FAF_BLOCK_HITSCAN))
|
||||||
{
|
{
|
||||||
int lowersect = sectnum;
|
auto lowersect = sect;
|
||||||
int newz = *loz + Z(2);
|
int newz = *loz + Z(2);
|
||||||
if (florhit->type == kHitSprite)
|
if (florhit->type == kHitSprite)
|
||||||
return;
|
return;
|
||||||
updatesectorz(x, y, newz, &lowersect);
|
updatesectorz(x, y, newz, &lowersect);
|
||||||
if (lowersect < 0)
|
if (lowersect == nullptr)
|
||||||
return;
|
return;
|
||||||
getzrangepoint(x, y, newz, lowersect, &foo1, &foo2, loz, florhit);
|
getzrangepoint(x, y, newz, lowersect, &foo1, &foo2, loz, florhit);
|
||||||
SectorZadjust(trash, nullptr, *florhit, loz);
|
SectorZadjust(trash, nullptr, *florhit, loz);
|
||||||
|
|
|
@ -146,7 +146,6 @@ void DoRotatorMatch(PLAYERp pp, short match, bool manual)
|
||||||
{
|
{
|
||||||
USERp fu;
|
USERp fu;
|
||||||
SPRITEp fsp;
|
SPRITEp fsp;
|
||||||
short sectnum;
|
|
||||||
DSWActor* firstVator = nullptr;
|
DSWActor* firstVator = nullptr;
|
||||||
|
|
||||||
//RotatorSwitch(match, ON);
|
//RotatorSwitch(match, ON);
|
||||||
|
|
|
@ -608,7 +608,7 @@ void SectorMidPoint(sectortype* sectp, int *xmid, int *ymid, int *zmid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DoSpringBoard(PLAYERp pp/*, short sectnum*/)
|
void DoSpringBoard(PLAYERp pp)
|
||||||
{
|
{
|
||||||
|
|
||||||
pp->jump_speed = -pp->cursector->hitag;
|
pp->jump_speed = -pp->cursector->hitag;
|
||||||
|
|
|
@ -145,7 +145,6 @@ void DoSlidorMatch(PLAYERp pp, short match, bool manual)
|
||||||
{
|
{
|
||||||
USERp fu;
|
USERp fu;
|
||||||
SPRITEp fsp;
|
SPRITEp fsp;
|
||||||
short sectnum;
|
|
||||||
|
|
||||||
SWStatIterator it(STAT_SLIDOR);
|
SWStatIterator it(STAT_SLIDOR);
|
||||||
while (auto actor = it.Next())
|
while (auto actor = it.Next())
|
||||||
|
|
|
@ -619,7 +619,6 @@ void KillActor(DSWActor* actor)
|
||||||
USERp u = actor->u();
|
USERp u = actor->u();
|
||||||
int i;
|
int i;
|
||||||
unsigned stat;
|
unsigned stat;
|
||||||
short statnum,sectnum;
|
|
||||||
//extern short Zombies;
|
//extern short Zombies;
|
||||||
|
|
||||||
ASSERT(!Prediction);
|
ASSERT(!Prediction);
|
||||||
|
@ -2332,7 +2331,7 @@ void SpriteSetup(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
getzrangepoint(sp->x, sp->y, sp->z, sp->sectnum, &ceilingz, &trash, &floorz, &trash);
|
getzrangepoint(sp->x, sp->y, sp->z, sp->sector(), &ceilingz, &trash, &floorz, &trash);
|
||||||
|
|
||||||
if (floor_vator)
|
if (floor_vator)
|
||||||
{
|
{
|
||||||
|
@ -4467,7 +4466,7 @@ bool SpriteOverlapZ(DSWActor* actor_a, DSWActor* actor_b, int z_overlap)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void getzrangepoint(int x, int y, int z, short sectnum,
|
void getzrangepoint(int x, int y, int z, sectortype* sect,
|
||||||
int32_t* ceilz, Collision* ceilhit, int32_t* florz, Collision* florhit)
|
int32_t* ceilz, Collision* ceilhit, int32_t* florz, Collision* florhit)
|
||||||
{
|
{
|
||||||
spritetype *spr;
|
spritetype *spr;
|
||||||
|
@ -4476,7 +4475,7 @@ void getzrangepoint(int x, int y, int z, short sectnum,
|
||||||
short cstat;
|
short cstat;
|
||||||
char clipyou;
|
char clipyou;
|
||||||
|
|
||||||
if (sectnum < 0)
|
if (sect == nullptr)
|
||||||
{
|
{
|
||||||
*ceilz = 0x80000000;
|
*ceilz = 0x80000000;
|
||||||
|
|
||||||
|
@ -4486,12 +4485,12 @@ void getzrangepoint(int x, int y, int z, short sectnum,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize z's and hits to the current sector's top&bottom
|
// Initialize z's and hits to the current sector's top&bottom
|
||||||
getzsofslope(sectnum, x, y, ceilz, florz);
|
getzsofslopeptr(sect, x, y, ceilz, florz);
|
||||||
ceilhit->setSector(sectnum);
|
ceilhit->setSector(sect);
|
||||||
florhit->setSector(sectnum);
|
florhit->setSector(sect);
|
||||||
|
|
||||||
// Go through sprites of only the current sector
|
// Go through sprites of only the current sector
|
||||||
SWSectIterator it(sectnum);
|
SWSectIterator it(sect);
|
||||||
while (auto itActor = it.Next())
|
while (auto itActor = it.Next())
|
||||||
{
|
{
|
||||||
spr = &itActor->s();
|
spr = &itActor->s();
|
||||||
|
|
Loading…
Reference in a new issue