src/landscape.cpp
branchNewGRF_ports
changeset 10994 cd9968b6f96b
parent 10991 d8811e327d12
equal deleted inserted replaced
10991:d8811e327d12 10994:cd9968b6f96b
    77 uint ApplyFoundationToSlope(Foundation f, Slope *s)
    77 uint ApplyFoundationToSlope(Foundation f, Slope *s)
    78 {
    78 {
    79 	if (!IsFoundation(f)) return 0;
    79 	if (!IsFoundation(f)) return 0;
    80 
    80 
    81 	if (IsLeveledFoundation(f)) {
    81 	if (IsLeveledFoundation(f)) {
       
    82 		uint dz = TILE_HEIGHT + (IsSteepSlope(*s) ? TILE_HEIGHT : 0);
    82 		*s = SLOPE_FLAT;
    83 		*s = SLOPE_FLAT;
    83 		return TILE_HEIGHT;
    84 		return dz;
    84 	}
    85 	}
    85 
    86 
    86 	if (f != FOUNDATION_STEEP_BOTH && IsNonContinuousFoundation(f)) {
    87 	if (f != FOUNDATION_STEEP_BOTH && IsNonContinuousFoundation(f)) {
    87 		*s = HalftileSlope(*s, GetHalftileFoundationCorner(f));
    88 		*s = HalftileSlope(*s, GetHalftileFoundationCorner(f));
    88 		return 0;
    89 		return 0;
   400 			/* inclined foundation */
   401 			/* inclined foundation */
   401 			byte inclined = highest_corner * 2 + (f == FOUNDATION_INCLINED_Y ? 1 : 0);
   402 			byte inclined = highest_corner * 2 + (f == FOUNDATION_INCLINED_Y ? 1 : 0);
   402 
   403 
   403 			AddSortableSpriteToDraw(inclined_base + inclined, PAL_NONE, ti->x, ti->y, 16, 16, 1, ti->z);
   404 			AddSortableSpriteToDraw(inclined_base + inclined, PAL_NONE, ti->x, ti->y, 16, 16, 1, ti->z);
   404 			OffsetGroundSprite(31, 9);
   405 			OffsetGroundSprite(31, 9);
       
   406 		} else if (IsLeveledFoundation(f)) {
       
   407 			AddSortableSpriteToDraw(leveled_base + SlopeWithOneCornerRaised(highest_corner), PAL_NONE, ti->x, ti->y, 16, 16, 7, ti->z - TILE_HEIGHT);
       
   408 			OffsetGroundSprite(31, 1);
   405 		} else if (f == FOUNDATION_STEEP_LOWER) {
   409 		} else if (f == FOUNDATION_STEEP_LOWER) {
   406 			/* one corner raised */
   410 			/* one corner raised */
   407 			OffsetGroundSprite(31, 1);
   411 			OffsetGroundSprite(31, 1);
   408 		} else {
   412 		} else {
   409 			/* halftile foundation */
   413 			/* halftile foundation */