Remove lazy loading of map rules.

This commit is contained in:
Paul Chote
2016-03-18 19:59:04 +00:00
parent 4a7ef68b39
commit 1e5065e06a
3 changed files with 16 additions and 29 deletions

View File

@@ -186,19 +186,15 @@ namespace OpenRA
if (MapCache[uid].Status != MapStatus.Available)
throw new InvalidDataException("Invalid map uid: {0}".F(uid));
// Operate on a copy of the map to avoid gameplay state leaking into the cache
var map = new Map(this, MapCache[uid].Package);
Map map;
using (new Support.PerfTimer("Map"))
map = new Map(this, MapCache[uid].Package);
LoadTranslations(map);
// Reinitialize all our assets
InitializeLoaders(map);
using (new Support.PerfTimer("Map.PreloadRules"))
map.PreloadRules();
using (new Support.PerfTimer("Map.SequenceProvider.Preload"))
map.Rules.Sequences.Preload();
// Load music with map assets mounted
using (new Support.PerfTimer("Map.Music"))
foreach (var entry in map.Rules.Music)