src/tunnelbridge_cmd.cpp
changeset 8528 6e61e651790e
parent 8519 fe61d7aa3053
child 8530 0936741af0ac
equal deleted inserted replaced
8527:a32b9ac056af 8528:6e61e651790e
   760 
   760 
   761 	/* The sprites under the vehicles are drawn as SpriteCombine. StartSpriteCombine() has already been called
   761 	/* The sprites under the vehicles are drawn as SpriteCombine. StartSpriteCombine() has already been called
   762 	 * The bounding boxes here are the same as for bridge front/roof */
   762 	 * The bounding boxes here are the same as for bridge front/roof */
   763 	AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + tram_offsets[overlay][offset], PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, IsTransparencySet(TO_BRIDGES));
   763 	AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + tram_offsets[overlay][offset], PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, IsTransparencySet(TO_BRIDGES));
   764 
   764 
   765 	AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + back_offsets[offset],  PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, IsTransparencySet(TO_BUILDINGS));
   765 	AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + back_offsets[offset],  PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, IsTransparencySet(TO_CATENARY));
   766 
   766 
   767 	/* Start a new SpriteCombine for the front part */
   767 	/* Start a new SpriteCombine for the front part */
   768 	EndSpriteCombine();
   768 	EndSpriteCombine();
   769 	StartSpriteCombine();
   769 	StartSpriteCombine();
   770 
   770 
   771 	/* For sloped sprites the bounding box needs to be higher, as the pylons stop on a higher point */
   771 	/* For sloped sprites the bounding box needs to be higher, as the pylons stop on a higher point */
   772 	AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + front_offsets[offset], PAL_NONE, x, y, size_x[offset] + front_bb_offset_x[offset], size_y[offset] + front_bb_offset_y[offset], 0x28, z, IsTransparencySet(TO_BUILDINGS), front_bb_offset_x[offset], front_bb_offset_y[offset]);
   772 	AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + front_offsets[offset], PAL_NONE, x, y, size_x[offset] + front_bb_offset_x[offset], size_y[offset] + front_bb_offset_y[offset], 0x28, z, IsTransparencySet(TO_CATENARY), front_bb_offset_x[offset], front_bb_offset_y[offset]);
   773 }
   773 }
   774 
   774 
   775 /**
   775 /**
   776  * Draws a tunnel of bridge tile.
   776  * Draws a tunnel of bridge tile.
   777  * For tunnels, this is rather simple, as you only needa draw the entrance.
   777  * For tunnels, this is rather simple, as you only needa draw the entrance.
   830 
   830 
   831 				DrawGroundSprite(SPR_TRAMWAY_BASE + tunnel_sprites[rts - ROADTYPES_TRAM][dir], PAL_NONE);
   831 				DrawGroundSprite(SPR_TRAMWAY_BASE + tunnel_sprites[rts - ROADTYPES_TRAM][dir], PAL_NONE);
   832 
   832 
   833 				catenary = true;
   833 				catenary = true;
   834 				StartSpriteCombine();
   834 				StartSpriteCombine();
   835 				AddSortableSpriteToDraw(SPR_TRAMWAY_TUNNEL_WIRES + dir, PAL_NONE, ti->x, ti->y, BB_data[10], BB_data[11], TILE_HEIGHT, ti->z, IsTransparencySet(TO_BUILDINGS), BB_data[8], BB_data[9], BB_Z_SEPARATOR);
   835 				AddSortableSpriteToDraw(SPR_TRAMWAY_TUNNEL_WIRES + dir, PAL_NONE, ti->x, ti->y, BB_data[10], BB_data[11], TILE_HEIGHT, ti->z, IsTransparencySet(TO_CATENARY), BB_data[8], BB_data[9], BB_Z_SEPARATOR);
   836 			}
   836 			}
   837 		} else if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) {
   837 		} else if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) {
   838 			DrawCatenary(ti);
   838 			DrawCatenary(ti);
   839 
   839 
   840 			catenary = true;
   840 			catenary = true;