Turn ModelRenderer and VoxelCache into traits

This commit is contained in:
Gustas
2023-09-19 18:40:57 +03:00
committed by Matthias Mailänder
parent d427072cc9
commit 686040a316
33 changed files with 481 additions and 469 deletions

View File

@@ -49,7 +49,6 @@ namespace OpenRA
public readonly MersenneTwister SharedRandom;
public readonly MersenneTwister LocalRandom;
public readonly IModelCache ModelCache;
public LongBitSet<PlayerBitMask> AllPlayersMask = default;
public readonly LongBitSet<PlayerBitMask> NoPlayersMask = default;
@@ -214,8 +213,6 @@ namespace OpenRA
SharedRandom = new MersenneTwister(orderManager.LobbyInfo.GlobalSettings.RandomSeed);
LocalRandom = new MersenneTwister();
ModelCache = modData.ModelSequenceLoader.CacheModels(Map, modData, Map.Rules.ModelSequences);
var worldActorType = type == WorldType.Editor ? SystemActors.EditorWorld : SystemActors.World;
WorldActor = CreateActor(worldActorType.ToString(), new TypeDictionary());
ActorMap = WorldActor.Trait<IActorMap>();
@@ -598,8 +595,6 @@ namespace OpenRA
if (IsLoadingGameSave)
Game.Sound.DisableAllSounds = false;
ModelCache.Dispose();
// Dispose newer actors first, and the world actor last
foreach (var a in actors.Values.Reverse())
a.Dispose();