595 |
595 |
596 image = wdts++->image; |
596 image = wdts++->image; |
597 if (image < 4) image += water_base; |
597 if (image < 4) image += water_base; |
598 if (draw_ground) DrawGroundSprite(image, PAL_NONE); |
598 if (draw_ground) DrawGroundSprite(image, PAL_NONE); |
599 |
599 |
|
600 /* End now if buildings are invisible */ |
|
601 if (IsInvisibilitySet(TO_BUILDINGS)) return; |
|
602 |
600 for (; wdts->delta_x != 0x80; wdts++) { |
603 for (; wdts->delta_x != 0x80; wdts++) { |
601 AddSortableSpriteToDraw(wdts->image + base + ((wdts->image < 24) ? locks_base : 0), palette, |
604 AddSortableSpriteToDraw(wdts->image + base + ((wdts->image < 24) ? locks_base : 0), palette, |
602 ti->x + wdts->delta_x, ti->y + wdts->delta_y, |
605 ti->x + wdts->delta_x, ti->y + wdts->delta_y, |
603 wdts->width, wdts->height, |
606 wdts->width, wdts->height, |
604 wdts->unk, ti->z + wdts->delta_z, |
607 wdts->unk, ti->z + wdts->delta_z, |
1038 if (dest == INVALID_TILE) continue; |
1041 if (dest == INVALID_TILE) continue; |
1039 /* do not try to flood water tiles - increases performance a lot */ |
1042 /* do not try to flood water tiles - increases performance a lot */ |
1040 if (IsTileType(dest, MP_WATER)) continue; |
1043 if (IsTileType(dest, MP_WATER)) continue; |
1041 |
1044 |
1042 uint z_dest; |
1045 uint z_dest; |
1043 Slope slope_dest = (Slope)(GetFoundationSlope(dest, &z_dest) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP); |
1046 Slope slope_dest = GetFoundationSlope(dest, &z_dest) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP; |
1044 if (z_dest > 0) continue; |
1047 if (z_dest > 0) continue; |
1045 |
1048 |
1046 if (!HasBit(_flood_from_dirs[slope_dest], ReverseDir(dir))) continue; |
1049 if (!HasBit(_flood_from_dirs[slope_dest], ReverseDir(dir))) continue; |
1047 |
1050 |
1048 DoFloodTile(dest); |
1051 DoFloodTile(dest); |
1049 } |
1052 } |
1050 break; |
1053 break; |
1051 |
1054 |
1052 case FLOOD_DRYUP: { |
1055 case FLOOD_DRYUP: { |
1053 Slope slope_here = (Slope)(GetFoundationSlope(tile, NULL) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP); |
1056 Slope slope_here = GetFoundationSlope(tile, NULL) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP; |
1054 uint check_dirs = _flood_from_dirs[slope_here]; |
1057 uint check_dirs = _flood_from_dirs[slope_here]; |
1055 uint dir; |
1058 uint dir; |
1056 FOR_EACH_SET_BIT(dir, check_dirs) { |
1059 FOR_EACH_SET_BIT(dir, check_dirs) { |
1057 TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir((Direction)dir)); |
1060 TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir((Direction)dir)); |
1058 if (dest == INVALID_TILE) continue; |
1061 if (dest == INVALID_TILE) continue; |
1095 default: |
1098 default: |
1096 uint check_dirs = _flood_from_dirs[slope & ~SLOPE_STEEP]; |
1099 uint check_dirs = _flood_from_dirs[slope & ~SLOPE_STEEP]; |
1097 uint dir; |
1100 uint dir; |
1098 FOR_EACH_SET_BIT(dir, check_dirs) { |
1101 FOR_EACH_SET_BIT(dir, check_dirs) { |
1099 TileIndex dest = TILE_ADD(tile, TileOffsByDir((Direction)dir)); |
1102 TileIndex dest = TILE_ADD(tile, TileOffsByDir((Direction)dir)); |
1100 Slope slope_dest = (Slope)(GetTileSlope(dest, NULL) & ~SLOPE_STEEP); |
1103 Slope slope_dest = GetTileSlope(dest, NULL) & ~SLOPE_STEEP; |
1101 if (slope_dest == SLOPE_FLAT || IsSlopeWithOneCornerRaised(slope_dest)) { |
1104 if (slope_dest == SLOPE_FLAT || IsSlopeWithOneCornerRaised(slope_dest)) { |
1102 MakeShore(tile); |
1105 MakeShore(tile); |
1103 break; |
1106 break; |
1104 } |
1107 } |
1105 } |
1108 } |