| 118 | } |
| 119 | |
| 120 | void RoadVehicle::GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const |
| 121 | { |
| 122 | uint8_t spritenum = this->spritenum; |
| 123 | |
| 124 | if (IsCustomVehicleSpriteNum(spritenum)) { |
| 125 | if (spritenum == CUSTOM_VEHICLE_SPRITENUM_REVERSED) direction = ReverseDir(direction); |
| 126 | GetCustomVehicleSprite(this, direction, image_type, result); |
| 127 | if (result->IsValid()) return; |
| 128 | |
| 129 | spritenum = this->GetEngine()->original_image_index; |
| 130 | } |
| 131 | |
| 132 | assert(IsValidImageIndex<VEH_ROAD>(spritenum)); |
| 133 | SpriteID sprite = direction + _roadveh_images[spritenum]; |
| 134 | |
| 135 | if (this->cargo.StoredCount() >= this->cargo_cap / 2U) sprite += _roadveh_full_adder[spritenum]; |
| 136 | |
| 137 | result->Set(sprite); |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * Draw a road vehicle engine. |
nothing calls this directly
no test coverage detected