Rework MapCache API.
This clarifies the ownership of the underlying IReadOnlyPackage objects, and avoids passing around some unnecessary state.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
5c0b82e65b
commit
e186dc428e
@@ -148,11 +148,8 @@ namespace OpenRA
|
||||
if (MapCache[uid].Status != MapStatus.Available)
|
||||
throw new InvalidDataException($"Invalid map uid: {uid}");
|
||||
|
||||
Map map;
|
||||
using (new Support.PerfTimer("Map"))
|
||||
map = new Map(this, MapCache[uid].Package);
|
||||
|
||||
// Reinitialize all our assets
|
||||
var map = MapCache[uid].ToMap();
|
||||
InitializeLoaders(map);
|
||||
map.Sequences.LoadSprites();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user