Load (almost) everything from a single side-specific image

This commit is contained in:
Paul Chote
2010-01-10 20:47:35 +13:00
parent 40e458581f
commit 05338d8d19
14 changed files with 116 additions and 73 deletions

View File

@@ -106,13 +106,21 @@ namespace OpenRa.Game.Graphics
public static Sprite GetImageFromCollection(Renderer renderer,string collection, string image)
{
{
// Cached sprite
if (cachedSprites.ContainsKey(collection) && cachedSprites[collection].ContainsKey(image))
return cachedSprites[collection][image];
var mi = collections[collection][image];
MappedImage mi;
try { mi = collections[collection][image];}
catch (KeyNotFoundException)
{
throw new InvalidOperationException(
"Collection `{0}` does not have an image `{1}`".F(collection, image));
}
// Cached sheet
Sheet sheet;
if (cachedSheets.ContainsKey(mi.Src))