mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
LunaCON: fix 'getincangle'.
git-svn-id: https://svn.eduke32.com/eduke32@4362 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e0ed3688f9
commit
acc4d12f4b
1 changed files with 6 additions and 7 deletions
|
@ -1611,14 +1611,13 @@ end
|
|||
function _angdiff(a1, a2)
|
||||
a1 = band(a1, 2047)
|
||||
a2 = band(a2, 2047)
|
||||
-- a1 and a2 are in [0, 2047]
|
||||
if (abs(a2-a1) < 1024) then
|
||||
return abs(a2-a1)
|
||||
|
||||
if (abs(a2-a1) >= 1024) then
|
||||
if (a2 > 1024) then a2 = a2 - 2048 end
|
||||
if (a1 > 1024) then a1 = a1 - 2048 end
|
||||
end
|
||||
-- |a2-a1| >= 1024
|
||||
if (a2 > 1024) then a2=a2-2048 end
|
||||
if (a1 > 1024) then a1=a1-2048 end
|
||||
-- a1 and a2 is in [-1023, 1024]
|
||||
|
||||
-- a1, a2 are in [-1023, 1024]
|
||||
return a2-a1
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue