278 } |
278 } |
279 } |
279 } |
280 } |
280 } |
281 } |
281 } |
282 |
282 |
|
283 /* Don't draw a wire under a low bridge */ |
|
284 if (IsBridgeTile(ti->tile) && |
|
285 IsBridgeMiddle(ti->tile) && |
|
286 !(_display_opt & DO_TRANS_BUILDINGS) && |
|
287 GetBridgeHeight(ti->tile) <= TilePixelHeight(ti->tile) + TILE_HEIGHT) { |
|
288 return; |
|
289 } |
|
290 |
283 /* Drawing of pylons is finished, now draw the wires */ |
291 /* Drawing of pylons is finished, now draw the wires */ |
284 for (t = 0; t < TRACK_END; t++) { |
292 for (t = 0; t < TRACK_END; t++) { |
285 if (HASBIT(trackconfig[TS_HOME], t)) { |
293 if (HASBIT(trackconfig[TS_HOME], t)) { |
286 |
294 |
287 byte PCPconfig = HASBIT(PCPstatus, PCPpositions[t][0]) + |
295 byte PCPconfig = HASBIT(PCPstatus, PCPpositions[t][0]) + |
288 (HASBIT(PCPstatus, PCPpositions[t][1]) << 1); |
296 (HASBIT(PCPstatus, PCPpositions[t][1]) << 1); |
289 |
297 |
290 const SortableSpriteStruct *sss; |
298 const SortableSpriteStruct *sss; |
291 int tileh_selector = !(tileh[TS_HOME] % 3) * tileh[TS_HOME] / 3; /* tileh for the slopes, 0 otherwise */ |
299 int tileh_selector = !(tileh[TS_HOME] % 3) * tileh[TS_HOME] / 3; /* tileh for the slopes, 0 otherwise */ |
292 |
|
293 if ( /* We are not drawing a wire under a low bridge */ |
|
294 IsBridgeTile(ti->tile) && |
|
295 IsBridgeMiddle(ti->tile) && |
|
296 !(_display_opt & DO_TRANS_BUILDINGS) && |
|
297 GetBridgeHeight(ti->tile) <= TilePixelHeight(ti->tile) + TILE_HEIGHT |
|
298 ) return; |
|
299 |
300 |
300 assert(PCPconfig != 0); /* We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that) */ |
301 assert(PCPconfig != 0); /* We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that) */ |
301 assert(!IsSteepSlope(tileh[TS_HOME])); |
302 assert(!IsSteepSlope(tileh[TS_HOME])); |
302 sss = &CatenarySpriteData[Wires[tileh_selector][t][PCPconfig]]; |
303 sss = &CatenarySpriteData[Wires[tileh_selector][t][PCPconfig]]; |
303 |
304 |