mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 12:21:19 +00:00
Merge branch 'remove-secplanes' into 'master'
Remove secplanes This is just removing SSNTails's old port of ZDoom's secplane code and math, from back when he attempted slopes himself. The slopes we've had since 2.1.15 however do not need these, so we can pretty much toss the code for them out now (nothing uses them anyway). See merge request !149
This commit is contained in:
commit
5400707aa7
4 changed files with 0 additions and 119 deletions
|
@ -46,41 +46,6 @@ typedef INT32 fixed_t;
|
|||
#define FLOAT_TO_FIXED(f) (fixed_t)((f) * ((float)FRACUNIT))
|
||||
|
||||
|
||||
/** \brief The TMulScale16 function
|
||||
|
||||
\param a a parameter of type fixed_t
|
||||
\param b a parameter of type fixed_t
|
||||
\param c a parameter of type fixed_t
|
||||
\param d a parameter of type fixed_t
|
||||
\param e a parameter of type fixed_t
|
||||
\param f a parameter of type fixed_t
|
||||
|
||||
\return fixed_t
|
||||
|
||||
|
||||
*/
|
||||
FUNCMATH FUNCINLINE static ATTRINLINE fixed_t TMulScale16(fixed_t a, fixed_t b, fixed_t c, fixed_t d, fixed_t e, fixed_t f) \
|
||||
{ \
|
||||
return (fixed_t)((((INT64)a * (INT64)b) + ((INT64)c * (INT64)d) \
|
||||
+ ((INT64)e * (INT64)f)) >> 16); \
|
||||
}
|
||||
|
||||
/** \brief The DMulScale16 function
|
||||
|
||||
\param a a parameter of type fixed_t
|
||||
\param b a parameter of type fixed_t
|
||||
\param c a parameter of type fixed_t
|
||||
\param d a parameter of type fixed_t
|
||||
|
||||
\return fixed_t
|
||||
|
||||
|
||||
*/
|
||||
FUNCMATH FUNCINLINE static ATTRINLINE fixed_t DMulScale16(fixed_t a, fixed_t b, fixed_t c, fixed_t d) \
|
||||
{ \
|
||||
return (fixed_t)((((INT64)a * (INT64)b) + ((INT64)c * (INT64)d)) >> 16); \
|
||||
}
|
||||
|
||||
#if defined (__WATCOMC__) && FRACBITS == 16
|
||||
#pragma aux FixedMul = \
|
||||
"imul ebx", \
|
||||
|
|
|
@ -224,15 +224,6 @@ typedef struct linechain_s
|
|||
|
||||
|
||||
|
||||
// ZDoom C++ to Legacy C conversion Tails 04-29-2002 (for slopes)
|
||||
typedef struct secplane_t
|
||||
{
|
||||
// the plane is defined as a*x + b*y + c*z + d = 0
|
||||
// ic is 1/c, for faster Z calculations
|
||||
|
||||
fixed_t a, b, c, d, ic;
|
||||
} secplane_t;
|
||||
|
||||
// Slopes
|
||||
#ifdef ESLOPE
|
||||
typedef enum {
|
||||
|
|
63
src/r_main.c
63
src/r_main.c
|
@ -366,69 +366,6 @@ fixed_t R_PointToDist(fixed_t x, fixed_t y)
|
|||
return R_PointToDist2(viewx, viewy, x, y);
|
||||
}
|
||||
|
||||
/***************************************
|
||||
*** Zdoom C++ to Legacy C conversion ***
|
||||
****************************************/
|
||||
|
||||
// Utility to find the Z height at an XY location in a sector (for slopes)
|
||||
fixed_t R_SecplaneZatPoint(secplane_t *secplane, fixed_t x, fixed_t y)
|
||||
{
|
||||
return FixedMul(secplane->ic, -secplane->d - DMulScale16(secplane->a, x, secplane->b, y));
|
||||
}
|
||||
|
||||
// Returns the value of z at (x,y) if d is equal to dist
|
||||
fixed_t R_SecplaneZatPointDist (secplane_t *secplane, fixed_t x, fixed_t y, fixed_t dist)
|
||||
{
|
||||
return FixedMul(secplane->ic, -dist - DMulScale16(secplane->a, x, secplane->b, y));
|
||||
}
|
||||
|
||||
// Flips the plane's vertical orientiation, so that if it pointed up,
|
||||
// it will point down, and vice versa.
|
||||
void R_SecplaneFlipVert(secplane_t *secplane)
|
||||
{
|
||||
secplane->a = -secplane->a;
|
||||
secplane->b = -secplane->b;
|
||||
secplane->c = -secplane->c;
|
||||
secplane->d = -secplane->d;
|
||||
secplane->ic = -secplane->ic;
|
||||
}
|
||||
|
||||
// Returns true if 2 planes are the same
|
||||
boolean R_ArePlanesSame(secplane_t *original, secplane_t *other)
|
||||
{
|
||||
return original->a == other->a && original->b == other->b
|
||||
&& original->c == other->c && original->d == other->d;
|
||||
}
|
||||
|
||||
// Returns true if 2 planes are different
|
||||
boolean R_ArePlanesDifferent(secplane_t *original, secplane_t *other)
|
||||
{
|
||||
return original->a != other->a || original->b != other->b
|
||||
|| original->c != other->c || original->d != other->d;
|
||||
}
|
||||
|
||||
// Moves a plane up/down by hdiff units
|
||||
void R_SecplaneChangeHeight(secplane_t *secplane, fixed_t hdiff)
|
||||
{
|
||||
secplane->d = secplane->d - FixedMul(hdiff, secplane->c);
|
||||
}
|
||||
|
||||
// Returns how much this plane's height would change if d were set to oldd
|
||||
fixed_t R_SecplaneHeightDiff(secplane_t *secplane, fixed_t oldd)
|
||||
{
|
||||
return FixedMul(oldd - secplane->d, secplane->ic);
|
||||
}
|
||||
|
||||
fixed_t R_SecplanePointToDist(secplane_t *secplane, fixed_t x, fixed_t y, fixed_t z)
|
||||
{
|
||||
return -TMulScale16(secplane->a, x, y, secplane->b, z, secplane->c);
|
||||
}
|
||||
|
||||
fixed_t R_SecplanePointToDist2(secplane_t *secplane, fixed_t x, fixed_t y, fixed_t z)
|
||||
{
|
||||
return -TMulScale16(secplane->a, x, secplane->b, y, z, secplane->c);
|
||||
}
|
||||
|
||||
//
|
||||
// R_ScaleFromGlobalAngle
|
||||
// Returns the texture mapping scale for the current line (horizontal span)
|
||||
|
|
12
src/r_main.h
12
src/r_main.h
|
@ -61,18 +61,6 @@ angle_t R_PointToAngle2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1);
|
|||
fixed_t R_PointToDist(fixed_t x, fixed_t y);
|
||||
fixed_t R_PointToDist2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1);
|
||||
|
||||
// ZDoom C++ to Legacy C conversion Tails 04-29-2002
|
||||
fixed_t R_SecplaneZatPoint(secplane_t *secplane, fixed_t x, fixed_t y);
|
||||
fixed_t R_SecplaneZatPointDist(secplane_t *secplane, fixed_t x, fixed_t y,
|
||||
fixed_t dist);
|
||||
void R_SecplaneFlipVert(secplane_t *secplane);
|
||||
boolean R_ArePlanesSame(secplane_t *original, secplane_t *other);
|
||||
boolean R_ArePlanesDifferent(secplane_t *original, secplane_t *other);
|
||||
void R_SecplaneChangeHeight(secplane_t *secplane, fixed_t hdiff);
|
||||
fixed_t R_SecplaneHeightDiff(secplane_t *secplane, fixed_t oldd);
|
||||
fixed_t R_SecplanePointToDist(secplane_t *secplane, fixed_t x, fixed_t y, fixed_t z);
|
||||
fixed_t R_SecplanePointToDist2(secplane_t *secplane, fixed_t x, fixed_t y, fixed_t z);
|
||||
|
||||
fixed_t R_ScaleFromGlobalAngle(angle_t visangle);
|
||||
subsector_t *R_PointInSubsector(fixed_t x, fixed_t y);
|
||||
subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y);
|
||||
|
|
Loading…
Reference in a new issue