Page 1 of 1

is a fix32 positive only?

Posted: Mon Feb 22, 2016 7:30 am
by POLYGAMe
I am having problems with numbers less than zero in scrolling my road. It works fine scrolling right but when I scroll left and it gets below zero it turns to garbled gfx. Is fix32 positive only or perhaps the problem is with the fix32toint function? What other options are there?

Re: is a fix32 positive only?

Posted: Mon Feb 22, 2016 8:16 am
by POLYGAMe
Here's a video showing what I mean:

https://www.youtube.com/watch?v=bAfB155 ... e=youtu.be

Re: is a fix32 positive only?

Posted: Mon Feb 22, 2016 8:38 am
by Stef
Fix32 is signed but it all depends from your code implementation : having a single non signed comparison can make every thing wrong !

Re: is a fix32 positive only?

Posted: Mon Feb 22, 2016 8:47 am
by POLYGAMe
Stef wrote:Fix32 is signed but it all depends from your code implementation : having a single non signed comparison can make every thing wrong !
Good point. I'll take a closer look at my code. I could be using a u16 somewhere...

Re: is a fix32 positive only?

Posted: Mon Feb 22, 2016 9:34 am
by POLYGAMe
Found the culprit - my offset variable was a u16. Oops! All working now :D