diff --git a/OpenRA.Game/Graphics/CursorManager.cs b/OpenRA.Game/Graphics/CursorManager.cs index 03bfbbca11..f311c17d1a 100644 --- a/OpenRA.Game/Graphics/CursorManager.cs +++ b/OpenRA.Game/Graphics/CursorManager.cs @@ -11,6 +11,7 @@ using System; using System.Collections.Generic; +using System.Linq; using OpenRA.Primitives; namespace OpenRA.Graphics @@ -43,8 +44,11 @@ namespace OpenRA.Graphics hardwareCursorsDisabled = Game.Settings.Graphics.DisableHardwareCursors; graphicSettings = Game.Settings.Graphics; - sheetBuilder = new SheetBuilder(SheetType.BGRA); - foreach (var kv in cursorProvider.Cursors) + sheetBuilder = new SheetBuilder(SheetType.BGRA, 512); + + // Sort the cursors for better packing onto the sheet. + foreach (var kv in cursorProvider.Cursors + .OrderBy(kvp => kvp.Value.Frames.Max(f => f.Size.Height))) { var frames = kv.Value.Frames; var palette = !string.IsNullOrEmpty(kv.Value.Palette) ? cursorProvider.Palettes[kv.Value.Palette] : null;