src/rail_cmd.cpp
changeset 9066 29d5a0dfc329
parent 9063 71e5e4283b4b
child 9067 88f2bc991236
equal deleted inserted replaced
9065:5b94b17e4f1d 9066:29d5a0dfc329
  1819 		DrawGroundSprite(image, PAL_NONE);
  1819 		DrawGroundSprite(image, PAL_NONE);
  1820 
  1820 
  1821 		if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenary(ti);
  1821 		if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenary(ti);
  1822 
  1822 
  1823 		foreach_draw_tile_seq(dtss, dts->seq) {
  1823 		foreach_draw_tile_seq(dtss, dts->seq) {
  1824 			SpriteID image = dtss->image;
  1824 			SpriteID image = dtss->image.sprite;
  1825 			SpriteID pal;
  1825 			SpriteID pal;
  1826 
  1826 
  1827 			/* Unlike stations, our default waypoint has no variation for
  1827 			/* Unlike stations, our default waypoint has no variation for
  1828 			 * different railtype, so don't use the railtype offset if
  1828 			 * different railtype, so don't use the railtype offset if
  1829 			 * no relocation is set */
  1829 			 * no relocation is set */
  1834 			}
  1834 			}
  1835 
  1835 
  1836 			if (!(!HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS)) && HasBit(image, PALETTE_MODIFIER_COLOR)) {
  1836 			if (!(!HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS)) && HasBit(image, PALETTE_MODIFIER_COLOR)) {
  1837 				pal = _drawtile_track_palette;
  1837 				pal = _drawtile_track_palette;
  1838 			} else {
  1838 			} else {
  1839 				pal = dtss->pal;
  1839 				pal = dtss->image.pal;
  1840 			}
  1840 			}
  1841 
  1841 
  1842 			if ((byte)dtss->delta_z != 0x80) {
  1842 			if ((byte)dtss->delta_z != 0x80) {
  1843 				AddSortableSpriteToDraw(
  1843 				AddSortableSpriteToDraw(
  1844 					image, pal,
  1844 					image, pal,
  1859 static void DrawTileSequence(int x, int y, SpriteID ground, const DrawTileSeqStruct* dtss, uint32 offset)
  1859 static void DrawTileSequence(int x, int y, SpriteID ground, const DrawTileSeqStruct* dtss, uint32 offset)
  1860 {
  1860 {
  1861 	SpriteID palette = PLAYER_SPRITE_COLOR(_local_player);
  1861 	SpriteID palette = PLAYER_SPRITE_COLOR(_local_player);
  1862 
  1862 
  1863 	DrawSprite(ground, PAL_NONE, x, y);
  1863 	DrawSprite(ground, PAL_NONE, x, y);
  1864 	for (; dtss->image != 0; dtss++) {
  1864 	for (; dtss->image.sprite != 0; dtss++) {
  1865 		Point pt = RemapCoords(dtss->delta_x, dtss->delta_y, dtss->delta_z);
  1865 		Point pt = RemapCoords(dtss->delta_x, dtss->delta_y, dtss->delta_z);
  1866 		SpriteID image = dtss->image + offset;
  1866 		SpriteID image = dtss->image.sprite + offset;
  1867 
  1867 
  1868 		DrawSprite(image, HasBit(image, PALETTE_MODIFIER_COLOR) ? palette : PAL_NONE, x + pt.x, y + pt.y);
  1868 		DrawSprite(image, HasBit(image, PALETTE_MODIFIER_COLOR) ? palette : PAL_NONE, x + pt.x, y + pt.y);
  1869 	}
  1869 	}
  1870 }
  1870 }
  1871 
  1871