22 #include "table/strings.h"
30 static const Price clear_price_table[] = {
44 if (flags &
DC_EXEC) DoClearSquare(tile);
49 void DrawClearLandTile(
const TileInfo *ti, byte
set)
54 void DrawHillyLandTile(
const TileInfo *ti)
63 static void DrawClearLandFence(
const TileInfo *ti)
73 SpriteID sprite = _clear_land_fence_sprites[fence_nw - 1] + _fence_mod_by_tileh_nw[ti->
tileh];
74 AddSortableSpriteToDraw(sprite, PAL_NONE, ti->
x, ti->
y - 15, 16, 31, maxz - z + 4, ti->
z + z,
false, 0, 15, -z);
80 SpriteID sprite = _clear_land_fence_sprites[fence_ne - 1] + _fence_mod_by_tileh_ne[ti->
tileh];
81 AddSortableSpriteToDraw(sprite, PAL_NONE, ti->
x - 15, ti->
y, 31, 16, maxz - z + 4, ti->
z + z,
false, 15, 0, -z);
87 if (fence_sw != 0 || fence_se != 0) {
91 SpriteID sprite = _clear_land_fence_sprites[fence_sw - 1] + _fence_mod_by_tileh_sw[ti->
tileh];
92 AddSortableSpriteToDraw(sprite, PAL_NONE, ti->
x, ti->
y, 16, 16, maxz - z + 4, ti->
z + z,
false, 0, 0, -z);
96 SpriteID sprite = _clear_land_fence_sprites[fence_se - 1] + _fence_mod_by_tileh_se[ti->
tileh];
97 AddSortableSpriteToDraw(sprite, PAL_NONE, ti->
x, ti->
y, 16, 16, maxz - z + 4, ti->
z + z,
false, 0, 0, -z);
103 static void DrawTile_Clear(
TileInfo *ti)
111 DrawHillyLandTile(ti);
120 DrawClearLandFence(ti);
132 static int GetSlopePixelZ_Clear(
TileIndex tile, uint x, uint y)
196 uint req_density = (k < 0) ? 0u :
min((uint)k, 3);
198 if (current_density < req_density) {
200 }
else if (current_density > req_density) {
223 static void TileLoopClearDesert(
TileIndex tile)
237 if (current == expected)
return;
249 static void TileLoop_Clear(
TileIndex tile)
263 case LT_TROPIC: TileLoopClearDesert(tile);
break;
271 if (_game_mode != GM_EDITOR) {
287 if (_game_mode == GM_EDITOR)
return;
301 field_type = (field_type < 8) ? field_type + 1 : 0;
313 void GenerateClearTile()
337 uint j =
GB(r, 16, 4) + 5;
343 if (--j == 0)
goto get_out;
358 static const StringID _clear_land_str[] = {
359 STR_LAI_CLEAR_DESCRIPTION_GRASS,
360 STR_LAI_CLEAR_DESCRIPTION_ROUGH_LAND,
361 STR_LAI_CLEAR_DESCRIPTION_ROCKS,
362 STR_LAI_CLEAR_DESCRIPTION_FIELDS,
363 STR_LAI_CLEAR_DESCRIPTION_SNOW_COVERED_LAND,
364 STR_LAI_CLEAR_DESCRIPTION_DESERT
370 td->
str = STR_LAI_CLEAR_DESCRIPTION_BARE_LAND;
389 GetSlopePixelZ_Clear,
393 GetTileTrackStatus_Clear,
397 ChangeTileOwner_Clear,