mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-26 15:31:03 +00:00
Remove macro to disable noclip camera
This commit is contained in:
parent
7ab84ebd2f
commit
048e7e807c
3 changed files with 0 additions and 216 deletions
|
|
@ -691,10 +691,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
|||
#undef UPDATE_ALERT
|
||||
#endif
|
||||
|
||||
/// - SRB2Kart options -
|
||||
/// Camera always has noclip.
|
||||
#define NOCLIPCAM
|
||||
|
||||
/// Other karma comeback modes
|
||||
//#define OTHERKARMAMODES
|
||||
|
||||
|
|
|
|||
|
|
@ -2354,11 +2354,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
|
|||
fixed_t tryx = thiscam->x;
|
||||
fixed_t tryy = thiscam->y;
|
||||
|
||||
#ifndef NOCLIPCAM
|
||||
if ((players[displayplayers[i]].cheats & PC_NOCLIP) || (leveltime < introtime)) // Noclipping player camera noclips too!!
|
||||
#else
|
||||
if (!(players[displayplayers[i]].pflags & PF_NOCONTEST)) // Time Over should not clip through walls
|
||||
#endif
|
||||
{
|
||||
floatok = true;
|
||||
thiscam->floorz = thiscam->z;
|
||||
|
|
|
|||
208
src/p_user.c
208
src/p_user.c
|
|
@ -3068,10 +3068,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
mobj_t *mo;
|
||||
fixed_t f1, f2;
|
||||
fixed_t speed;
|
||||
#ifndef NOCLIPCAM
|
||||
boolean cameranoclip;
|
||||
subsector_t *newsubsec;
|
||||
#endif
|
||||
|
||||
fixed_t playerScale = FixedDiv(player->mo->scale, mapobjectscale);
|
||||
fixed_t scaleDiff = playerScale - FRACUNIT;
|
||||
|
|
@ -3129,12 +3125,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifndef NOCLIPCAM
|
||||
cameranoclip = ((player->cheats & PC_NOCLIP)
|
||||
|| (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!!
|
||||
|| (leveltime < introtime)); // Kart intro cam
|
||||
#endif
|
||||
|
||||
if ((player->pflags & PF_NOCONTEST) && (gametyperules & GTR_CIRCUIT)) // 1 for momentum keep, 2 for turnaround
|
||||
timeover = (player->karthud[khud_timeovercam] > 2*TICRATE ? 2 : 1);
|
||||
else
|
||||
|
|
@ -3377,204 +3367,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
z = mo->z + pviewheight + distz;
|
||||
}
|
||||
|
||||
#ifndef NOCLIPCAM // Disable all z-clipping for noclip cam
|
||||
// move camera down to move under lower ceilings
|
||||
newsubsec = R_PointInSubsectorOrNull(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1));
|
||||
|
||||
if (!newsubsec)
|
||||
newsubsec = thiscam->subsector;
|
||||
|
||||
if (newsubsec)
|
||||
{
|
||||
fixed_t myfloorz, myceilingz;
|
||||
fixed_t midz = thiscam->z + (thiscam->z - mo->z)/2;
|
||||
fixed_t midx = ((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1);
|
||||
fixed_t midy = ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1);
|
||||
|
||||
// Cameras use the heightsec's heights rather then the actual sector heights.
|
||||
// If you can see through it, why not move the camera through it too?
|
||||
if (newsubsec->sector->camsec >= 0)
|
||||
{
|
||||
myfloorz = sectors[newsubsec->sector->camsec].floorheight;
|
||||
myceilingz = sectors[newsubsec->sector->camsec].ceilingheight;
|
||||
}
|
||||
else if (newsubsec->sector->heightsec >= 0)
|
||||
{
|
||||
myfloorz = sectors[newsubsec->sector->heightsec].floorheight;
|
||||
myceilingz = sectors[newsubsec->sector->heightsec].ceilingheight;
|
||||
}
|
||||
else
|
||||
{
|
||||
myfloorz = P_CameraGetFloorZ(thiscam, newsubsec->sector, midx, midy, NULL);
|
||||
myceilingz = P_CameraGetCeilingZ(thiscam, newsubsec->sector, midx, midy, NULL);
|
||||
}
|
||||
|
||||
// Check list of fake floors and see if floorz/ceilingz need to be altered.
|
||||
if (newsubsec->sector->ffloors)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
fixed_t delta1, delta2;
|
||||
INT32 thingtop = midz + thiscam->height;
|
||||
|
||||
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
fixed_t topheight, bottomheight;
|
||||
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
|
||||
continue;
|
||||
|
||||
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
|
||||
bottomheight = P_CameraGetFOFBottomZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
|
||||
|
||||
delta1 = midz - (bottomheight
|
||||
+ ((topheight - bottomheight)/2));
|
||||
delta2 = thingtop - (bottomheight
|
||||
+ ((topheight - bottomheight)/2));
|
||||
if (topheight > myfloorz && abs(delta1) < abs(delta2))
|
||||
myfloorz = topheight;
|
||||
if (bottomheight < myceilingz && abs(delta1) >= abs(delta2))
|
||||
myceilingz = bottomheight;
|
||||
}
|
||||
}
|
||||
|
||||
// Check polyobjects and see if floorz/ceilingz need to be altered
|
||||
{
|
||||
INT32 xl, xh, yl, yh, bx, by;
|
||||
validcount++;
|
||||
|
||||
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
|
||||
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
|
||||
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||
|
||||
BMBOUNDFIX(xl, xh, yl, yh);
|
||||
|
||||
for (by = yl; by <= yh; by++)
|
||||
for (bx = xl; bx <= xh; bx++)
|
||||
{
|
||||
INT32 offset;
|
||||
polymaplink_t *plink; // haleyjd 02/22/06
|
||||
|
||||
if (bx < 0 || by < 0 || bx >= bmapwidth || by >= bmapheight)
|
||||
continue;
|
||||
|
||||
offset = by*bmapwidth + bx;
|
||||
|
||||
// haleyjd 02/22/06: consider polyobject lines
|
||||
plink = polyblocklinks[offset];
|
||||
|
||||
while (plink)
|
||||
{
|
||||
polyobj_t *po = plink->po;
|
||||
|
||||
if (po->validcount != validcount) // if polyobj hasn't been checked
|
||||
{
|
||||
sector_t *polysec;
|
||||
fixed_t delta1, delta2, thingtop;
|
||||
fixed_t polytop, polybottom;
|
||||
|
||||
po->validcount = validcount;
|
||||
|
||||
if (!P_PointInsidePolyobj(po, x, y) || !(po->flags & POF_SOLID))
|
||||
{
|
||||
plink = (polymaplink_t *)(plink->link.next);
|
||||
continue;
|
||||
}
|
||||
|
||||
// We're inside it! Yess...
|
||||
polysec = po->lines[0]->backsector;
|
||||
|
||||
if (GETSECSPECIAL(polysec->special, 4) == 12)
|
||||
{ // Camera noclip polyobj.
|
||||
plink = (polymaplink_t *)(plink->link.next);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (po->flags & POF_CLIPPLANES)
|
||||
{
|
||||
polytop = polysec->ceilingheight;
|
||||
polybottom = polysec->floorheight;
|
||||
}
|
||||
else
|
||||
{
|
||||
polytop = INT32_MAX;
|
||||
polybottom = INT32_MIN;
|
||||
}
|
||||
|
||||
thingtop = midz + thiscam->height;
|
||||
delta1 = midz - (polybottom + ((polytop - polybottom)/2));
|
||||
delta2 = thingtop - (polybottom + ((polytop - polybottom)/2));
|
||||
|
||||
if (polytop > myfloorz && abs(delta1) < abs(delta2))
|
||||
myfloorz = polytop;
|
||||
|
||||
if (polybottom < myceilingz && abs(delta1) >= abs(delta2))
|
||||
myceilingz = polybottom;
|
||||
}
|
||||
plink = (polymaplink_t *)(plink->link.next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// crushed camera
|
||||
if (myceilingz <= myfloorz + thiscam->height && !resetcalled && !cameranoclip)
|
||||
{
|
||||
P_ResetCamera(player, thiscam);
|
||||
return true;
|
||||
}
|
||||
|
||||
// camera fit?
|
||||
if (myceilingz != myfloorz
|
||||
&& myceilingz - thiscam->height < z)
|
||||
{
|
||||
/* // no fit
|
||||
if (!resetcalled && !cameranoclip)
|
||||
{
|
||||
P_ResetCamera(player, thiscam);
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
z = myceilingz - thiscam->height-FixedMul(11*FRACUNIT, mo->scale);
|
||||
// is the camera fit is there own sector
|
||||
}
|
||||
|
||||
// Make the camera a tad smarter with 3d floors
|
||||
if (newsubsec->sector->ffloors && !cameranoclip)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
|
||||
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
fixed_t topheight, bottomheight;
|
||||
if ((rover->flags & FF_BLOCKOTHERS) && (rover->flags & FF_RENDERALL) && (rover->flags & FF_EXISTS) && GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
|
||||
{
|
||||
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
|
||||
bottomheight = P_CameraGetFOFBottomZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
|
||||
|
||||
if (bottomheight - thiscam->height < z
|
||||
&& midz < bottomheight)
|
||||
z = bottomheight - thiscam->height-FixedMul(11*FRACUNIT, mo->scale);
|
||||
|
||||
else if (topheight + thiscam->height > z
|
||||
&& midz > topheight)
|
||||
z = topheight;
|
||||
|
||||
if ((mo->z >= topheight && midz < bottomheight)
|
||||
|| ((mo->z < bottomheight && mo->z+mo->height < topheight) && midz >= topheight))
|
||||
{
|
||||
// Can't see
|
||||
if (!resetcalled)
|
||||
P_ResetCamera(player, thiscam);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (thiscam->z < thiscam->floorz && !cameranoclip)
|
||||
thiscam->z = thiscam->floorz;
|
||||
#endif // NOCLIPCAM
|
||||
|
||||
// point viewed by the camera
|
||||
// this point is just 64 unit forward the player
|
||||
dist = 64*cameraScale;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue