From 079fbd340f479f9cd8cae57a9a906304b9355ff8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 3 Sep 2022 23:32:26 +0200 Subject: [PATCH] - floatified sop->floor_loz and floor_hiz --- source/games/sw/src/game.h | 8 ++++---- source/games/sw/src/input.cpp | 2 +- source/games/sw/src/player.cpp | 2 +- source/games/sw/src/track.cpp | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 8648740f8..91369803c 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1469,10 +1469,10 @@ struct SECTOR_OBJECT z_tgt, // target z delta z_rate, // rate at which z aproaches target // only works for single player. - bob_diff, // bobbing difference for the frame - _floor_loz, // floor low z - _floor_hiz, // floor hi z - bob_amt, // bob amount max in z coord + bob_diff; // bobbing difference for the frame + double floor_loz, // floor low z + floor_hiz; // floor hi z + int bob_amt, // bob amount max in z coord // end of must floatify // variables set by mappers for drivables diff --git a/source/games/sw/src/input.cpp b/source/games/sw/src/input.cpp index 45d67142f..b7e97341b 100644 --- a/source/games/sw/src/input.cpp +++ b/source/games/sw/src/input.cpp @@ -186,7 +186,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju if ((pp->Flags2 & PF2_INPUT_CAN_TURN_VEHICLE)) { - DoPlayerTurnVehicle(pp, input.avel, pp->int_ppos().Z + Z(10), abs(pp->int_ppos().Z + Z(10) - pp->sop->_floor_loz)); + DoPlayerTurnVehicle(pp, input.avel, pp->int_ppos().Z + Z(10), abs(pp->int_ppos().Z + Z(10) - pp->sop->floor_loz * worldtoint)); } if ((pp->Flags2 & PF2_INPUT_CAN_TURN_TURRET)) diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 948cad694..828d3b18f 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -2535,7 +2535,7 @@ void DoPlayerMoveVehicle(PLAYER* pp) OperateSectorObject(pp->sop, pp->angle.ang.Buildang(), { MAXSO, MAXSO }); pp->setcursector(pp->sop->op_main_sector); // for speed - floor_dist = abs(z - pp->sop->_floor_loz); + floor_dist = abs(z - pp->sop->floor_loz * worldtoint); if (RectClip) diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 5c67e5df2..349334278 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -728,11 +728,11 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop) sop->zorig_floor[sop->num_sectors] += Z(FixedToInt(sect->depth_fixed)); // lowest and highest floor z's - if (sect->int_floorz() > sop->_floor_loz) - sop->_floor_loz = sect->int_floorz(); + if (sect->floorz > sop->floor_loz) + sop->floor_loz = sect->floorz; - if (sect->int_floorz() < sop->_floor_hiz) - sop->_floor_hiz = sect->int_floorz(); + if (sect->floorz < sop->floor_hiz) + sop->floor_hiz = sect->floorz; sop->num_sectors++; } @@ -948,8 +948,8 @@ void SetupSectorObject(sectortype* sectp, short tag) sop->clipdist = 1024; sop->target_dist = 0; sop->turn_speed = 4; - sop->_floor_loz = -9999999; - sop->_floor_hiz = 9999999; + sop->floor_loz = -9999999; + sop->floor_hiz = 9999999; sop->ang_tgt = sop->ang = sop->ang_moving = 0; sop->op_main_sector = nullptr; sop->ram_damage = 0;