From 1afcd2b98ae1d9cd5a9c089cdc22ae9a7226ebd7 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 19 Aug 2010 00:09:48 +1200 Subject: [PATCH] Move rules and SSB init out of world --- OpenRA.Game/Game.cs | 11 ++++++++--- OpenRA.Game/World.cs | 4 ---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index d1a5195c54..6944a22a8f 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -140,12 +140,17 @@ namespace OpenRA viewport = new Viewport(clientSize, map.TopLeft, map.BottomRight, Renderer); world = null; // trying to access the old world will NRE, rather than silently doing it wrong. Timer.Time("viewport: {0}"); + + Rules.LoadRules(Manifest,map); + Timer.Time( "load rules: {0}" ); + + SpriteSheetBuilder.Initialize( Rules.TileSets[map.Tileset] ); + SequenceProvider.Initialize(Manifest.Sequences); + Timer.Time("SeqProv: {0}"); + world = new World(Manifest, map); Timer.Time("world: {0}"); - SequenceProvider.Initialize(Manifest.Sequences); - Timer.Time("ChromeProv, SeqProv: {0}"); - Timer.Time("----end LoadMap"); Debug("Map change {0} -> {1}".F(Game.mapName, mapName)); } diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index 874e0d027b..0b7c54f84b 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -80,11 +80,7 @@ namespace OpenRA Timer.Time( "----World.ctor" ); Map = map; - Rules.LoadRules(manifest,Map); - Timer.Time( "load rules: {0}" ); - TileSet = Rules.TileSets[Map.Tileset]; - SpriteSheetBuilder.Initialize( TileSet ); TileSet.LoadTiles(); Timer.Time( "Tileset: {0}" );