1333 * for station sprites. And in the drawing |
1333 * for station sprites. And in the drawing |
1334 * code, it is used to indicate that the sprite |
1334 * code, it is used to indicate that the sprite |
1335 * should be drawn in company colors, and it's |
1335 * should be drawn in company colors, and it's |
1336 * up to the GRF file to decide that. */ |
1336 * up to the GRF file to decide that. */ |
1337 |
1337 |
1338 image = cust->ground_sprite; |
1338 /* If there is no sprite layout, we fall back to the default waypoint graphics. */ |
1339 image += (image < _custom_sprites_base) ? rti->total_offset : rti->custom_ground_offset; |
1339 if (cust != NULL && cust->seq != NULL) { |
1340 |
1340 image = cust->ground_sprite; |
1341 DrawGroundSprite(image); |
1341 image += (image < _custom_sprites_base) ? rti->total_offset : rti->custom_ground_offset; |
1342 |
1342 |
1343 if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenary(ti); |
1343 DrawGroundSprite(image); |
1344 |
1344 |
1345 foreach_draw_tile_seq(seq, cust->seq) { |
1345 if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenary(ti); |
1346 DrawSpecialBuilding( |
1346 |
1347 seq->image + relocation, 0, ti, |
1347 foreach_draw_tile_seq(seq, cust->seq) { |
1348 seq->delta_x, seq->delta_y, seq->delta_z, |
1348 DrawSpecialBuilding( |
1349 seq->width, seq->height, seq->unk |
1349 seq->image + relocation, 0, ti, |
1350 ); |
1350 seq->delta_x, seq->delta_y, seq->delta_z, |
|
1351 seq->width, seq->height, seq->unk |
|
1352 ); |
|
1353 } |
|
1354 return; |
1351 } |
1355 } |
1352 return; |
|
1353 } |
1356 } |
1354 } |
1357 } |
1355 |
1358 |
1356 drss = is_depot ? _track_depot_layout_table[GetRailDepotDirection(ti->tile)] : _track_waypoint_layout_table[GetWaypointAxis(ti->tile)]; |
1359 drss = is_depot ? _track_depot_layout_table[GetRailDepotDirection(ti->tile)] : _track_waypoint_layout_table[GetWaypointAxis(ti->tile)]; |
1357 |
1360 |
1358 image = drss++->image; |
1361 image = drss++->image; |
1359 /* @note This is kind of an ugly hack, as the PALETTE_MODIFIER_COLOR indicates |
1362 /* @note This is kind of an ugly hack, as the PALETTE_MODIFIER_COLOR indicates |
1360 * whether the sprite is railtype dependent. Rewrite this asap */ |
1363 * whether the sprite is railtype dependent. Rewrite this asap */ |
1361 if (image & PALETTE_MODIFIER_COLOR) image = (image & SPRITE_MASK) + rti->total_offset; |
1364 if (image & PALETTE_MODIFIER_COLOR) image = (image & SPRITE_MASK) + rti->total_offset; |
1362 |
1365 |
1363 // adjust ground tile for desert |
1366 // adjust ground tile for desert |
1364 // (don't adjust for arctic depots, because snow in depots looks weird) |
1367 // (don't adjust for arctic depots, because snow in depots looks weird) |
1365 // type >= 4 means waypoints |
1368 // type >= 4 means waypoints |