is a fix32 positive only?
Moderator: Stef
-
- Very interested
- Posts: 151
- Joined: Sun Apr 14, 2013 1:19 am
- Location: Auckland, New Zealand
- Contact:
is a fix32 positive only?
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?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: is a fix32 positive only?
Fix32 is signed but it all depends from your code implementation : having a single non signed comparison can make every thing wrong !
-
- Very interested
- Posts: 151
- Joined: Sun Apr 14, 2013 1:19 am
- Location: Auckland, New Zealand
- Contact:
Re: is a fix32 positive only?
Good point. I'll take a closer look at my code. I could be using a u16 somewhere...Stef wrote:Fix32 is signed but it all depends from your code implementation : having a single non signed comparison can make every thing wrong !
-
- Very interested
- Posts: 151
- Joined: Sun Apr 14, 2013 1:19 am
- Location: Auckland, New Zealand
- Contact:
Re: is a fix32 positive only?
Found the culprit - my offset variable was a u16. Oops! All working now