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

Function GetAircraftIcon

src/aircraft_cmd.cpp:201–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201static void GetAircraftIcon(EngineID engine, EngineImageType image_type, VehicleSpriteSeq *result)
202{
203 const Engine *e = Engine::Get(engine);
204 uint8_t spritenum = e->VehInfo<AircraftVehicleInfo>().image_index;
205
206 if (IsCustomVehicleSpriteNum(spritenum)) {
207 GetCustomVehicleIcon(engine, DIR_W, image_type, result);
208 if (result->IsValid()) return;
209
210 spritenum = e->original_image_index;
211 }
212
213 assert(IsValidImageIndex<VEH_AIRCRAFT>(spritenum));
214 result->Set(DIR_W + _aircraft_sprite[spritenum]);
215}
216
217void DrawAircraftEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal, EngineImageType image_type)
218{

Callers 2

DrawAircraftEngineFunction · 0.85
GetAircraftSpriteSizeFunction · 0.85

Calls 4

IsCustomVehicleSpriteNumFunction · 0.85
GetCustomVehicleIconFunction · 0.85
IsValidMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected