elrail.c
changeset 3645 7f950533d510
parent 3636 a36cc46e754d
child 3789 c50647c927e4
equal deleted inserted replaced
3644:7c9a6a91873b 3645:7f950533d510
   288 			assert(PCPconfig != 0); /* We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that) */
   288 			assert(PCPconfig != 0); /* We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that) */
   289 			assert(!IsSteepSlope(tileh[TS_HOME]));
   289 			assert(!IsSteepSlope(tileh[TS_HOME]));
   290 			sss = &CatenarySpriteData[Wires[tileh_selector][t][PCPconfig]];
   290 			sss = &CatenarySpriteData[Wires[tileh_selector][t][PCPconfig]];
   291 
   291 
   292 			AddSortableSpriteToDraw( sss->image, ti->x + sss->x_offset, ti->y + sss->y_offset,
   292 			AddSortableSpriteToDraw( sss->image, ti->x + sss->x_offset, ti->y + sss->y_offset,
   293 				sss->x_size, sss->y_size, sss->z_size, GetSlopeZ(ti->x + min(sss->x_offset, 15), ti->y + min(sss->y_offset, 15)) + sss->z_offset);
   293 				sss->x_size, sss->y_size, sss->z_size, GetSlopeZ(ti->x + min(sss->x_offset, TILE_SIZE - 1), ti->y + min(sss->y_offset, TILE_SIZE - 1)) + sss->z_offset);
   294 		}
   294 		}
   295 	}
   295 	}
   296 }
   296 }
   297 
   297 
   298 static void DrawCatenaryOnBridge(const TileInfo *ti)
   298 static void DrawCatenaryOnBridge(const TileInfo *ti)
   323 
   323 
   324 	/* Finished with wires, draw pylons */
   324 	/* Finished with wires, draw pylons */
   325 	/* every other tile needs a pylon on the northern end */
   325 	/* every other tile needs a pylon on the northern end */
   326 	if (num % 2) {
   326 	if (num % 2) {
   327 		if (axis == AXIS_X) {
   327 		if (axis == AXIS_X) {
   328 			AddSortableSpriteToDraw( pylons_bridge[0 + HASBIT(tlg, 0)], ti->x, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, GetBridgeHeight(ti->tile) + 8);
   328 			AddSortableSpriteToDraw( pylons_bridge[0 + HASBIT(tlg, 0)], ti->x, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, GetBridgeHeight(ti->tile) + TILE_HEIGHT);
   329 		} else {
   329 		} else {
   330 			AddSortableSpriteToDraw( pylons_bridge[2 + HASBIT(tlg, 1)], ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y, 1, 1, 10, GetBridgeHeight(ti->tile) + 8);
   330 			AddSortableSpriteToDraw( pylons_bridge[2 + HASBIT(tlg, 1)], ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y, 1, 1, 10, GetBridgeHeight(ti->tile) + TILE_HEIGHT);
   331 		}
   331 		}
   332 	}
   332 	}
   333 
   333 
   334 	/* need a pylon on the southern end of the bridge */
   334 	/* need a pylon on the southern end of the bridge */
   335 	if (DistanceMax(ti->tile, start) == length) {
   335 	if (DistanceMax(ti->tile, start) == length) {
   336 		if (axis == AXIS_X) {
   336 		if (axis == AXIS_X) {
   337 			AddSortableSpriteToDraw( pylons_bridge[0 + HASBIT(tlg, 0)], ti->x + 16, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, GetBridgeHeight(ti->tile) + 8);
   337 			AddSortableSpriteToDraw( pylons_bridge[0 + HASBIT(tlg, 0)], ti->x + 16, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, GetBridgeHeight(ti->tile) + TILE_HEIGHT);
   338 		} else {
   338 		} else {
   339 			AddSortableSpriteToDraw( pylons_bridge[2 + HASBIT(tlg, 1)], ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y + 16, 1, 1, 10, GetBridgeHeight(ti->tile) + 8);
   339 			AddSortableSpriteToDraw( pylons_bridge[2 + HASBIT(tlg, 1)], ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y + 16, 1, 1, 10, GetBridgeHeight(ti->tile) + TILE_HEIGHT);
   340 		}
   340 		}
   341 	}
   341 	}
   342 }
   342 }
   343 
   343 
   344 void DrawCatenary(const TileInfo *ti)
   344 void DrawCatenary(const TileInfo *ti)