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

Function DrawAircraftEngine

src/aircraft_cmd.cpp:217–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217void DrawAircraftEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal, EngineImageType image_type)
218{
219 VehicleSpriteSeq seq;
220 GetAircraftIcon(engine, image_type, &seq);
221
222 Rect rect;
223 seq.GetBounds(&rect);
224 preferred_x = Clamp(preferred_x,
225 left - UnScaleGUI(rect.left),
226 right - UnScaleGUI(rect.right));
227
228 seq.Draw(preferred_x, y, pal, pal == PALETTE_CRASH);
229
230 if (!(AircraftVehInfo(engine)->subtype & AIR_CTOL)) {
231 VehicleSpriteSeq rotor_seq;
232 GetCustomRotorIcon(engine, image_type, &rotor_seq);
233 if (!rotor_seq.IsValid()) rotor_seq.Set(SPR_ROTOR_STOPPED);
234 rotor_seq.Draw(preferred_x, y - ScaleSpriteTrad(5), PAL_NONE, false);
235 }
236}
237
238/**
239 * Get the size of the sprite of an aircraft sprite heading west (used for lists).

Callers 1

DrawVehicleEngineFunction · 0.85

Calls 10

GetAircraftIconFunction · 0.85
ClampFunction · 0.85
UnScaleGUIFunction · 0.85
AircraftVehInfoFunction · 0.85
GetCustomRotorIconFunction · 0.85
ScaleSpriteTradFunction · 0.85
GetBoundsMethod · 0.45
DrawMethod · 0.45
IsValidMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected