bridge_cmd.c
branchcustombridgeheads
changeset 5632 025c3b25f1fd
parent 5628 6975ccb4a7bd
child 5633 c61d481dbd0b
equal deleted inserted replaced
5631:932c1a268feb 5632:025c3b25f1fd
   640 	 */
   640 	 */
   641 	AddSortableSpriteToDraw(
   641 	AddSortableSpriteToDraw(
   642 		image, ti->x, ti->y, 16, 16, ti->tileh == SLOPE_FLAT ? 1 : 8, ti->z
   642 		image, ti->x, ti->y, 16, 16, ti->tileh == SLOPE_FLAT ? 1 : 8, ti->z
   643 	);
   643 	);
   644 
   644 
       
   645 	if (HasSignals(ti->tile)) DrawSignals(ti->tile, GetTrackBits(ti->tile));
       
   646 
   645 	DrawBridgeMiddle(ti);
   647 	DrawBridgeMiddle(ti);
   646 }
   648 }
   647 
   649 
   648 
   650 
   649 /** Compute bridge piece. Computes the bridge piece to display depending on the position inside the bridge.
   651 /** Compute bridge piece. Computes the bridge piece to display depending on the position inside the bridge.
   801 	y &= 0xF;
   803 	y &= 0xF;
   802 
   804 
   803 	pos = (DiagDirToAxis(dir) == AXIS_X ? y : x);
   805 	pos = (DiagDirToAxis(dir) == AXIS_X ? y : x);
   804 
   806 
   805 	// On the bridge ramp or flat bridge head?
   807 	// On the bridge ramp or flat bridge head?
   806 	if ( (5 <= pos && pos <= 10) || IsCustomBridgeHead(tile)) {
   808 	if ( (2 <= pos && pos <= 13) || IsCustomBridgeHead(tile)) {
   807 		uint delta;
   809 		uint delta;
   808 
   810 
   809 		if (IsSteepSlope(tileh)) return z + TILE_HEIGHT * 2;
   811 		if (IsSteepSlope(tileh)) return z + TILE_HEIGHT * 2;
   810 
   812 
   811 		if (HASBIT(BRIDGE_HORZ_RAMP, tileh)) return z + TILE_HEIGHT;
   813 		if (HASBIT(BRIDGE_HORZ_RAMP, tileh)) return z + TILE_HEIGHT;