* Construct the Cargo Mapping * @note This is the reverse of a cargo translation table */
| 535 | * @note This is the reverse of a cargo translation table |
| 536 | */ |
| 537 | static void BuildCargoTranslationMap() |
| 538 | { |
| 539 | _cur_gps.grffile->cargo_map.fill(UINT8_MAX); |
| 540 | |
| 541 | auto cargo_list = GetCargoTranslationTable(*_cur_gps.grffile); |
| 542 | |
| 543 | for (const CargoSpec *cs : CargoSpec::Iterate()) { |
| 544 | /* Check the translation table for this cargo's label */ |
| 545 | int idx = find_index(cargo_list, cs->label); |
| 546 | if (idx >= 0) _cur_gps.grffile->cargo_map[cs->Index()] = idx; |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | /** |
| 551 | * Prepare loading a NewGRF file with its config |
no test coverage detected