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

Function InitRailTypes

src/rail_cmd.cpp:130–143  ·  view source on GitHub ↗

* Resolve sprites of custom rail types */

Source from the content-addressed store, hash-verified

128 * Resolve sprites of custom rail types
129 */
130void InitRailTypes()
131{
132 _sorted_railtypes.clear();
133 for (RailTypeInfo &rti : _railtypes) {
134 RailType rt = rti.Index();
135
136 ResolveRailTypeGUISprites(&rti);
137 _railtypes_hidden_mask.Set(rt, rti.flags.Test(RailTypeFlag::Hidden));
138
139 if (rti.label == 0) continue;
140 _sorted_railtypes.push_back(rt);
141 }
142 std::sort(_sorted_railtypes.begin(), _sorted_railtypes.end(), CompareRailTypes);
143}
144
145/**
146 * Allocate a new rail type label

Callers 1

AfterLoadGRFsFunction · 0.85

Calls 8

TestMethod · 0.80
push_backMethod · 0.80
clearMethod · 0.45
IndexMethod · 0.45
SetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected