// between LoadMap and LoadTheater, the VFS should be initialized public bool LoadTheater() { Drawable.TileWidth = (ushort)TileWidth; Drawable.TileHeight = (ushort)TileHeight; _theater = new Theater(TheaterType, Engine, _rules, _art); if (!_theater.Initialize()) { return(false); } // needs to be done before drawables are set Operations.RecalculateOreSpread(_overlayObjects, Engine); RemoveUnknownObjects(); SetDrawables(); LoadColors(); if (Engine >= EngineType.RedAlert2) { LoadCountries(); } LoadHouses(); Operations.FixTiles(_tiles, _theater.GetTileCollection()); if (Engine <= EngineType.Firestorm) { Operations.RecalculateVeinsSpread(_overlayObjects, _tiles); } CreateLevelPalettes(); LoadPalettes(); ApplyRemappables(); if (!IgnoreLighting) { LoadLightSources(); ApplyLightSources(); } SetBaseTiles(); // requires .AnimationDrawable set on objects // first preparing all palettes as above, and only now recalculating them // could save a large amount of work in total RecalculatePalettes(); return(true); }
// between LoadMap and LoadTheater, the VFS should be initialized public bool LoadTheater() { Drawable.TileWidth = (ushort)TileWidth; Drawable.TileHeight = (ushort)TileHeight; _theater = new Theater(TheaterType, Engine, _rules, _art); if (!_theater.Initialize()) return false; // needs to be done before drawables are set if (!ModConfig.ActiveConfig.DisableOreRandomization) Operations.RecalculateOreSpread(_overlayObjects, Engine); RemoveUnknownObjects(); SetDrawables(); LoadColors(); if (Engine >= EngineType.RedAlert2) LoadCountries(); LoadHouses(); Operations.FixTiles(_tiles, _theater.GetTileCollection()); if (Engine <= EngineType.Firestorm) Operations.RecalculateVeinsSpread(_overlayObjects, _tiles); CreateLevelPalettes(); LoadPalettes(); ApplyRemappables(); if (!IgnoreLighting) { LoadLightSources(); ApplyLightSources(); } SetBaseTiles(); // requires .AnimationDrawable set on objects // first preparing all palettes as above, and only now recalculating them // could save a large amount of work in total RecalculatePalettes(); return true; }