Commit 3f8e7b17 by RedEnchilada

Revert/remove unused/broken junk from original slopes port

m_vector removal to come later. The little thing commented out in it is so I could revert the weird tables.c change.
parent 8c54ee44
......@@ -330,7 +330,7 @@ angle_t FV_AngleBetweenVectors(const v3fixed_t *Vector1, const v3fixed_t *Vector
fixed_t vectorsMagnitude = FixedMul(FV_Magnitude(Vector1), FV_Magnitude(Vector2));
// Return the arc cosine of the (dotProduct / vectorsMagnitude) which is the angle in RADIANS.
return FixedAcos(FixedDiv(dotProduct, vectorsMagnitude));
return 0;//ALFALFA FixedAcos(FixedDiv(dotProduct, vectorsMagnitude));
}
float FV_AngleBetweenVectorsf(const v3float_t *Vector1, const v3float_t *Vector2)
......
......@@ -28,10 +28,6 @@
#include "hardware/hw3sound.h"
#endif
#ifdef SPRINGCLEAN// ESLOPE
#include "p_slopes.h"
#endif
#ifdef HAVE_BLUA
boolean LUA_CallAction(const char *action, mobj_t *actor);
#endif
......
......@@ -19,9 +19,6 @@
#include "z_zone.h"
#include "g_game.h"
#include "r_main.h"
#ifdef SPRINGCLEAN// ESLOPE
#include "p_slopes.h"
#endif
// ==========================================================================
// FLOORS
......
......@@ -53,15 +53,6 @@
// above this, a height difference is considered as a 'dropoff'
#define MAXSTEPMOVE (24*FRACUNIT)
#ifdef ESLOPE
// [RH] Minimum floorplane.c value for walking
// The lower the value, the steeper the slope is
#define SECPLANESTEEPSLOPE 46000
// ESLOPE stuff - a slope of 4 or lower is so level, treat it as flat
#define LEVELSLOPE 4
#define STEEPSLOPE 65
#endif
#define USERANGE (64*FRACUNIT)
#define MELEERANGE (64*FRACUNIT)
#define MISSILERANGE (32*64*FRACUNIT)
......@@ -147,12 +138,6 @@ boolean P_IsObjectOnGroundIn(mobj_t *mo, sector_t *sec);
boolean P_InSpaceSector(mobj_t *mo);
boolean P_InQuicksand(mobj_t *mo);
#ifdef ESLOPE
boolean P_IsObjectOnSlope(mobj_t *mo, boolean ceiling);
boolean P_SlopeGreaterThan(mobj_t *mo, boolean ceiling, int value);
boolean P_SlopeLessThan(mobj_t *mo, boolean ceiling, int value);
#endif
void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative);
void P_RestoreMusic(player_t *player);
void P_SpawnShieldOrb(player_t *player);
......
......@@ -1756,30 +1756,8 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
}
else
{
#ifdef ESLOPE // SRB2CBTODO: Checking the things momx/y help with collision issues, but makes going done slopes not as smooth
if (thiscam->subsector->sector && thiscam->subsector->sector->f_slope)
{
// SRB2CBTODO: Support a mobj's gravity for this too
if (P_GetZAt(thiscam->subsector->sector->f_slope, thiscam->x+thiscam->momx, thiscam->y+thiscam->momy) > P_GetZAt(thiscam->subsector->sector->f_slope, thiscam->x, thiscam->y))
thiscam->floorz = P_GetZAt(thiscam->subsector->sector->f_slope, thiscam->x+thiscam->momx, thiscam->y+thiscam->momy);
else
thiscam->floorz = P_GetZAt(thiscam->subsector->sector->f_slope, thiscam->x, thiscam->y);
}
else
#endif
tmfloorz = thiscam->subsector->sector->floorheight;
#ifdef ESLOPE
if (thiscam->subsector->sector && thiscam->subsector->sector->c_slope)
{
// SRB2CBTODO: Support a mobj's gravity for this too
if (P_GetZAt(thiscam->subsector->sector->c_slope, thiscam->x+thiscam->momx, thiscam->y+thiscam->momy) < P_GetZAt(thiscam->subsector->sector->c_slope, thiscam->x, thiscam->y))
thiscam->ceilingz = P_GetZAt(thiscam->subsector->sector->c_slope, thiscam->x, thiscam->y);
else
thiscam->ceilingz = P_GetZAt(thiscam->subsector->sector->c_slope, thiscam->x+thiscam->momx, thiscam->y+thiscam->momy);
}
else
#endif
tmceilingz = thiscam->subsector->sector->ceilingheight;
tmfloorz = P_CameraGetFloorZ(thiscam, thiscam->subsector->sector, x, y, NULL);
tmceilingz = P_CameraGetCeilingZ(thiscam, thiscam->subsector->sector, x, y, NULL);
}
// the move is ok,
......@@ -2074,7 +2052,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
if (thing->momz <= 0)
thing->standingslope = tmfloorslope;
}
else if (thing->z+thing->height >= tmceilingz /*&& thing->momz >= 0*/ && (thing->eflags & MFE_VERTICALFLIP)) {
else if (thing->z+thing->height >= tmceilingz && (thing->eflags & MFE_VERTICALFLIP)) {
if (!startingonground && tmceilingslope)
P_HandleSlopeLanding(thing, tmceilingslope);
......@@ -2120,15 +2098,7 @@ boolean P_SceneryTryMove(mobj_t *thing, fixed_t x, fixed_t y)
if (!(thing->flags & MF_NOCLIP))
{
fixed_t maxstep = MAXSTEPMOVE;
#ifdef ESLOPE // TODO: Make this collosion better
// Maxstepmove = 0 means the object bounces like a nut while going down a slope
if (thing->subsector->sector->f_slope)
{
maxstep *= thing->subsector->sector->f_slope->zangle;
}
#endif
const fixed_t maxstep = MAXSTEPMOVE;
if (tmceilingz - tmfloorz < thing->height)
return false; // doesn't fit
......@@ -2450,6 +2420,7 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle)
if (glidesector->sector != player->mo->subsector->sector)
{
boolean floorclimb = false;
fixed_t topheight, bottomheight;
if (glidesector->sector->ffloors)
{
......@@ -2459,8 +2430,8 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle)
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER))
continue;
fixed_t topheight = *rover->topheight;
fixed_t bottomheight = *rover->bottomheight;
topheight = *rover->topheight;
bottomheight = *rover->bottomheight;
#ifdef ESLOPE
if (*rover->t_slope)
......@@ -2551,7 +2522,6 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle)
static boolean PTR_SlideTraverse(intercept_t *in)
{
line_t *li;
fixed_t maxstep;
I_Assert(in->isaline);
......@@ -2584,9 +2554,7 @@ static boolean PTR_SlideTraverse(intercept_t *in)
if (opentop - slidemo->z < slidemo->height)
goto isblocking; // mobj is too high
maxstep = FixedMul(MAXSTEPMOVE, slidemo->scale);
if (openbottom - slidemo->z > maxstep)
if (openbottom - slidemo->z > FixedMul(MAXSTEPMOVE, slidemo->scale))
goto isblocking; // too big a step up
// this line doesn't block movement
......@@ -2607,6 +2575,7 @@ isblocking:
line_t *checkline = li;
sector_t *checksector;
ffloor_t *rover;
fixed_t topheight, bottomheight;
boolean fofline = false;
INT32 side = P_PointOnLineSide(slidemo->x, slidemo->y, li);
......@@ -2622,8 +2591,8 @@ isblocking:
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || (rover->flags & FF_BUSTUP))
continue;
fixed_t topheight = *rover->topheight;
fixed_t bottomheight = *rover->bottomheight;
topheight = *rover->topheight;
bottomheight = *rover->bottomheight;
#ifdef ESLOPE
if (*rover->t_slope)
......@@ -3258,6 +3227,7 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush)
if (thing->subsector->sector->ffloors && (realcrush || thing->flags & MF_PUSHABLE))
{
ffloor_t *rover;
fixed_t topheight, bottomheight;
fixed_t delta1, delta2;
INT32 thingtop = thing->z + thing->height;
......@@ -3267,8 +3237,8 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush)
|| ((rover->flags & FF_BLOCKOTHERS) && !thing->player)) || !(rover->flags & FF_EXISTS))
continue;
fixed_t topheight = *rover->topheight;
fixed_t bottomheight = *rover->bottomheight;
topheight = *rover->topheight;
bottomheight = *rover->bottomheight;
/*#ifdef ESLOPE
if (rover->t_slope)
......
......@@ -21,9 +21,6 @@
#include "p_maputl.h"
#include "p_polyobj.h"
#include "z_zone.h"
#ifdef SPRINGCLEAN// ESLOPE
#include "p_slopes.h"
#endif
//
// P_AproxDistance
......@@ -862,6 +859,7 @@ void P_SetThingPosition(mobj_t *thing)
{ // link into subsector
subsector_t *ss;
sector_t *oldsec = NULL;
fixed_t tfloorz, tceilz;
I_Assert(thing != NULL);
I_Assert(!P_MobjWasRemoved(thing));
......@@ -871,11 +869,6 @@ void P_SetThingPosition(mobj_t *thing)
ss = thing->subsector = R_PointInSubsector(thing->x, thing->y);
fixed_t tfloorz, tceilz;
tfloorz = P_GetFloorZ(thing, ss->sector, thing->x, thing->y, NULL);
tceilz = P_GetCeilingZ(thing, ss->sector, thing->x, thing->y, NULL);
if (!(thing->flags & MF_NOSECTOR))
{
// invisible things don't go into the sector links
......@@ -936,6 +929,9 @@ void P_SetThingPosition(mobj_t *thing)
// sector's floor is the same height.
if (thing->player && oldsec != NULL && thing->subsector && oldsec != thing->subsector->sector)
{
tfloorz = P_GetFloorZ(thing, ss->sector, thing->x, thing->y, NULL);
tceilz = P_GetCeilingZ(thing, ss->sector, thing->x, thing->y, NULL);
if (thing->eflags & MFE_VERTICALFLIP)
{
if (thing->z + thing->height >= tceilz)
......
......@@ -2181,6 +2181,7 @@ void P_XYMovement(mobj_t *mo)
if (!P_TryMove(mo, mo->x + xmove, mo->y + ymove, true) && !(mo->eflags & MFE_SPRUNG))
{
// blocked move
if (player) {
moved = false;
if (player->bot)
......
......@@ -28,11 +28,6 @@
// Needs precompiled tables/data structures.
#include "info.h"
// For slope code, we need v3float_t
#ifdef ESLOPE
//#include "r_defs.h"
#endif
//
// NOTES: mobj_t
//
......
......@@ -33,9 +33,6 @@
#include "m_misc.h"
#include "m_cond.h" //unlock triggers
#include "lua_hook.h" // LUAh_LinedefExecute
#ifdef ESLOPE
#include "p_slopes.h"
#endif
#ifdef HW3SOUND
#include "hardware/hw3sound.h"
......@@ -4522,6 +4519,7 @@ static void P_PlayerOnSpecial3DFloor(player_t *player, sector_t *sector)
static void P_RunSpecialSectorCheck(player_t *player, sector_t *sector)
{
boolean nofloorneeded = false;
fixed_t f_affectpoint, c_affectpoint;
if (!sector->special) // nothing special, exit
return;
......@@ -4584,8 +4582,8 @@ static void P_RunSpecialSectorCheck(player_t *player, sector_t *sector)
return;
}
fixed_t f_affectpoint = P_GetFloorZ(player->mo, sector, player->mo->x, player->mo->y, NULL);//sector->floorheight;
fixed_t c_affectpoint = P_GetCeilingZ(player->mo, sector, player->mo->x, player->mo->y, NULL);//sector->ceilingheight;
f_affectpoint = P_GetFloorZ(player->mo, sector, player->mo->x, player->mo->y, NULL);
c_affectpoint = P_GetCeilingZ(player->mo, sector, player->mo->x, player->mo->y, NULL);
// Only go further if on the ground
if ((sector->flags & SF_FLIPSPECIAL_FLOOR) && !(sector->flags & SF_FLIPSPECIAL_CEILING) && player->mo->z != f_affectpoint)
......@@ -7386,12 +7384,8 @@ void T_Pusher(pusher_t *p)
|| GETSECSPECIAL(referrer->special, 3) == 3)
foundfloor = true;
}
else if (
#ifdef ESLOPE
(!sec->f_slope) &&
#endif
(!(GETSECSPECIAL(sec->special, 3) == 2
|| GETSECSPECIAL(sec->special, 3) == 3)))
else if (!(GETSECSPECIAL(sec->special, 3) == 2
|| GETSECSPECIAL(sec->special, 3) == 3))
return;
if (p->roverpusher && foundfloor == false) // Not even a 3d floor has the PUSH_MASK.
......
......@@ -1197,87 +1197,6 @@ boolean P_IsObjectOnGround(mobj_t *mo)
return false;
}
#ifdef ESLOPE
//
// P_IsObjectOnSlope
//
// Returns true if the player is
// on a slope. Takes reverse
// gravity into account.
//
boolean P_IsObjectOnSlope(mobj_t *mo, boolean ceiling)
{
if (ceiling && (mo->eflags & MFE_VERTICALFLIP))
{
if ((mo->z + mo->height >= mo->ceilingz) && mo->subsector->sector->c_slope) // SRB2CBTODO: allow being on underside of mobj too?
return true;
}
else
{
if (mo->z <= mo->floorz && mo->subsector->sector->f_slope)
return true;
}
return false;
}
//
// P_SlopeGreaterThan
//
// Returns true if the object is on a slope
// that has an angle greater than the value
//
boolean P_SlopeGreaterThan(mobj_t *mo, boolean ceiling, int value)
{
if (ceiling && (mo->eflags & MFE_VERTICALFLIP))
{
if ((mo->z + mo->height >= mo->ceilingz) && mo->subsector->sector->c_slope)
{
if (value < mo->subsector->sector->c_slope->zangle)
return true;
}
}
else
{
if (mo->z <= mo->floorz && mo->subsector->sector->f_slope)
{
if (value < mo->subsector->sector->f_slope->zangle)
return true;
}
}
return false;
}
//
// P_SlopeLessThan
//
// Returns true if the object is on a slope
// that has an angle less than the value
//
boolean P_SlopeLessThan(mobj_t *mo, boolean ceiling, int value)
{
if (ceiling && (mo->eflags & MFE_VERTICALFLIP))
{
if ((mo->z + mo->height >= mo->ceilingz) && mo->subsector->sector->c_slope)
{
if (value < mo->subsector->sector->c_slope->zangle)
return true;
}
}
else
{
if (mo->z <= mo->floorz && mo->subsector->sector->f_slope)
{
if (value < mo->subsector->sector->f_slope->zangle)
return true;
}
}
return false;
}
#endif
//
// P_IsObjectOnGroundIn
//
......
......@@ -2225,6 +2225,9 @@ angle_t tantoangle[2049] =
536870912
};
#ifdef NEED_FIXED_VECTOR
static angle_t fineacon[65536*2] = {
ANGLE_MAX, 2143707442, 2142143280, 2140943052, 2139931208, 2139039753, 2138233813, 2137492672, 2136802831, 2136154917, 2135542102, 2134959233, 2134402306, 2133868139, 2133354148, 2132858208,
2132378539, 2131913638, 2131462220, 2131023174, 2130595537, 2130178462, 2129771202, 2129373097, 2128983555, 2128602046, 2128228092, 2127861261, 2127501162, 2127147436, 2126799757, 2126457825,
......@@ -10426,8 +10429,6 @@ FUNCMATH angle_t FixedAcos(fixed_t x)
return fineacon[((x<<(FINE_FRACBITS-FRACBITS)))+FRACUNIT];
}
#ifdef NEED_FIXED_VECTOR
//
// AngleBetweenVectors
//
......@@ -96,11 +96,12 @@ FUNCMATH angle_t FixedAngle(fixed_t fa);
// and with a factor, with +factor for (fa/factor) and -factor for (fa*factor)
FUNCMATH angle_t FixedAngleC(fixed_t fa, fixed_t factor);
/// The FixedAcos function
FUNCMATH angle_t FixedAcos(fixed_t x);
#ifdef NEED_FIXED_VECTOR
/// The FixedAcos function
FUNCMATH angle_t FixedAcos(fixed_t x);
/// Fixed Point Vector functions
angle_t FV2_AngleBetweenVectors(const vector2_t *Vector1, const vector2_t *Vector2);
angle_t FV3_AngleBetweenVectors(const vector3_t *Vector1, const vector3_t *Vector2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment