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.
This commit is contained in:
RedEnchilada 2015-05-22 20:57:58 -05:00
parent 8c54ee44e7
commit 3f8e7b1739
12 changed files with 31 additions and 176 deletions

View File

@ -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)); 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 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) float FV_AngleBetweenVectorsf(const v3float_t *Vector1, const v3float_t *Vector2)

View File

@ -28,10 +28,6 @@
#include "hardware/hw3sound.h" #include "hardware/hw3sound.h"
#endif #endif
#ifdef SPRINGCLEAN// ESLOPE
#include "p_slopes.h"
#endif
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
boolean LUA_CallAction(const char *action, mobj_t *actor); boolean LUA_CallAction(const char *action, mobj_t *actor);
#endif #endif

View File

@ -19,9 +19,6 @@
#include "z_zone.h" #include "z_zone.h"
#include "g_game.h" #include "g_game.h"
#include "r_main.h" #include "r_main.h"
#ifdef SPRINGCLEAN// ESLOPE
#include "p_slopes.h"
#endif
// ========================================================================== // ==========================================================================
// FLOORS // FLOORS

View File

@ -53,15 +53,6 @@
// above this, a height difference is considered as a 'dropoff' // above this, a height difference is considered as a 'dropoff'
#define MAXSTEPMOVE (24*FRACUNIT) #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 USERANGE (64*FRACUNIT)
#define MELEERANGE (64*FRACUNIT) #define MELEERANGE (64*FRACUNIT)
#define MISSILERANGE (32*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_InSpaceSector(mobj_t *mo);
boolean P_InQuicksand(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_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative);
void P_RestoreMusic(player_t *player); void P_RestoreMusic(player_t *player);
void P_SpawnShieldOrb(player_t *player); void P_SpawnShieldOrb(player_t *player);

View File

@ -1756,30 +1756,8 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
} }
else else
{ {
#ifdef ESLOPE // SRB2CBTODO: Checking the things momx/y help with collision issues, but makes going done slopes not as smooth tmfloorz = P_CameraGetFloorZ(thiscam, thiscam->subsector->sector, x, y, NULL);
if (thiscam->subsector->sector && thiscam->subsector->sector->f_slope) tmceilingz = P_CameraGetCeilingZ(thiscam, thiscam->subsector->sector, x, y, NULL);
{
// 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;
} }
// the move is ok, // 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) if (thing->momz <= 0)
thing->standingslope = tmfloorslope; 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) if (!startingonground && tmceilingslope)
P_HandleSlopeLanding(thing, 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)) if (!(thing->flags & MF_NOCLIP))
{ {
fixed_t maxstep = MAXSTEPMOVE; const 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
if (tmceilingz - tmfloorz < thing->height) if (tmceilingz - tmfloorz < thing->height)
return false; // doesn't fit 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) if (glidesector->sector != player->mo->subsector->sector)
{ {
boolean floorclimb = false; boolean floorclimb = false;
fixed_t topheight, bottomheight;
if (glidesector->sector->ffloors) 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)) if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER))
continue; continue;
fixed_t topheight = *rover->topheight; topheight = *rover->topheight;
fixed_t bottomheight = *rover->bottomheight; bottomheight = *rover->bottomheight;
#ifdef ESLOPE #ifdef ESLOPE
if (*rover->t_slope) 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) static boolean PTR_SlideTraverse(intercept_t *in)
{ {
line_t *li; line_t *li;
fixed_t maxstep;
I_Assert(in->isaline); I_Assert(in->isaline);
@ -2584,9 +2554,7 @@ static boolean PTR_SlideTraverse(intercept_t *in)
if (opentop - slidemo->z < slidemo->height) if (opentop - slidemo->z < slidemo->height)
goto isblocking; // mobj is too high goto isblocking; // mobj is too high
maxstep = FixedMul(MAXSTEPMOVE, slidemo->scale); if (openbottom - slidemo->z > FixedMul(MAXSTEPMOVE, slidemo->scale))
if (openbottom - slidemo->z > maxstep)
goto isblocking; // too big a step up goto isblocking; // too big a step up
// this line doesn't block movement // this line doesn't block movement
@ -2607,6 +2575,7 @@ isblocking:
line_t *checkline = li; line_t *checkline = li;
sector_t *checksector; sector_t *checksector;
ffloor_t *rover; ffloor_t *rover;
fixed_t topheight, bottomheight;
boolean fofline = false; boolean fofline = false;
INT32 side = P_PointOnLineSide(slidemo->x, slidemo->y, li); 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)) if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || (rover->flags & FF_BUSTUP))
continue; continue;
fixed_t topheight = *rover->topheight; topheight = *rover->topheight;
fixed_t bottomheight = *rover->bottomheight; bottomheight = *rover->bottomheight;
#ifdef ESLOPE #ifdef ESLOPE
if (*rover->t_slope) 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)) if (thing->subsector->sector->ffloors && (realcrush || thing->flags & MF_PUSHABLE))
{ {
ffloor_t *rover; ffloor_t *rover;
fixed_t topheight, bottomheight;
fixed_t delta1, delta2; fixed_t delta1, delta2;
INT32 thingtop = thing->z + thing->height; 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)) || ((rover->flags & FF_BLOCKOTHERS) && !thing->player)) || !(rover->flags & FF_EXISTS))
continue; continue;
fixed_t topheight = *rover->topheight; topheight = *rover->topheight;
fixed_t bottomheight = *rover->bottomheight; bottomheight = *rover->bottomheight;
/*#ifdef ESLOPE /*#ifdef ESLOPE
if (rover->t_slope) if (rover->t_slope)

View File

@ -21,9 +21,6 @@
#include "p_maputl.h" #include "p_maputl.h"
#include "p_polyobj.h" #include "p_polyobj.h"
#include "z_zone.h" #include "z_zone.h"
#ifdef SPRINGCLEAN// ESLOPE
#include "p_slopes.h"
#endif
// //
// P_AproxDistance // P_AproxDistance
@ -862,6 +859,7 @@ void P_SetThingPosition(mobj_t *thing)
{ // link into subsector { // link into subsector
subsector_t *ss; subsector_t *ss;
sector_t *oldsec = NULL; sector_t *oldsec = NULL;
fixed_t tfloorz, tceilz;
I_Assert(thing != NULL); I_Assert(thing != NULL);
I_Assert(!P_MobjWasRemoved(thing)); I_Assert(!P_MobjWasRemoved(thing));
@ -871,11 +869,6 @@ void P_SetThingPosition(mobj_t *thing)
ss = thing->subsector = R_PointInSubsector(thing->x, thing->y); 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)) if (!(thing->flags & MF_NOSECTOR))
{ {
// invisible things don't go into the sector links // 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. // sector's floor is the same height.
if (thing->player && oldsec != NULL && thing->subsector && oldsec != thing->subsector->sector) 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->eflags & MFE_VERTICALFLIP)
{ {
if (thing->z + thing->height >= tceilz) if (thing->z + thing->height >= tceilz)

View File

@ -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)) if (!P_TryMove(mo, mo->x + xmove, mo->y + ymove, true) && !(mo->eflags & MFE_SPRUNG))
{ {
// blocked move // blocked move
if (player) { if (player) {
moved = false; moved = false;
if (player->bot) if (player->bot)

View File

@ -28,11 +28,6 @@
// Needs precompiled tables/data structures. // Needs precompiled tables/data structures.
#include "info.h" #include "info.h"
// For slope code, we need v3float_t
#ifdef ESLOPE
//#include "r_defs.h"
#endif
// //
// NOTES: mobj_t // NOTES: mobj_t
// //

View File

@ -33,9 +33,6 @@
#include "m_misc.h" #include "m_misc.h"
#include "m_cond.h" //unlock triggers #include "m_cond.h" //unlock triggers
#include "lua_hook.h" // LUAh_LinedefExecute #include "lua_hook.h" // LUAh_LinedefExecute
#ifdef ESLOPE
#include "p_slopes.h"
#endif
#ifdef HW3SOUND #ifdef HW3SOUND
#include "hardware/hw3sound.h" #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) static void P_RunSpecialSectorCheck(player_t *player, sector_t *sector)
{ {
boolean nofloorneeded = false; boolean nofloorneeded = false;
fixed_t f_affectpoint, c_affectpoint;
if (!sector->special) // nothing special, exit if (!sector->special) // nothing special, exit
return; return;
@ -4584,8 +4582,8 @@ static void P_RunSpecialSectorCheck(player_t *player, sector_t *sector)
return; return;
} }
fixed_t f_affectpoint = P_GetFloorZ(player->mo, sector, player->mo->x, player->mo->y, NULL);//sector->floorheight; f_affectpoint = P_GetFloorZ(player->mo, sector, player->mo->x, player->mo->y, NULL);
fixed_t c_affectpoint = P_GetCeilingZ(player->mo, sector, player->mo->x, player->mo->y, NULL);//sector->ceilingheight; c_affectpoint = P_GetCeilingZ(player->mo, sector, player->mo->x, player->mo->y, NULL);
// Only go further if on the ground // Only go further if on the ground
if ((sector->flags & SF_FLIPSPECIAL_FLOOR) && !(sector->flags & SF_FLIPSPECIAL_CEILING) && player->mo->z != f_affectpoint) 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) || GETSECSPECIAL(referrer->special, 3) == 3)
foundfloor = true; foundfloor = true;
} }
else if ( else if (!(GETSECSPECIAL(sec->special, 3) == 2
#ifdef ESLOPE || GETSECSPECIAL(sec->special, 3) == 3))
(!sec->f_slope) &&
#endif
(!(GETSECSPECIAL(sec->special, 3) == 2
|| GETSECSPECIAL(sec->special, 3) == 3)))
return; return;
if (p->roverpusher && foundfloor == false) // Not even a 3d floor has the PUSH_MASK. if (p->roverpusher && foundfloor == false) // Not even a 3d floor has the PUSH_MASK.

View File

@ -1197,87 +1197,6 @@ boolean P_IsObjectOnGround(mobj_t *mo)
return false; 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 // P_IsObjectOnGroundIn
// //

View File

@ -2225,6 +2225,9 @@ angle_t tantoangle[2049] =
536870912 536870912
}; };
#ifdef NEED_FIXED_VECTOR
static angle_t fineacon[65536*2] = { static angle_t fineacon[65536*2] = {
ANGLE_MAX, 2143707442, 2142143280, 2140943052, 2139931208, 2139039753, 2138233813, 2137492672, 2136802831, 2136154917, 2135542102, 2134959233, 2134402306, 2133868139, 2133354148, 2132858208, 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, 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]; return fineacon[((x<<(FINE_FRACBITS-FRACBITS)))+FRACUNIT];
} }
#ifdef NEED_FIXED_VECTOR
// //
// AngleBetweenVectors // AngleBetweenVectors
// //

View File

@ -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) // and with a factor, with +factor for (fa/factor) and -factor for (fa*factor)
FUNCMATH angle_t FixedAngleC(fixed_t fa, fixed_t 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 #ifdef NEED_FIXED_VECTOR
/// The FixedAcos function
FUNCMATH angle_t FixedAcos(fixed_t x);
/// Fixed Point Vector functions /// Fixed Point Vector functions
angle_t FV2_AngleBetweenVectors(const vector2_t *Vector1, const vector2_t *Vector2); angle_t FV2_AngleBetweenVectors(const vector2_t *Vector1, const vector2_t *Vector2);
angle_t FV3_AngleBetweenVectors(const vector3_t *Vector1, const vector3_t *Vector2); angle_t FV3_AngleBetweenVectors(const vector3_t *Vector1, const vector3_t *Vector2);