home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / SAT 2.4.0 / SAT / Add-ons / Sprite behavior / SortingUtils.h < prev    next >
Encoding:
Text File  |  1997-03-01  |  1.3 KB  |  31 lines  |  [TEXT/KAHL]

  1. // SortingUtils
  2.  
  3. /**** Sprite sorting routines. ****/
  4.  
  5. /*But doesn't SAT sort automatically, unless you turn sorting off? Yes, it does, but there are*/
  6. /*times when you know more than SAT concerning how to sort. SAT does its best, but it can't*/
  7. /*know that you are moving around one sprite (as in the Bricks demo) and need to sort that*/
  8. /*and nothing else; SAT has to check them all.*/
  9. /**/
  10. /*Use the SortOne routines if you have one sprite that needs to be perfectly sorted.*/
  11. /**/
  12. /*If you want to sort the entire sprite list, use BucketSort. The actual sorting is extremely*/
  13. /*fast, but does not keep track of what sprites were moved. If you use SATRun2, you may*/
  14. /*need to set the "dirty" flags to make all sprites redraw.*/
  15.  
  16. #include <SAT.h>
  17.  
  18. /*Unlinks a sprite from the sprite list.*/
  19. pascal void UnlinkSprite(SpritePtr sp);
  20.  
  21. /*Puts a certain sprite at a sorted position according to layer.*/
  22. pascal void SortOne(SpritePtr sp);
  23. pascal void SortOneV(SpritePtr sp);
  24.  
  25. /*BucketSort is useful if you need to make sure the sprite list gets sorted at*/
  26. /*once - and it is really fast! It is designed for sorting after the layer field, so if you*/
  27. /*want it to sort after the vertical position, you need to edit it.*/
  28. pascal void BucketSort(short minLayer, short maxLayer);
  29. pascal void BucketSortV(short minLayer, short maxLayer);
  30.  
  31.