- renamed a few things to make searching easier.

This commit is contained in:
Christoph Oelckers 2022-02-03 00:59:12 +01:00
parent 8325e7369f
commit 109684c029
8 changed files with 32 additions and 33 deletions

View file

@ -744,7 +744,7 @@ void nnExtInitModernStuff(TArray<DBloodActor*>& actors)
if (actor->xspr.Proximity && actor->xspr.Sight && actor->xspr.DudeLockout) if (actor->xspr.Proximity && actor->xspr.Sight && actor->xspr.DudeLockout)
actor->xspr.Proximity = false; actor->xspr.Proximity = false;
// very quick fix for floor sprites with Touch trigger flag if their Z is equals sector floorz / ceilgz // very quick fix for floor sprites with Touch trigger flag if their Z is equals sector florz / ceilgz
if (actor->insector() && actor->xspr.Touch && (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) { if (actor->insector() && actor->xspr.Touch && (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) {
if (actor->int_pos().Z == actor->sector()->int_floorz()) actor->add_int_z(-1); if (actor->int_pos().Z == actor->sector()->int_floorz()) actor->add_int_z(-1);
else if (actor->int_pos().Z == actor->sector()->int_ceilingz()) actor->add_int_z(1); else if (actor->int_pos().Z == actor->sector()->int_ceilingz()) actor->add_int_z(1);

View file

@ -410,7 +410,7 @@ static void fakeMoveDude(DBloodActor* actor)
if (pHitWall->twoSided()) if (pHitWall->twoSided())
{ {
sectortype* pHitSector = &pHitWall->nextSector(); sectortype* pHitSector = &pHitWall->nextSector();
if (top < pHitSector->ceilingz || bottom > pHitSector->floorz) if (top < pHitSector->ceiling z || bottom > pHitSector->floor z)
{ {
// ??? // ???
} }

View file

@ -784,7 +784,7 @@ void runlist_ProcessSectorTag(sectortype* pSector, int nLotag, int nHitag)
{ {
/* /*
fix for original behaviour - nextSector could be -1 the and game would do an invalid memory read fix for original behaviour - nextSector could be -1 the and game would do an invalid memory read
when getting the floorz for nextSector. Here, we assume 0 and only set the correct value if nextSector when getting the floor z for nextSector. Here, we assume 0 and only set the correct value if nextSector
is valid. is valid.
*/ */
int zVal = 0; int zVal = 0;
@ -804,7 +804,7 @@ void runlist_ProcessSectorTag(sectortype* pSector, int nLotag, int nHitag)
{ {
/* /*
fix for original behaviour - nextSector could be -1 the and game would do an invalid memory read fix for original behaviour - nextSector could be -1 the and game would do an invalid memory read
when getting the floorz for nextSector. Here, we assume 0 and only set the correct value if nextSector when getting the floor z for nextSector. Here, we assume 0 and only set the correct value if nextSector
is valid. is valid.
*/ */
int zVal = 0; int zVal = 0;
@ -828,7 +828,7 @@ void runlist_ProcessSectorTag(sectortype* pSector, int nLotag, int nHitag)
{ {
/* /*
fix for original behaviour - nextSector could be -1 the and game would do an invalid memory read fix for original behaviour - nextSector could be -1 the and game would do an invalid memory read
when getting the floorz for nextSector. Here, we assume 0 and only set the correct value if nextSector when getting the floor z for nextSector. Here, we assume 0 and only set the correct value if nextSector
is valid. is valid.
*/ */
int zVal = 0; int zVal = 0;
@ -920,7 +920,7 @@ void runlist_ProcessSectorTag(sectortype* pSector, int nLotag, int nHitag)
{ {
/* /*
fix for original behaviour - nextSector could be -1 the and game would do an invalid memory read fix for original behaviour - nextSector could be -1 the and game would do an invalid memory read
when getting the floorz for nextSector. Here, we assume 0 and only set the correct value if nextSector when getting the floor z for nextSector. Here, we assume 0 and only set the correct value if nextSector
is valid. is valid.
*/ */
int zVal = 0; int zVal = 0;
@ -1158,7 +1158,7 @@ void runlist_ProcessSectorTag(sectortype* pSector, int nLotag, int nHitag)
{ {
/* /*
fix for original behaviour - nextSector could be -1 the and game would do an invalid memory read fix for original behaviour - nextSector could be -1 the and game would do an invalid memory read
when getting the floorz for nextSector. Here, we assume 0 and only set the correct value if nextSector when getting the floor z for nextSector. Here, we assume 0 and only set the correct value if nextSector
is valid. is valid.
*/ */
int zVal = 0; int zVal = 0;

View file

@ -640,9 +640,9 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
// workaround for mines and floor decals beneath the floor // workaround for mines and floor decals beneath the floor
if (tsp->picnum == BETTY_R0 || tsp->picnum == FLOORBLOOD1) if (tsp->picnum == BETTY_R0 || tsp->picnum == FLOORBLOOD1)
{ {
int32_t const floorz = getflorzofslopeptr(tActor->sector(), tActor->int_pos().X, tActor->int_pos().Y); int32_t const florz = getflorzofslopeptr(tActor->sector(), tActor->int_pos().X, tActor->int_pos().Y);
if (tActor->int_pos().Z > floorz) if (tActor->int_pos().Z > florz)
tsp->set_int_z(floorz); tsp->set_int_z(florz);
} }
if (r_shadows && (tActor->user.Flags & SPR_SHADOW)) if (r_shadows && (tActor->user.Flags & SPR_SHADOW))

View file

@ -295,8 +295,8 @@ void ScaleRandomPoint(SECTOR_OBJECT* sop, short k, short ang, int x, int y, int
void MorphTornado(SECTOR_OBJECT* sop) void MorphTornado(SECTOR_OBJECT* sop)
{ {
int mx, my; int mx, my;
int ceilingz; int ceilz;
int floorz; int florz;
sectortype* *sectp; sectortype* *sectp;
int j; int j;
int x,y,sx,sy; int x,y,sx,sy;
@ -347,24 +347,24 @@ void MorphTornado(SECTOR_OBJECT* sop)
dragpoint(sop->morph_wall_point, mx, my); dragpoint(sop->morph_wall_point, mx, my);
// bound the Z // bound the Z
ceilingz = sop->op_main_sector->int_ceilingz(); ceilz = sop->op_main_sector->int_ceilingz();
floorz = sop->op_main_sector->int_floorz(); florz = sop->op_main_sector->int_floorz();
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++) for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
{ {
if ((*sectp)->hasU() && if ((*sectp)->hasU() &&
((*sectp)->flags & SECTFU_SO_SLOPE_CEILING_TO_POINT)) ((*sectp)->flags & SECTFU_SO_SLOPE_CEILING_TO_POINT))
{ {
#define TOR_LOW (floorz) #define TOR_LOW (florz)
if (sop->morph_z > TOR_LOW) if (sop->morph_z > TOR_LOW)
{ {
sop->morph_z_speed *= -1; sop->morph_z_speed *= -1;
sop->morph_z = TOR_LOW; sop->morph_z = TOR_LOW;
} }
else if (sop->morph_z < ceilingz) else if (sop->morph_z < ceilz)
{ {
sop->morph_z_speed *= -1; sop->morph_z_speed *= -1;
sop->morph_z = ceilingz; sop->morph_z = ceilz;
} }
alignceilslope(*sectp, mx, my, sop->morph_z); alignceilslope(*sectp, mx, my, sop->morph_z);
@ -376,7 +376,7 @@ void MorphTornado(SECTOR_OBJECT* sop)
void MorphFloor(SECTOR_OBJECT* sop) void MorphFloor(SECTOR_OBJECT* sop)
{ {
int mx, my; int mx, my;
int floorz; int florz;
sectortype* *sectp; sectortype* *sectp;
int j; int j;
int x,y; int x,y;
@ -425,7 +425,7 @@ void MorphFloor(SECTOR_OBJECT* sop)
dragpoint(sop->morph_wall_point, mx, my); dragpoint(sop->morph_wall_point, mx, my);
// bound the Z // bound the Z
floorz = sop->op_main_sector->int_floorz(); florz = sop->op_main_sector->int_floorz();
#define MORPH_FLOOR_ZRANGE Z(300) #define MORPH_FLOOR_ZRANGE Z(300)
@ -447,7 +447,7 @@ void MorphFloor(SECTOR_OBJECT* sop)
if ((*sectp)->hasU() && if ((*sectp)->hasU() &&
((*sectp)->flags & SECTFU_SO_SLOPE_CEILING_TO_POINT)) ((*sectp)->flags & SECTFU_SO_SLOPE_CEILING_TO_POINT))
{ {
alignflorslope(*sectp, mx, my, floorz + sop->morph_z); alignflorslope(*sectp, mx, my, florz + sop->morph_z);
} }
} }
} }
@ -502,7 +502,7 @@ void SOBJ_AlignFloorCeilingToPoint(SECTOR_OBJECT* sop, int x, int y, int z)
void SpikeFloor(SECTOR_OBJECT* sop) void SpikeFloor(SECTOR_OBJECT* sop)
{ {
int mx, my; int mx, my;
int floorz; int florz;
int x,y; int x,y;
// z direction // z direction
@ -522,7 +522,7 @@ void SpikeFloor(SECTOR_OBJECT* sop)
my = y; my = y;
// bound the Z // bound the Z
floorz = sop->op_main_sector->int_floorz(); florz = sop->op_main_sector->int_floorz();
#define MORPH_FLOOR_ZRANGE Z(300) #define MORPH_FLOOR_ZRANGE Z(300)
@ -537,7 +537,7 @@ void SpikeFloor(SECTOR_OBJECT* sop)
sop->morph_z_speed *= -1; sop->morph_z_speed *= -1;
} }
SOBJ_AlignFloorToPoint(sop, mx, my, floorz + sop->morph_z); SOBJ_AlignFloorToPoint(sop, mx, my, florz + sop->morph_z);
} }

View file

@ -2363,7 +2363,7 @@ void DoSineWaveFloor(void)
/* SLOPED SIN-WAVE FLOORS: /* SLOPED SIN-WAVE FLOORS:
It's best to program sloped sin-wave floors in 2 steps: It's best to program sloped sin-wave floors in 2 steps:
1. First set the floorz of the floor as the sin code normally does it. 1. First set the floor z of the floor as the sin code normally does it.
2. Adjust the slopes by calling alignflorslope once for each sector. 2. Adjust the slopes by calling alignflorslope once for each sector.
Note: For this to work, the first wall of each sin-wave sector must be Note: For this to work, the first wall of each sin-wave sector must be

View file

@ -2201,7 +2201,7 @@ void SpriteSetup(void)
case SECT_SPIKE: case SECT_SPIKE:
{ {
short speed,vel,time,type,start_on,floor_vator; short speed,vel,time,type,start_on,floor_vator;
int floorz,ceilingz; int florz,ceilz;
Collision trash; Collision trash;
SpawnUser(actor, 0, nullptr); SpawnUser(actor, 0, nullptr);
@ -2243,11 +2243,11 @@ void SpriteSetup(void)
break; break;
} }
getzrangepoint(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), &ceilingz, &trash, &floorz, &trash); getzrangepoint(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), &ceilz, &trash, &florz, &trash);
if (floor_vator) if (floor_vator)
{ {
actor->user.zclip = floorz; actor->user.zclip = florz;
// start off // start off
actor->user.pos.Z = actor->user.zclip; actor->user.pos.Z = actor->user.zclip;
@ -2265,7 +2265,7 @@ void SpriteSetup(void)
} }
else else
{ {
actor->user.zclip = ceilingz; actor->user.zclip = ceilz;
// start off // start off
actor->user.pos.Z = actor->user.zclip; actor->user.pos.Z = actor->user.zclip;
@ -2853,8 +2853,8 @@ KeyMain:
* *
* actor->spr.ang = 0; actor->spr.xvel = 4; * actor->spr.ang = 0; actor->spr.xvel = 4;
* *
* if (labs(actor->spr.z - actor->sector()->floorz) < Z(32)) actor->spr.z = * if (labs(actor->spr.z - actor->sector()->int_floorz()) < Z(32)) actor->spr.z =
* actor->sector()->floorz - Z(32); * actor->sector()->int_floorz() - Z(32);
* *
* actor->user.sz = actor->spr.z; * actor->user.sz = actor->spr.z;
* *

View file

@ -767,7 +767,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
if ((sect->extra & SECTFX_SINK)) if ((sect->extra & SECTFX_SINK))
sop->zorig_floor[sop->num_sectors] += Z(FixedToInt(sect->depth_fixed)); sop->zorig_floor[sop->num_sectors] += Z(FixedToInt(sect->depth_fixed));
// lowest and highest floorz's // lowest and highest floor z's
if (sect->int_floorz() > sop->floor_loz) if (sect->int_floorz() > sop->floor_loz)
sop->floor_loz = sect->int_floorz(); sop->floor_loz = sect->int_floorz();
@ -1596,7 +1596,7 @@ void MovePoints(SECTOR_OBJECT* sop, short delta_ang, int nx, int ny)
sop->sp_child->set_int_xy(sop->pmid.X, sop->pmid.Y); sop->sp_child->set_int_xy(sop->pmid.X, sop->pmid.Y);
// setting floorz if need be // setting floor z if need be
if ((sop->flags & SOBJ_ZMID_FLOOR)) if ((sop->flags & SOBJ_ZMID_FLOOR))
sop->pmid.Z = sop->mid_sector->int_floorz(); sop->pmid.Z = sop->mid_sector->int_floorz();
@ -2109,7 +2109,6 @@ void CallbackSOsink(ANIM* ap, void *data)
destsect->floorpicnum = srcsect->floorpicnum; destsect->floorpicnum = srcsect->floorpicnum;
destsect->floorshade = srcsect->floorshade; destsect->floorshade = srcsect->floorshade;
// destsect->floorz = srcsect->floorz;
destsect->floorstat &= ~(CSTAT_SECTOR_ALIGN); destsect->floorstat &= ~(CSTAT_SECTOR_ALIGN);
destsect->u_defined = true; destsect->u_defined = true;