Ignore unused frames when loading Sequences into Sheets.

This commit is contained in:
Paul Chote
2018-05-01 19:39:31 +01:00
committed by abcdefg30
parent d9fd0f272c
commit bf4b91741a
2 changed files with 91 additions and 57 deletions

View File

@@ -87,12 +87,13 @@ namespace OpenRA.Graphics
allSprites.Add(sprite);
}
// HACK: The sequency code relies on side-effects from getUsedFrames
var indices = getUsedFrames != null ? getUsedFrames(sprite.Length) :
Enumerable.Range(0, sprite.Length);
// Load any unused frames into the SheetBuilder
if (unloaded != null)
{
var indices = getUsedFrames != null ? getUsedFrames(sprite.Length) :
Enumerable.Range(0, sprite.Length);
foreach (var i in indices)
{
if (unloaded[i] != null)