mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 04:41:23 +00:00
Merge branch 'pointtoangle-fix' into 'next'
Tweaks to R_PointToAngle and R_PointToAngle2 Exactly what it says in the title! See commit description for more information on what I did, since I'm too lazy to write it all up a second time. =P Could someone check that these changes don't cause anything else in particular to go wrong in the game or source code? I haven't checked myself that much yet, mostly because I totally forgot about this thing until now, lol. See merge request !19
This commit is contained in:
commit
79ecbc407e
1 changed files with 8 additions and 8 deletions
16
src/r_main.c
16
src/r_main.c
|
@ -316,13 +316,13 @@ angle_t R_PointToAngle(fixed_t x, fixed_t y)
|
|||
x >= 0 ?
|
||||
y >= 0 ?
|
||||
(x > y) ? tantoangle[SlopeDiv(y,x)] : // octant 0
|
||||
ANGLE_90-1-tantoangle[SlopeDiv(x,y)] : // octant 1
|
||||
ANGLE_90-tantoangle[SlopeDiv(x,y)] : // octant 1
|
||||
x > (y = -y) ? 0-tantoangle[SlopeDiv(y,x)] : // octant 8
|
||||
ANGLE_270+tantoangle[SlopeDiv(x,y)] : // octant 7
|
||||
y >= 0 ? (x = -x) > y ? ANGLE_180-1-tantoangle[SlopeDiv(y,x)] :// octant 3
|
||||
y >= 0 ? (x = -x) > y ? ANGLE_180-tantoangle[SlopeDiv(y,x)] : // octant 3
|
||||
ANGLE_90 + tantoangle[SlopeDiv(x,y)] : // octant 2
|
||||
(x = -x) > (y = -y) ? ANGLE_180+tantoangle[ SlopeDiv(y,x)] : // octant 4
|
||||
ANGLE_270-1-tantoangle[SlopeDiv(x,y)] : // octant 5
|
||||
(x = -x) > (y = -y) ? ANGLE_180+tantoangle[SlopeDiv(y,x)] : // octant 4
|
||||
ANGLE_270-tantoangle[SlopeDiv(x,y)] : // octant 5
|
||||
0;
|
||||
}
|
||||
|
||||
|
@ -332,13 +332,13 @@ angle_t R_PointToAngle2(fixed_t pviewx, fixed_t pviewy, fixed_t x, fixed_t y)
|
|||
x >= 0 ?
|
||||
y >= 0 ?
|
||||
(x > y) ? tantoangle[SlopeDiv(y,x)] : // octant 0
|
||||
ANGLE_90-1-tantoangle[SlopeDiv(x,y)] : // octant 1
|
||||
ANGLE_90-tantoangle[SlopeDiv(x,y)] : // octant 1
|
||||
x > (y = -y) ? 0-tantoangle[SlopeDiv(y,x)] : // octant 8
|
||||
ANGLE_270+tantoangle[SlopeDiv(x,y)] : // octant 7
|
||||
y >= 0 ? (x = -x) > y ? ANGLE_180-1-tantoangle[SlopeDiv(y,x)] :// octant 3
|
||||
y >= 0 ? (x = -x) > y ? ANGLE_180-tantoangle[SlopeDiv(y,x)] : // octant 3
|
||||
ANGLE_90 + tantoangle[SlopeDiv(x,y)] : // octant 2
|
||||
(x = -x) > (y = -y) ? ANGLE_180+tantoangle[ SlopeDiv(y,x)] : // octant 4
|
||||
ANGLE_270-1-tantoangle[SlopeDiv(x,y)] : // octant 5
|
||||
(x = -x) > (y = -y) ? ANGLE_180+tantoangle[SlopeDiv(y,x)] : // octant 4
|
||||
ANGLE_270-tantoangle[SlopeDiv(x,y)] : // octant 5
|
||||
0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue