mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 15:02:39 +00:00
Fix slope inconsistency for 64bit
- Fixed: Slope logic would change between 32bit and 64bit due to float math.
This commit is contained in:
parent
92143f90fa
commit
9ccb839ae2
1 changed files with 3 additions and 5 deletions
|
@ -736,11 +736,9 @@ bool PIT_CheckLine(line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
|
||||||
else
|
else
|
||||||
{ // Find the point on the line closest to the actor's center, and use
|
{ // Find the point on the line closest to the actor's center, and use
|
||||||
// that to calculate openings
|
// that to calculate openings
|
||||||
float dx = (float)ld->dx;
|
SQWORD r_den = (SQWORD(ld->dx)*ld->dx + SQWORD(ld->dy)*ld->dy) / (1 << 24);
|
||||||
float dy = (float)ld->dy;
|
SQWORD r_num = ((SQWORD(tm.x - ld->v1->x)*ld->dx) + (SQWORD(tm.y - ld->v1->y)*ld->dy));
|
||||||
fixed_t r = (fixed_t)(((float)(tm.x - ld->v1->x) * dx +
|
fixed_t r = (fixed_t)(r_num / r_den);
|
||||||
(float)(tm.y - ld->v1->y) * dy) /
|
|
||||||
(dx*dx + dy*dy) * 16777216.f);
|
|
||||||
/* Printf ("%d:%d: %d (%d %d %d %d) (%d %d %d %d)\n", level.time, ld-lines, r,
|
/* Printf ("%d:%d: %d (%d %d %d %d) (%d %d %d %d)\n", level.time, ld-lines, r,
|
||||||
ld->frontsector->floorplane.a,
|
ld->frontsector->floorplane.a,
|
||||||
ld->frontsector->floorplane.b,
|
ld->frontsector->floorplane.b,
|
||||||
|
|
Loading…
Reference in a new issue