@ -1046,38 +1046,28 @@ static void ViewportAddLandscape()
direction = false ;
direction = false ;
int min_xy = _settings_game . construction . freeform_edges ? TILE_SIZE : 0 ;
do {
do {
int width_cur = width ;
int width_cur = width ;
u int x_cur = x ;
int x_cur = x ;
u int y_cur = y ;
int y_cur = y ;
do {
do {
TileType tt = MP_VOID ;
TileType tt ;
ti . x = x_cur ;
ti . x = x_cur ;
ti . y = y_cur ;
ti . y = y_cur ;
ti . z = 0 ;
if ( IsInsideMM ( x_cur , min_xy , MapMaxX ( ) * TILE_SIZE ) & &
IsInsideMM ( y_cur , min_xy , MapMaxY ( ) * TILE_SIZE ) ) {
ti . tileh = SLOPE_FLAT ;
ti . tile = TileVirtXY ( x_cur , y_cur ) ;
ti . tile = INVALID_TILE ;
ti . tileh = GetTilePixelSlope ( ti . tile , & ti . z ) ;
tt = GetTileType ( ti . tile ) ;
if ( x_cur < MapMaxX ( ) * TILE_SIZE & &
} else {
y_cur < MapMaxY ( ) * TILE_SIZE ) {
/* We are outside the map => paint black. */
TileIndex tile = TileVirtXY ( x_cur , y_cur ) ;
ti . tile = 0 ;
ti . tileh = GetTilePixelSlopeOutsideMap ( x_cur / ( int ) TILE_SIZE , y_cur / ( int ) TILE_SIZE , & ti . z ) ;
if ( ! _settings_game . construction . freeform_edges | | ( TileX ( tile ) ! = 0 & & TileY ( tile ) ! = 0 ) ) {
tt = MP_VOID ;
if ( x_cur = = ( ( int ) MapMaxX ( ) - 1 ) * TILE_SIZE | | y_cur = = ( ( int ) MapMaxY ( ) - 1 ) * TILE_SIZE ) {
uint maxh = max < uint > ( TileHeight ( tile ) , 1 ) ;
for ( uint h = 0 ; h < maxh ; h + + ) {
AddTileSpriteToDraw ( SPR_SHADOW_CELL , PAL_NONE , ti . x , ti . y , h * TILE_HEIGHT ) ;
}
}
ti . tile = tile ;
ti . tileh = GetTilePixelSlope ( tile , & ti . z ) ;
tt = GetTileType ( tile ) ;
}
}
}
_vd . foundation_part = FOUNDATION_PART_NONE ;
_vd . foundation_part = FOUNDATION_PART_NONE ;
@ -1088,8 +1078,8 @@ static void ViewportAddLandscape()
_tile_type_procs [ tt ] - > draw_tile_proc ( & ti ) ;
_tile_type_procs [ tt ] - > draw_tile_proc ( & ti ) ;
if ( ( x_cur = = ( int ) MapMaxX ( ) * TILE_SIZE & & IsInsideMM ( y_cur , 0 , MapMaxY ( ) * TILE_SIZE + 1 ) ) | |
if ( ( ( uint ) x_cur = = MapMaxX ( ) * TILE_SIZE & & IsInsideMM ( y_cur , 0 , MapMaxY ( ) * TILE_SIZE + 1 ) ) | |
( y_cur = = ( int ) MapMaxY ( ) * TILE_SIZE & & IsInsideMM ( x_cur , 0 , MapMaxX ( ) * TILE_SIZE + 1 ) ) ) {
( ( uint ) y_cur = = MapMaxY ( ) * TILE_SIZE & & IsInsideMM ( x_cur , 0 , MapMaxX ( ) * TILE_SIZE + 1 ) ) ) {
TileIndex tile = TileVirtXY ( x_cur , y_cur ) ;
TileIndex tile = TileVirtXY ( x_cur , y_cur ) ;
ti . tile = tile ;
ti . tile = tile ;
ti . tileh = GetTilePixelSlope ( tile , & ti . z ) ;
ti . tileh = GetTilePixelSlope ( tile , & ti . z ) ;