MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / AfterLoadGRFs

Function AfterLoadGRFs

src/newgrf.cpp:1632–1751  ·  view source on GitHub ↗

Finish loading NewGRFs and execute needed post-processing */

Source from the content-addressed store, hash-verified

1630
1631/** Finish loading NewGRFs and execute needed post-processing */
1632static void AfterLoadGRFs()
1633{
1634 /* Cached callback groups are no longer needed. */
1635 ResetCallbacks(true);
1636
1637 FinaliseStringMapping();
1638
1639 /* Clear the action 6 override sprites. */
1640 _grf_line_to_action6_sprite_override.clear();
1641
1642 FinaliseBadges();
1643
1644 /* Polish cargoes */
1645 FinaliseCargoArray();
1646
1647 /* Pre-calculate all refit masks after loading GRF files. */
1648 CalculateRefitMasks();
1649
1650 /* Polish engines */
1651 FinaliseEngineArray();
1652
1653 /* Set the actually used Canal properties */
1654 FinaliseCanals();
1655
1656 /* Add all new houses to the house array. */
1657 FinaliseHouseArray();
1658
1659 /* Add all new industries to the industry array. */
1660 FinaliseIndustriesArray();
1661
1662 /* Add all new objects to the object array. */
1663 FinaliseObjectsArray();
1664
1665 InitializeSortedCargoSpecs();
1666
1667 /* Sort the list of industry types. */
1668 SortIndustryTypes();
1669
1670 /* Create dynamic list of industry legends for smallmap_gui.cpp */
1671 BuildIndustriesLegend();
1672
1673 /* Build the routemap legend, based on the available cargos */
1674 BuildLinkStatsLegend();
1675
1676 /* Add all new airports to the airports array. */
1677 FinaliseAirportsArray();
1678 BindAirportSpecs();
1679
1680 /* Update the townname generators list */
1681 InitGRFTownGeneratorNames();
1682
1683 /* Run all queued vehicle list order changes */
1684 CommitVehicleListOrderChanges();
1685
1686 /* Load old shore sprites in new position, if they were replaced by ActionA */
1687 ActivateOldShore();
1688
1689 /* Load old tram depot sprites in new position, if no new ones are present */

Callers 1

LoadNewGRFFunction · 0.85

Calls 15

ResetCallbacksFunction · 0.85
FinaliseStringMappingFunction · 0.85
FinaliseBadgesFunction · 0.85
FinaliseCargoArrayFunction · 0.85
CalculateRefitMasksFunction · 0.85
FinaliseEngineArrayFunction · 0.85
FinaliseCanalsFunction · 0.85
FinaliseHouseArrayFunction · 0.85
FinaliseIndustriesArrayFunction · 0.85
FinaliseObjectsArrayFunction · 0.85
SortIndustryTypesFunction · 0.85

Tested by

no test coverage detected