Merge branch 'master' into jgrpp
# Conflicts: # src/lang/czech.txt # src/order_backup.h # src/settings_internal.h # src/string.cpp # src/viewport.cpp
This commit is contained in:
@@ -375,7 +375,7 @@ std::vector<DrawnPathRouteTileLine> _vp_route_paths_last_mark_dirty;
|
||||
static void MarkRoutePathsDirty(const std::vector<DrawnPathRouteTileLine> &lines);
|
||||
|
||||
TileHighlightData _thd;
|
||||
static TileInfo *_cur_ti;
|
||||
static TileInfo _cur_ti;
|
||||
bool _draw_bounding_boxes = false;
|
||||
bool _draw_dirty_blocks = false;
|
||||
std::atomic<uint> _dirty_block_colour;
|
||||
@@ -978,7 +978,7 @@ void DrawGroundSpriteAt(SpriteID image, PaletteID pal, int32 x, int32 y, int z,
|
||||
Point pt = RemapCoords(x, y, z);
|
||||
AddChildSpriteToFoundation(image, pal, sub, _vd.foundation_part, pt.x + extra_offs_x * ZOOM_LVL_BASE, pt.y + extra_offs_y * ZOOM_LVL_BASE);
|
||||
} else {
|
||||
AddTileSpriteToDraw(image, pal, _cur_ti->x + x, _cur_ti->y + y, _cur_ti->z + z, sub, extra_offs_x * ZOOM_LVL_BASE, extra_offs_y * ZOOM_LVL_BASE);
|
||||
AddTileSpriteToDraw(image, pal, _cur_ti.x + x, _cur_ti.y + y, _cur_ti.z + z, sub, extra_offs_x * ZOOM_LVL_BASE, extra_offs_y * ZOOM_LVL_BASE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1684,26 +1684,24 @@ static void ViewportAddLandscape()
|
||||
dbg_assert(row == tilecoord.y + tilecoord.x);
|
||||
|
||||
TileType tile_type;
|
||||
TileInfo tile_info;
|
||||
_cur_ti = &tile_info;
|
||||
tile_info.x = tilecoord.x * TILE_SIZE; // FIXME tile_info should use signed integers
|
||||
tile_info.y = tilecoord.y * TILE_SIZE;
|
||||
_cur_ti.x = tilecoord.x * TILE_SIZE;
|
||||
_cur_ti.y = tilecoord.y * TILE_SIZE;
|
||||
|
||||
if (IsInsideBS(tilecoord.x, 0, MapSizeX()) && IsInsideBS(tilecoord.y, 0, MapSizeY())) {
|
||||
/* This includes the south border at MapMaxX / MapMaxY. When terraforming we still draw tile selections there. */
|
||||
tile_info.tile = TileXY(tilecoord.x, tilecoord.y);
|
||||
tile_type = GetTileType(tile_info.tile);
|
||||
_cur_ti.tile = TileXY(tilecoord.x, tilecoord.y);
|
||||
tile_type = GetTileType(_cur_ti.tile);
|
||||
} else {
|
||||
tile_info.tile = INVALID_TILE;
|
||||
_cur_ti.tile = INVALID_TILE;
|
||||
tile_type = MP_VOID;
|
||||
}
|
||||
|
||||
if (tile_type != MP_VOID) {
|
||||
/* We are inside the map => paint landscape. */
|
||||
tile_info.tileh = GetTilePixelSlope(tile_info.tile, &tile_info.z);
|
||||
_cur_ti.tileh = GetTilePixelSlope(_cur_ti.tile, &_cur_ti.z);
|
||||
} else {
|
||||
/* We are outside the map => paint black. */
|
||||
tile_info.tileh = GetTilePixelSlopeOutsideMap(tilecoord.x, tilecoord.y, &tile_info.z);
|
||||
_cur_ti.tileh = GetTilePixelSlopeOutsideMap(tilecoord.x, tilecoord.y, &_cur_ti.z);
|
||||
}
|
||||
|
||||
int viewport_y = GetViewportY(tilecoord);
|
||||
@@ -1722,10 +1720,10 @@ static void ViewportAddLandscape()
|
||||
/* Is tile with buildings visible? */
|
||||
if (min_visible_height < MAX_TILE_EXTENT_TOP) tile_visible = true;
|
||||
|
||||
if (IsBridgeAbove(tile_info.tile)) {
|
||||
if (IsBridgeAbove(_cur_ti.tile)) {
|
||||
/* Is the bridge visible? */
|
||||
TileIndex bridge_tile = GetNorthernBridgeEnd(tile_info.tile);
|
||||
int bridge_height = ZOOM_LVL_BASE * (GetBridgePixelHeight(bridge_tile) - TilePixelHeight(tile_info.tile));
|
||||
TileIndex bridge_tile = GetNorthernBridgeEnd(_cur_ti.tile);
|
||||
int bridge_height = ZOOM_LVL_BASE * (GetBridgePixelHeight(bridge_tile) - TilePixelHeight(_cur_ti.tile));
|
||||
if (min_visible_height < bridge_height + MAX_TILE_EXTENT_TOP) tile_visible = true;
|
||||
}
|
||||
|
||||
@@ -1747,10 +1745,10 @@ static void ViewportAddLandscape()
|
||||
_vd.last_foundation_child[1] = nullptr;
|
||||
|
||||
bool no_ground_tiles = min_visible_height > 0;
|
||||
_tile_type_procs[tile_type]->draw_tile_proc(&tile_info, { min_visible_height, no_ground_tiles });
|
||||
if (tile_info.tile != INVALID_TILE && min_visible_height <= 0) {
|
||||
DrawTileSelection(&tile_info);
|
||||
DrawTileZoning(&tile_info);
|
||||
_tile_type_procs[tile_type]->draw_tile_proc(&_cur_ti, { min_visible_height, no_ground_tiles });
|
||||
if (_cur_ti.tile != INVALID_TILE && min_visible_height <= 0) {
|
||||
DrawTileSelection(&_cur_ti);
|
||||
DrawTileZoning(&_cur_ti);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user