Hi,
Thoughts for optimising:
Try a fast square root calculation:
http://supp.iar.com/FilesPublic/SUPPORT/000419/AN-G-002.pdf
How about a square root lookup table? (memory hog!)
In your move loop try to use multiplication rather than division. Have a Const in your type:
Const sz:Float = 1.0 / GRIDSIZE
And replace:
XGridCurr=XPos / GRIDSIZE
YGridCurr=YPos / GRIDSIZE
With..
XGridCurr=XPos * sz
YGridCurr=YPos * sz
Same thing for the division in your draw loop:
this could be pre-calculated > (480.0/PIX_PLAYAREA)
Your demo averages 5ms, with some of the things I said there I got it down to a 'flickery 4!' :P
Thoughts for optimising:
Try a fast square root calculation:
http://supp.iar.com/FilesPublic/SUPPORT/000419/AN-G-002.pdf
How about a square root lookup table? (memory hog!)
In your move loop try to use multiplication rather than division. Have a Const in your type:
Const sz:Float = 1.0 / GRIDSIZE
And replace:
XGridCurr=XPos / GRIDSIZE
YGridCurr=YPos / GRIDSIZE
With..
XGridCurr=XPos * sz
YGridCurr=YPos * sz
Same thing for the division in your draw loop:
this could be pre-calculated > (480.0/PIX_PLAYAREA)
Your demo averages 5ms, with some of the things I said there I got it down to a 'flickery 4!' :P