Skip to content

Commit

Permalink
Merge pull request #854 from plrusek/master
Browse files Browse the repository at this point in the history
Fixed the GenerateSpriteCache function
  • Loading branch information
Grossley authored Apr 22, 2022
2 parents 1a33170 + 7df00c5 commit 219ab7a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions UndertaleModTool/Editors/UndertaleRoomEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1502,11 +1502,12 @@ public static void GenerateSpriteCache(UndertaleRoom room)
else
tiles.AddRange(layer.AssetsData.LegacyTiles);

allObjects.AddRange(layer.AssetsData.Sprites);
allObjects.AddRange(layer.AssetsData.Sprites.Where(s => s.Sprite?.Textures.Count > 0));
break;

case LayerType.Background:
allObjects.Add(layer.BackgroundData);
if (layer.BackgroundData.Sprite?.Textures.Count > 0)
allObjects.Add(layer.BackgroundData);
break;

case LayerType.Instances:
Expand All @@ -1520,7 +1521,7 @@ public static void GenerateSpriteCache(UndertaleRoom room)
tiles = room.Tiles.ToList();

allObjects.AddRange(room.Backgrounds);
allObjects.AddRange(room.GameObjects);
allObjects.AddRange(room.GameObjects.Where(g => g.ObjectDefinition?.Sprite?.Textures.Count > 0));
}

tileTextures = tiles?.AsParallel()
Expand Down

0 comments on commit 219ab7a

Please sign in to comment.