05-31-2014, 08:03 AM
(This post was last modified: 05-31-2014, 09:12 AM by Silverthorn.)
So far, I haven't been working with C++, but I am quite sure that there is a sort-algorithm implemented (I'd be disappointed if it's not). So, sort LOADED.ON_SCREEN_OBJS according to their posz-value, then iterate over these objects and draw them. Even if you have backup your array (i.e. create a key-value-list where key=object-num and value=posz) before sorting, this should take n + n*log n + n operations (n=number of objects) in total.
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~
"Freeze, you're under vrest!" - Mark, probably.
» Gallery | » Sprites | » DeviantArt
~ Breaking LFE since 2008 ~
"Freeze, you're under vrest!" - Mark, probably.
» Gallery | » Sprites | » DeviantArt

Chat
