Import combined Enhanced viewport: zoom out, overlays & tooltips (r53_27127) patch
https://www.tt-forums.net/viewtopic.php?f=33&t=53394
This commit is contained in:

committed by
Jonathan G Rennison

parent
fd3388467f
commit
536a95dfd0
@@ -46,18 +46,43 @@ static CommandCost ClearTile_Clear(TileIndex tile, DoCommandFlag flags)
|
||||
return price;
|
||||
}
|
||||
|
||||
SpriteID GetSpriteIDForClearLand(const Slope slope, byte set)
|
||||
{
|
||||
return SPR_FLAT_BARE_LAND + SlopeToSpriteOffset(slope) + set * 19;
|
||||
}
|
||||
|
||||
void DrawClearLandTile(const TileInfo *ti, byte set)
|
||||
{
|
||||
DrawGroundSprite(SPR_FLAT_BARE_LAND + SlopeToSpriteOffset(ti->tileh) + set * 19, PAL_NONE);
|
||||
DrawGroundSprite(GetSpriteIDForClearLand(ti->tileh, set), PAL_NONE);
|
||||
}
|
||||
|
||||
SpriteID GetSpriteIDForHillyLand(const Slope slope, const uint rough_index)
|
||||
{
|
||||
if (slope != SLOPE_FLAT) {
|
||||
return SPR_FLAT_ROUGH_LAND + SlopeToSpriteOffset(slope);
|
||||
} else {
|
||||
return _landscape_clear_sprites_rough[rough_index];
|
||||
}
|
||||
}
|
||||
|
||||
void DrawHillyLandTile(const TileInfo *ti)
|
||||
{
|
||||
if (ti->tileh != SLOPE_FLAT) {
|
||||
DrawGroundSprite(SPR_FLAT_ROUGH_LAND + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
|
||||
} else {
|
||||
DrawGroundSprite(_landscape_clear_sprites_rough[GB(ti->x ^ ti->y, 4, 3)], PAL_NONE);
|
||||
}
|
||||
DrawGroundSprite(GetSpriteIDForHillyLand(ti->tileh, GB(ti->x ^ ti->y, 4, 3)), PAL_NONE);
|
||||
}
|
||||
|
||||
SpriteID GetSpriteIDForRocks(const Slope slope, const uint tile_hash)
|
||||
{
|
||||
return (tile_hash & 1 ? SPR_FLAT_ROCKY_LAND_2 : SPR_FLAT_ROCKY_LAND_1) + SlopeToSpriteOffset(slope);
|
||||
}
|
||||
|
||||
SpriteID GetSpriteIDForFields(const Slope slope, const uint field_type)
|
||||
{
|
||||
return _clear_land_sprites_farmland[field_type] + SlopeToSpriteOffset(slope);
|
||||
}
|
||||
|
||||
SpriteID GetSpriteIDForSnowDesert(const Slope slope, const uint density)
|
||||
{
|
||||
return _clear_land_sprites_snow_desert[density] + SlopeToSpriteOffset(slope);
|
||||
}
|
||||
|
||||
static void DrawClearLandFence(const TileInfo *ti)
|
||||
@@ -112,17 +137,17 @@ static void DrawTile_Clear(TileInfo *ti)
|
||||
break;
|
||||
|
||||
case CLEAR_ROCKS:
|
||||
DrawGroundSprite((TileHash(ti->x, ti->y) & 1 ? SPR_FLAT_ROCKY_LAND_2 : SPR_FLAT_ROCKY_LAND_1) + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
|
||||
DrawGroundSprite(GetSpriteIDForRocks(ti->tileh, TileHash(ti->x, ti->y)), PAL_NONE);
|
||||
break;
|
||||
|
||||
case CLEAR_FIELDS:
|
||||
DrawGroundSprite(_clear_land_sprites_farmland[GetFieldType(ti->tile)] + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
|
||||
DrawGroundSprite(GetSpriteIDForFields(ti->tileh, GetFieldType(ti->tile)), PAL_NONE);
|
||||
DrawClearLandFence(ti);
|
||||
break;
|
||||
|
||||
case CLEAR_SNOW:
|
||||
case CLEAR_DESERT:
|
||||
DrawGroundSprite(_clear_land_sprites_snow_desert[GetClearDensity(ti->tile)] + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
|
||||
DrawGroundSprite(GetSpriteIDForSnowDesert(ti->tileh, GetClearDensity(ti->tile)), PAL_NONE);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -171,7 +196,7 @@ static void UpdateFences(TileIndex tile)
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
if (dirty) MarkTileDirtyByTile(tile);
|
||||
if (dirty) MarkTileDirtyByTile(tile, ZOOM_LVL_DRAW_MAP);
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +278,6 @@ static void TileLoop_Clear(TileIndex tile)
|
||||
int z;
|
||||
if (IsTileFlat(tile, &z) && z == 0) {
|
||||
DoFloodTile(tile);
|
||||
MarkTileDirtyByTile(tile);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -307,7 +331,7 @@ static void TileLoop_Clear(TileIndex tile)
|
||||
return;
|
||||
}
|
||||
|
||||
MarkTileDirtyByTile(tile);
|
||||
MarkTileDirtyByTile(tile, ZOOM_LVL_DRAW_MAP);
|
||||
}
|
||||
|
||||
void GenerateClearTile()
|
||||
|
Reference in New Issue
Block a user