41 { |
41 { |
42 uint32 r = GetTileTrackStatus(tile, TRANSPORT_WATER); |
42 uint32 r = GetTileTrackStatus(tile, TRANSPORT_WATER); |
43 return TrackdirBitsToTrackBits((TrackdirBits)(TRACKDIR_BIT_MASK & (r | r >> 8))); |
43 return TrackdirBitsToTrackBits((TrackdirBits)(TRACKDIR_BIT_MASK & (r | r >> 8))); |
44 } |
44 } |
45 |
45 |
46 void DrawShipEngine(int x, int y, EngineID engine, uint32 image_ormod) |
46 void DrawShipEngine(int x, int y, EngineID engine, SpriteID pal) |
47 { |
47 { |
48 int spritenum = ShipVehInfo(engine)->image_index; |
48 int spritenum = ShipVehInfo(engine)->image_index; |
49 |
49 |
50 if (is_custom_sprite(spritenum)) { |
50 if (is_custom_sprite(spritenum)) { |
51 int sprite = GetCustomVehicleIcon(engine, DIR_W); |
51 int sprite = GetCustomVehicleIcon(engine, DIR_W); |
52 |
52 |
53 if (sprite != 0) { |
53 if (sprite != 0) { |
54 DrawSprite(sprite | image_ormod, x, y); |
54 DrawSprite(sprite, pal, x, y); |
55 return; |
55 return; |
56 } |
56 } |
57 spritenum = orig_ship_vehicle_info[engine - SHIP_ENGINES_INDEX].image_index; |
57 spritenum = orig_ship_vehicle_info[engine - SHIP_ENGINES_INDEX].image_index; |
58 } |
58 } |
59 DrawSprite((6 + _ship_sprites[spritenum]) | image_ormod, x, y); |
59 DrawSprite(6 + _ship_sprites[spritenum], pal, x, y); |
60 } |
60 } |
61 |
61 |
62 int GetShipImage(const Vehicle* v, Direction direction) |
62 int GetShipImage(const Vehicle* v, Direction direction) |
63 { |
63 { |
64 int spritenum = v->spritenum; |
64 int spritenum = v->spritenum; |