Only reload sprites on theatre change; kill cruft
This commit is contained in:
@@ -40,22 +40,27 @@ namespace OpenRA
|
||||
return paths.Select(p => new MapStub(new Folder(p))).ToDictionary(m => m.Uid);
|
||||
}
|
||||
|
||||
string cachedTheatre = null;
|
||||
public Map PrepareMap(string uid)
|
||||
{
|
||||
if (!AvailableMaps.ContainsKey(uid))
|
||||
throw new InvalidDataException("Invalid map uid: {0}".F(uid));
|
||||
|
||||
Timer.Time("----PrepareMap");
|
||||
var map = new Map(AvailableMaps[uid].Package);
|
||||
Timer.Time( "Map: {0}" );
|
||||
|
||||
if (!AvailableMaps.ContainsKey(uid))
|
||||
throw new InvalidDataException("Invalid map uid: {0}".F(uid));
|
||||
|
||||
Rules.LoadRules(Manifest, map);
|
||||
Timer.Time( "Rules: {0}" );
|
||||
|
||||
SpriteSheetBuilder.Initialize( Rules.TileSets[map.Tileset] );
|
||||
SequenceProvider.Initialize(Manifest.Sequences);
|
||||
Timer.Time("SSB, SeqProv: {0}");
|
||||
|
||||
if (map.Theater != cachedTheatre)
|
||||
{
|
||||
SpriteSheetBuilder.Initialize( Rules.TileSets[map.Tileset] );
|
||||
SequenceProvider.Initialize(Manifest.Sequences);
|
||||
Timer.Time("SSB, SeqProv: {0}");
|
||||
cachedTheatre = map.Theater;
|
||||
}
|
||||
Timer.Time("----end PrepareMap");
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user