elrail.c
changeset 4021 10b32af73bd0
parent 4000 4009d092b306
child 4077 d4d440dd8925
equal deleted inserted replaced
4020:83d7762d77af 4021:10b32af73bd0
   282 
   282 
   283 			if ( /* We are not drawing a wire under a low bridge */
   283 			if ( /* We are not drawing a wire under a low bridge */
   284 					IsBridgeTile(ti->tile) &&
   284 					IsBridgeTile(ti->tile) &&
   285 					IsBridgeMiddle(ti->tile) &&
   285 					IsBridgeMiddle(ti->tile) &&
   286 					!(_display_opt & DO_TRANS_BUILDINGS) &&
   286 					!(_display_opt & DO_TRANS_BUILDINGS) &&
   287 					GetBridgeHeight(ti->tile) <= TilePixelHeight(ti->tile)
   287 					GetBridgeHeight(ti->tile) <= TilePixelHeight(ti->tile) + TILE_HEIGHT
   288 			   ) return;
   288 			   ) return;
   289 
   289 
   290 			assert(PCPconfig != 0); /* We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that) */
   290 			assert(PCPconfig != 0); /* We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that) */
   291 			assert(!IsSteepSlope(tileh[TS_HOME]));
   291 			assert(!IsSteepSlope(tileh[TS_HOME]));
   292 			sss = &CatenarySpriteData[Wires[tileh_selector][t][PCPconfig]];
   292 			sss = &CatenarySpriteData[Wires[tileh_selector][t][PCPconfig]];
   319 		/* Draw "long" wires on all other tiles of the bridge (one pylon every two tiles) */
   319 		/* Draw "long" wires on all other tiles of the bridge (one pylon every two tiles) */
   320 		sss = &CatenarySpriteData[WIRE_X_FLAT_SW + (num % 2) + offset];
   320 		sss = &CatenarySpriteData[WIRE_X_FLAT_SW + (num % 2) + offset];
   321 	}
   321 	}
   322 
   322 
   323 	AddSortableSpriteToDraw( sss->image, ti->x + sss->x_offset, ti->y + sss->y_offset,
   323 	AddSortableSpriteToDraw( sss->image, ti->x + sss->x_offset, ti->y + sss->y_offset,
   324 			sss->x_size, sss->y_size, sss->z_size, GetBridgeHeight(ti->tile) + sss->z_offset + 8);
   324 			sss->x_size, sss->y_size, sss->z_size, GetBridgeHeight(ti->tile) + sss->z_offset);
   325 
   325 
   326 	/* Finished with wires, draw pylons */
   326 	/* Finished with wires, draw pylons */
   327 	/* every other tile needs a pylon on the northern end */
   327 	/* every other tile needs a pylon on the northern end */
   328 	if (num % 2) {
   328 	if (num % 2) {
   329 		if (axis == AXIS_X) {
   329 		if (axis == AXIS_X) {
   330 			AddSortableSpriteToDraw( pylons_bridge[0 + HASBIT(tlg, 0)], ti->x, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, GetBridgeHeight(ti->tile) + TILE_HEIGHT);
   330 			AddSortableSpriteToDraw( pylons_bridge[0 + HASBIT(tlg, 0)], ti->x, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, GetBridgeHeight(ti->tile));
   331 		} else {
   331 		} else {
   332 			AddSortableSpriteToDraw( pylons_bridge[2 + HASBIT(tlg, 1)], ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y, 1, 1, 10, GetBridgeHeight(ti->tile) + TILE_HEIGHT);
   332 			AddSortableSpriteToDraw( pylons_bridge[2 + HASBIT(tlg, 1)], ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y, 1, 1, 10, GetBridgeHeight(ti->tile));
   333 		}
   333 		}
   334 	}
   334 	}
   335 
   335 
   336 	/* need a pylon on the southern end of the bridge */
   336 	/* need a pylon on the southern end of the bridge */
   337 	if (DistanceMax(ti->tile, start) == length) {
   337 	if (DistanceMax(ti->tile, start) == length) {
   338 		if (axis == AXIS_X) {
   338 		if (axis == AXIS_X) {
   339 			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);
   339 			AddSortableSpriteToDraw( pylons_bridge[0 + HASBIT(tlg, 0)], ti->x + 16, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, GetBridgeHeight(ti->tile));
   340 		} else {
   340 		} else {
   341 			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);
   341 			AddSortableSpriteToDraw( pylons_bridge[2 + HASBIT(tlg, 1)], ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y + 16, 1, 1, 10, GetBridgeHeight(ti->tile));
   342 		}
   342 		}
   343 	}
   343 	}
   344 }
   344 }
   345 
   345 
   346 void DrawCatenary(const TileInfo *ti)
   346 void DrawCatenary(const TileInfo *ti)