* Get sprite for showing cargo of this type. * @return Sprite number to use. */
| 174 | * @return Sprite number to use. |
| 175 | */ |
| 176 | SpriteID CargoSpec::GetCargoIcon() const |
| 177 | { |
| 178 | SpriteID sprite = this->sprite; |
| 179 | if (sprite == 0xFFFF) { |
| 180 | /* A value of 0xFFFF indicates we should draw a custom icon */ |
| 181 | sprite = GetCustomCargoSprite(this); |
| 182 | } |
| 183 | |
| 184 | if (sprite == 0) sprite = SPR_CARGO_GOODS; |
| 185 | |
| 186 | return sprite; |
| 187 | } |
| 188 | |
| 189 | std::array<uint8_t, NUM_CARGO> _sorted_cargo_types; ///< Sort order of cargoes by cargo type. |
| 190 | std::vector<const CargoSpec *> _sorted_cargo_specs; ///< Cargo specifications sorted alphabetically by name. |
no test coverage detected