[Ohrrpgce] SVN: james/2512 New commands "set sort order" and "sort children" for easy custom sortin

Ralph Versteegen teeemcee at gmail.com
Fri Jan 30 10:15:50 PST 2009


2009/1/25  <subversion at hamsterrepublic.com>:
> james
> 2009-01-24 22:27:13 -0800 (Sat, 24 Jan 2009)
> 159
> New commands "set sort order" and "sort children" for easy custom sorting
> of sibling slices without need for fancy looping voodoo. Added examples
> to the docs.
> ---
> U   wip/docs/plotdict.xml
> U   wip/docs/plotdictionary.html
> U   wip/plotscr.hsd
> U   wip/slices.bas
> U   wip/slices.bi
> U   wip/testgame/slicetest.hss
> U   wip/testgame/slicetest.rpg
> U   wip/whatsnew.txt
> U   wip/yetmore.bas

Great! I was just ranting to IM how without an easy way to draw by Y
and Z values instead of rearranging children, sprites wouldn't be any
better than NPC's for my needs; I hadn't noticed these.

Firstly, EGADS! "Y sort children" and "sort children" do NOT perform
stable sorts as advertised in the wiki!

However, I think that wiping the sort value for sprites while sorting
them is a bad idea. Whether it's wiped MUST be an optional argument to
sortchildren. I really think it shouldn't by default. You'd only want
to wipe the sort values if you're using sort children as a hack to get
around the difficulty of using nextsibling.

Also, what about options (similar to fill parent) which automatically
sort children by Y or Z every time they are drawn? With a suitable
stable sort algorithm, sorting an already sorted list would be quick.



More information about the Ohrrpgce mailing list