From 109684c029c448480680ed9d201c46fc4acf2cf2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 3 Feb 2022 00:59:12 +0100 Subject: [PATCH] - renamed a few things to make searching easier. --- source/games/blood/src/nnexts.cpp | 2 +- source/games/blood/src/prediction.cpp | 2 +- source/games/exhumed/src/runlist.cpp | 10 +++++----- source/games/sw/src/draw.cpp | 6 +++--- source/games/sw/src/morph.cpp | 26 +++++++++++++------------- source/games/sw/src/sector.cpp | 2 +- source/games/sw/src/sprite.cpp | 12 ++++++------ source/games/sw/src/track.cpp | 5 ++--- 8 files changed, 32 insertions(+), 33 deletions(-) diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 4084902b6..a5b787f06 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -744,7 +744,7 @@ void nnExtInitModernStuff(TArray& actors) if (actor->xspr.Proximity && actor->xspr.Sight && actor->xspr.DudeLockout) 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->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); diff --git a/source/games/blood/src/prediction.cpp b/source/games/blood/src/prediction.cpp index 8d67925cf..696bdaf15 100644 --- a/source/games/blood/src/prediction.cpp +++ b/source/games/blood/src/prediction.cpp @@ -410,7 +410,7 @@ static void fakeMoveDude(DBloodActor* actor) if (pHitWall->twoSided()) { sectortype* pHitSector = &pHitWall->nextSector(); - if (top < pHitSector->ceilingz || bottom > pHitSector->floorz) + if (top < pHitSector->ceiling z || bottom > pHitSector->floor z) { // ??? } diff --git a/source/games/exhumed/src/runlist.cpp b/source/games/exhumed/src/runlist.cpp index fba1ff4e2..2ba82c37d 100644 --- a/source/games/exhumed/src/runlist.cpp +++ b/source/games/exhumed/src/runlist.cpp @@ -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 - 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. */ 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 - 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. */ 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 - 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. */ 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 - 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. */ 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 - 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. */ int zVal = 0; diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index aa786d3b9..cf388ef35 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -640,9 +640,9 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int // workaround for mines and floor decals beneath the floor if (tsp->picnum == BETTY_R0 || tsp->picnum == FLOORBLOOD1) { - int32_t const floorz = getflorzofslopeptr(tActor->sector(), tActor->int_pos().X, tActor->int_pos().Y); - if (tActor->int_pos().Z > floorz) - tsp->set_int_z(floorz); + int32_t const florz = getflorzofslopeptr(tActor->sector(), tActor->int_pos().X, tActor->int_pos().Y); + if (tActor->int_pos().Z > florz) + tsp->set_int_z(florz); } if (r_shadows && (tActor->user.Flags & SPR_SHADOW)) diff --git a/source/games/sw/src/morph.cpp b/source/games/sw/src/morph.cpp index 5904b3027..e4823a434 100644 --- a/source/games/sw/src/morph.cpp +++ b/source/games/sw/src/morph.cpp @@ -295,8 +295,8 @@ void ScaleRandomPoint(SECTOR_OBJECT* sop, short k, short ang, int x, int y, int void MorphTornado(SECTOR_OBJECT* sop) { int mx, my; - int ceilingz; - int floorz; + int ceilz; + int florz; sectortype* *sectp; int j; int x,y,sx,sy; @@ -347,24 +347,24 @@ void MorphTornado(SECTOR_OBJECT* sop) dragpoint(sop->morph_wall_point, mx, my); // bound the Z - ceilingz = sop->op_main_sector->int_ceilingz(); - floorz = sop->op_main_sector->int_floorz(); + ceilz = sop->op_main_sector->int_ceilingz(); + florz = sop->op_main_sector->int_floorz(); for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++) { if ((*sectp)->hasU() && ((*sectp)->flags & SECTFU_SO_SLOPE_CEILING_TO_POINT)) { -#define TOR_LOW (floorz) +#define TOR_LOW (florz) if (sop->morph_z > TOR_LOW) { sop->morph_z_speed *= -1; 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 = ceilingz; + sop->morph_z = ceilz; } alignceilslope(*sectp, mx, my, sop->morph_z); @@ -376,7 +376,7 @@ void MorphTornado(SECTOR_OBJECT* sop) void MorphFloor(SECTOR_OBJECT* sop) { int mx, my; - int floorz; + int florz; sectortype* *sectp; int j; int x,y; @@ -425,7 +425,7 @@ void MorphFloor(SECTOR_OBJECT* sop) dragpoint(sop->morph_wall_point, mx, my); // bound the Z - floorz = sop->op_main_sector->int_floorz(); + florz = sop->op_main_sector->int_floorz(); #define MORPH_FLOOR_ZRANGE Z(300) @@ -447,7 +447,7 @@ void MorphFloor(SECTOR_OBJECT* sop) if ((*sectp)->hasU() && ((*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) { int mx, my; - int floorz; + int florz; int x,y; // z direction @@ -522,7 +522,7 @@ void SpikeFloor(SECTOR_OBJECT* sop) my = y; // bound the Z - floorz = sop->op_main_sector->int_floorz(); + florz = sop->op_main_sector->int_floorz(); #define MORPH_FLOOR_ZRANGE Z(300) @@ -537,7 +537,7 @@ void SpikeFloor(SECTOR_OBJECT* sop) sop->morph_z_speed *= -1; } - SOBJ_AlignFloorToPoint(sop, mx, my, floorz + sop->morph_z); + SOBJ_AlignFloorToPoint(sop, mx, my, florz + sop->morph_z); } diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index 798f2db88..2bd60d244 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -2363,7 +2363,7 @@ void DoSineWaveFloor(void) /* SLOPED SIN-WAVE FLOORS: 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. Note: For this to work, the first wall of each sin-wave sector must be diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 7dd60d784..1bd00c71c 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -2201,7 +2201,7 @@ void SpriteSetup(void) case SECT_SPIKE: { short speed,vel,time,type,start_on,floor_vator; - int floorz,ceilingz; + int florz,ceilz; Collision trash; SpawnUser(actor, 0, nullptr); @@ -2243,11 +2243,11 @@ void SpriteSetup(void) 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) { - actor->user.zclip = floorz; + actor->user.zclip = florz; // start off actor->user.pos.Z = actor->user.zclip; @@ -2265,7 +2265,7 @@ void SpriteSetup(void) } else { - actor->user.zclip = ceilingz; + actor->user.zclip = ceilz; // start off actor->user.pos.Z = actor->user.zclip; @@ -2853,8 +2853,8 @@ KeyMain: * * actor->spr.ang = 0; actor->spr.xvel = 4; * - * if (labs(actor->spr.z - actor->sector()->floorz) < Z(32)) actor->spr.z = - * actor->sector()->floorz - Z(32); + * if (labs(actor->spr.z - actor->sector()->int_floorz()) < Z(32)) actor->spr.z = + * actor->sector()->int_floorz() - Z(32); * * actor->user.sz = actor->spr.z; * diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 1fa29c60e..621bf7515 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -767,7 +767,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop) if ((sect->extra & SECTFX_SINK)) 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) 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); - // setting floorz if need be + // setting floor z if need be if ((sop->flags & SOBJ_ZMID_FLOOR)) sop->pmid.Z = sop->mid_sector->int_floorz(); @@ -2109,7 +2109,6 @@ void CallbackSOsink(ANIM* ap, void *data) destsect->floorpicnum = srcsect->floorpicnum; destsect->floorshade = srcsect->floorshade; -// destsect->floorz = srcsect->floorz; destsect->floorstat &= ~(CSTAT_SECTOR_ALIGN); destsect->u_defined = true;