Skip to content
Snippets Groups Projects
Commit 090f304f authored by Lactozilla's avatar Lactozilla :speech_balloon:
Browse files

Use 64-bit x/y in R_GetSlopeZAt

parent 8f47a7e9
No related branches found
No related tags found
1 merge request!1464Fix slope plane rotation and alignment (resolves #508)
...@@ -693,13 +693,13 @@ static void R_DrawSkyPlane(visplane_t *pl) ...@@ -693,13 +693,13 @@ static void R_DrawSkyPlane(visplane_t *pl)
// Returns the height of the sloped plane at (x, y) as a 32.16 fixed_t // Returns the height of the sloped plane at (x, y) as a 32.16 fixed_t
static INT64 R_GetSlopeZAt(const pslope_t *slope, fixed_t x, fixed_t y) static INT64 R_GetSlopeZAt(const pslope_t *slope, fixed_t x, fixed_t y)
{ {
x = ((INT64)x - (INT64)slope->o.x); INT64 x64 = ((INT64)x - (INT64)slope->o.x);
y = ((INT64)y - (INT64)slope->o.y); INT64 y64 = ((INT64)y - (INT64)slope->o.y);
x = (x * (INT64)slope->d.x) / FRACUNIT; x64 = (x64 * (INT64)slope->d.x) / FRACUNIT;
y = (y * (INT64)slope->d.y) / FRACUNIT; y64 = (y64 * (INT64)slope->d.y) / FRACUNIT;
return (INT64)slope->o.z + ((x + y) * (INT64)slope->zdelta) / FRACUNIT; return (INT64)slope->o.z + ((x64 + y64) * (INT64)slope->zdelta) / FRACUNIT;
} }
// Sets the texture origin vector of the sloped plane. // Sets the texture origin vector of the sloped plane.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment