mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-18 22:51:39 +00:00
fixed: R_PointOnSideSlow had precision issues with very short lines.
When this function was originally written there was no possibility of fractional vertex coordinates so it threw away the fractional parts of the node's directional vector (which in the original nodes was always 0.) Now, with UDMF and high precision vertices this no longer works and the loss of significant parts of their value caused this code to produce erroneous results if the linedefs were only a few map units long and using fractional positions.
This commit is contained in:
parent
48163de8e2
commit
f482dc094d
1 changed files with 5 additions and 4 deletions
|
@ -434,8 +434,8 @@ static int R_PointOnSideSlow (fixed_t x, fixed_t y, node_t *node)
|
|||
// add on a 386/486, but it certainly isn't on anything newer than that.
|
||||
fixed_t dx;
|
||||
fixed_t dy;
|
||||
fixed_t left;
|
||||
fixed_t right;
|
||||
double left;
|
||||
double right;
|
||||
|
||||
if (!node->dx)
|
||||
{
|
||||
|
@ -466,8 +466,9 @@ static int R_PointOnSideSlow (fixed_t x, fixed_t y, node_t *node)
|
|||
return 0;
|
||||
}
|
||||
|
||||
left = FixedMul ( node->dy>>FRACBITS , dx );
|
||||
right = FixedMul ( dy , node->dx>>FRACBITS );
|
||||
// we must use doubles here because the fixed point code will produce errors due to loss of precision for extremely short linedefs.
|
||||
left = (double)node->dy * (double)dx;
|
||||
right = (double)dy * (double)node->dx;
|
||||
|
||||
if (right < left)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue