[script]Pitch broken for REAL now.
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [script]Pitch broken for REAL now.
Exactly. If this comes up again, it's a handy tool to do a quick check.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [script]Pitch broken for REAL now.
And here's some output I created on an iPad:
(No, that's not ZDoom running, I just copied the test stuff into an App I am currently working on)
And yes, xs_RoundToInt is the only method that works here, too!
(No, that's not ZDoom running, I just copied the test stuff into an App I am currently working on)
Code: Select all
Angle = -900.00000: xs_RoundToInt = 80000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -855.00000: xs_RoundToInt = a0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -810.00000: xs_RoundToInt = c0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -765.00000: xs_RoundToInt = e0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -720.00000: xs_RoundToInt = 00000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -675.00000: xs_RoundToInt = 20000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -630.00000: xs_RoundToInt = 40000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -585.00000: xs_RoundToInt = 60000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -540.00000: xs_RoundToInt = 80000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -495.00000: xs_RoundToInt = a0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -450.00000: xs_RoundToInt = c0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -405.00000: xs_RoundToInt = e0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -360.00000: xs_RoundToInt = 00000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -315.00000: xs_RoundToInt = 20000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -270.00000: xs_RoundToInt = 40000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -225.00000: xs_RoundToInt = 60000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -180.00000: xs_RoundToInt = 80000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -135.00000: xs_RoundToInt = a0000000, unsigned cast = 00000000, signed cast = a0000000
Angle = -90.00000: xs_RoundToInt = c0000000, unsigned cast = 00000000, signed cast = c0000000
Angle = -45.00000: xs_RoundToInt = e0000000, unsigned cast = 00000000, signed cast = e0000000
Angle = 0.00000: xs_RoundToInt = 00000000, unsigned cast = 00000000, signed cast = 00000000
Angle = 45.00000: xs_RoundToInt = 20000000, unsigned cast = 20000000, signed cast = 20000000
Angle = 90.00000: xs_RoundToInt = 40000000, unsigned cast = 40000000, signed cast = 40000000
Angle = 135.00000: xs_RoundToInt = 60000000, unsigned cast = 60000000, signed cast = 60000000
Angle = 180.00000: xs_RoundToInt = 80000000, unsigned cast = 80000000, signed cast = 7fffffff
Angle = 225.00000: xs_RoundToInt = a0000000, unsigned cast = a0000000, signed cast = 7fffffff
Angle = 270.00000: xs_RoundToInt = c0000000, unsigned cast = c0000000, signed cast = 7fffffff
Angle = 315.00000: xs_RoundToInt = e0000000, unsigned cast = e0000000, signed cast = 7fffffff
Angle = 360.00000: xs_RoundToInt = 00000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 405.00000: xs_RoundToInt = 20000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 450.00000: xs_RoundToInt = 40000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 495.00000: xs_RoundToInt = 60000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 540.00000: xs_RoundToInt = 80000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 585.00000: xs_RoundToInt = a0000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 630.00000: xs_RoundToInt = c0000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 675.00000: xs_RoundToInt = e0000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 720.00000: xs_RoundToInt = 00000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 765.00000: xs_RoundToInt = 20000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 810.00000: xs_RoundToInt = 40000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 855.00000: xs_RoundToInt = 60000000, unsigned cast = ffffffff, signed cast = 7fffffff
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [script]Pitch broken for REAL now.
... which begs the question: If we want reproducable results for float -> int conversions in general because of netgame consistency, I think there's a lot more code that needs to be refactored.
But that's something someone else will have to do...
But that's something someone else will have to do...
- Major Cooke
- Posts: 8175
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: [script]Pitch broken for REAL now.
Just a heads up, this means GZDoom won't compile because bam2rad is missing for now.
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: [script]Pitch broken for REAL now.
I believe the problem is more related to the use of intermediate operations with one or more operands in float, then convert the result to int. See what I had to do to fix this bug.Graf Zahl wrote:... which begs the question: If we want reproducable results for float -> int conversions in general because of netgame consistency, I think there's a lot more code that needs to be refactored.
But that's something someone else will have to do...
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [script]Pitch broken for REAL now.
Major Cooke wrote:Just a heads up, this means GZDoom won't compile because bam2rad is missing for now.
I'll get there.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [script]Pitch broken for REAL now.
Edward-san wrote:I believe the problem is more related to the use of intermediate operations with one or more operands in float, then convert the result to int. See what I had to do to fix this bug.Graf Zahl wrote:... which begs the question: If we want reproducable results for float -> int conversions in general because of netgame consistency, I think there's a lot more code that needs to be refactored.
But that's something someone else will have to do...
Yes, but if some overflow gets incorrectly truncated, effects can be similar. Who knows what's really in there...