diff --git a/src/m_fixed.h b/src/m_fixed.h index 70402f27..34fd25db 100644 --- a/src/m_fixed.h +++ b/src/m_fixed.h @@ -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", \ diff --git a/src/r_defs.h b/src/r_defs.h index 2c5860ee..3669ec8f 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -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 { diff --git a/src/r_main.c b/src/r_main.c index 498f4dab..e1fe0dce 100644 --- a/src/r_main.c +++ b/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) diff --git a/src/r_main.h b/src/r_main.h index 8f46a938..2e768cb9 100644 --- a/src/r_main.h +++ b/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);