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

Method GetImage

src/ship_cmd.cpp:133–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133void Ship::GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const
134{
135 uint8_t spritenum = this->spritenum;
136
137 if (image_type == EIT_ON_MAP) direction = this->rotation;
138
139 if (IsCustomVehicleSpriteNum(spritenum)) {
140 GetCustomVehicleSprite(this, direction, image_type, result);
141 if (result->IsValid()) return;
142
143 spritenum = this->GetEngine()->original_image_index;
144 }
145
146 assert(IsValidImageIndex<VEH_SHIP>(spritenum));
147 result->Set(_ship_sprites[spritenum] + direction);
148}
149
150static const Depot *FindClosestShipDepot(const Vehicle *v, uint max_distance)
151{

Callers 9

DrawShipImageFunction · 0.45
ViewportAddVehiclesFunction · 0.45
DrawRoadVehImageFunction · 0.45
DrawAircraftImageFunction · 0.45
GetSingleVehicleWidthFunction · 0.45
SetMouseCursorVehicleFunction · 0.45
DrawTrainImageFunction · 0.45
DrawTrainDetailsFunction · 0.45
AfterLoadVehiclesPhase2Function · 0.45

Calls 5

IsCustomVehicleSpriteNumFunction · 0.85
GetCustomVehicleSpriteFunction · 0.85
IsValidMethod · 0.45
GetEngineMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected