Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SortSprites()

void Microsoft.Xna.Framework.Graphics.SpriteBatch.SortSprites ( )
inlineprivate

Definition at line 671 of file SpriteBatch.cs.

672 {
673 if (sortIndices == null || sortIndices.Length < spriteQueueCount)
674 {
675 sortIndices = new int[spriteQueueCount];
676 sortedSprites = new SpriteInfo[spriteQueueCount];
677 }
679 switch (spriteSortMode)
680 {
681 case SpriteSortMode.Texture:
682 if (textureComparer == null)
683 {
684 textureComparer = new TextureComparer(this);
685 }
687 break;
688 case SpriteSortMode.BackToFront:
689 if (backToFrontComparer == null)
690 {
691 backToFrontComparer = new BackToFrontComparer(this);
692 }
694 break;
695 case SpriteSortMode.FrontToBack:
696 if (frontToBackComparer == null)
697 {
698 frontToBackComparer = new FrontToBackComparer(this);
699 }
701 break;
702 default:
703 throw new NotSupportedException();
704 }
705 for (int i = 0; i < spriteQueueCount; i++)
706 {
707 sortIndices[i] = i;
708 }
710 }
static void Sort(Array array)
Definition Array.cs:2329

References Microsoft.Xna.Framework.Graphics.SpriteBatch.backToFrontComparer, System.comparer, Microsoft.Xna.Framework.Graphics.SpriteBatch.frontToBackComparer, System.Array.Sort(), Microsoft.Xna.Framework.Graphics.SpriteBatch.sortedSprites, Microsoft.Xna.Framework.Graphics.SpriteBatch.sortIndices, Microsoft.Xna.Framework.Graphics.SpriteBatch.spriteQueueCount, Microsoft.Xna.Framework.Graphics.SpriteBatch.spriteSortMode, and Microsoft.Xna.Framework.Graphics.SpriteBatch.textureComparer.

Referenced by Microsoft.Xna.Framework.Graphics.SpriteBatch.Flush().