summaryrefslogtreecommitdiff
path: root/src/clear_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/clear_cmd.cpp')
-rw-r--r--src/clear_cmd.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp
index f9eb88df5..0db7590be 100644
--- a/src/clear_cmd.cpp
+++ b/src/clear_cmd.cpp
@@ -14,6 +14,7 @@
#include "command_func.h"
#include "landscape.h"
#include "genworld.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "water.h"
#include "core/random_func.hpp"
@@ -100,8 +101,28 @@ static void DrawClearLandFence(const TileInfo *ti)
EndSpriteCombine();
}
+static void DrawUndergroundTile_Clear(TileInfo *ti)
+{
+
+}
+
static void DrawTile_Clear(TileInfo *ti)
{
+ uint base_tile = TopTile(ti->tile);
+ uint underground_tile = DownTile(base_tile);
+
+ bool self_underground = IsUnderground(ti->tile);
+
+ bool have_canalization = IsTileType(base_tile, MP_HOUSE);
+ bool have_underground = !IsTileType(underground_tile, MP_CLEAR);
+
+ if (self_underground && !have_canalization)
+ DrawGroundSprite(SPR_FLAT_BARE_LAND + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
+
+ if (self_underground && have_canalization)
+ DrawGroundSprite(SPR_FLAT_GRASS_TILE + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
+
+ if (!self_underground)
switch (GetClearGround(ti->tile)) {
case CLEAR_GRASS:
DrawClearLandTile(ti, GetClearDensity(ti->tile));
@@ -126,6 +147,9 @@ static void DrawTile_Clear(TileInfo *ti)
break;
}
+ if (!self_underground && have_underground)
+ DrawGroundSprite(SPR_FLAT_BARE_LAND + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
+
DrawBridgeMiddle(ti);
}