Implement IReadOnlyFileSystem on Map.

This commit is contained in:
Paul Chote
2016-02-15 02:59:18 +00:00
parent 6fde09c075
commit d1d3d72edb
2 changed files with 25 additions and 5 deletions

View File

@@ -164,12 +164,11 @@ namespace OpenRA
// Operate on a copy of the map to avoid gameplay state leaking into the cache
var map = new Map(MapCache[uid].Path);
var fileSystem = DefaultFileSystem;
LoadTranslations(map);
// Reinitialize all our assets
InitializeLoaders(fileSystem);
InitializeLoaders(map);
ModFiles.LoadFromManifest(Manifest);
// Mount map package so custom assets can be used.
@@ -183,9 +182,9 @@ namespace OpenRA
// Load music with map assets mounted
using (new Support.PerfTimer("Map.Music"))
foreach (var entry in map.Rules.Music)
entry.Value.Load(fileSystem);
entry.Value.Load(map);
VoxelProvider.Initialize(VoxelLoader, fileSystem, Manifest.VoxelSequences, map.VoxelSequenceDefinitions);
VoxelProvider.Initialize(VoxelLoader, map, Manifest.VoxelSequences, map.VoxelSequenceDefinitions);
VoxelLoader.Finish();
return map;