Array Tlist and leaks

BlitzMax Forums/BlitzMax Beginners Area/Array Tlist and leaks

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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