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

Function GetShipIcon

src/ship_cmd.cpp:80–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80static void GetShipIcon(EngineID engine, EngineImageType image_type, VehicleSpriteSeq *result)
81{
82 const Engine *e = Engine::Get(engine);
83 uint8_t spritenum = e->VehInfo<ShipVehicleInfo>().image_index;
84
85 if (IsCustomVehicleSpriteNum(spritenum)) {
86 GetCustomVehicleIcon(engine, DIR_W, image_type, result);
87 if (result->IsValid()) return;
88
89 spritenum = e->original_image_index;
90 }
91
92 assert(IsValidImageIndex<VEH_SHIP>(spritenum));
93 result->Set(DIR_W + _ship_sprites[spritenum]);
94}
95
96void DrawShipEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal, EngineImageType image_type)
97{

Callers 2

DrawShipEngineFunction · 0.85
GetShipSpriteSizeFunction · 0.85

Calls 4

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

Tested by

no test coverage detected