OpenTTD
clear_cmd.cpp
Go to the documentation of this file.
1 /* $Id$ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
12 #include "stdafx.h"
13 #include "clear_map.h"
14 #include "command_func.h"
15 #include "landscape.h"
16 #include "genworld.h"
17 #include "viewport_func.h"
18 #include "water.h"
19 #include "core/random_func.hpp"
20 #include "newgrf_generic.h"
21 
22 #include "table/strings.h"
23 #include "table/sprites.h"
24 #include "table/clear_land.h"
25 
26 #include "safeguards.h"
27 
28 static CommandCost ClearTile_Clear(TileIndex tile, DoCommandFlag flags)
29 {
30  static const Price clear_price_table[] = {
31  PR_CLEAR_GRASS,
32  PR_CLEAR_ROUGH,
33  PR_CLEAR_ROCKS,
34  PR_CLEAR_FIELDS,
35  PR_CLEAR_ROUGH,
36  PR_CLEAR_ROUGH,
37  };
39 
40  if (!IsClearGround(tile, CLEAR_GRASS) || GetClearDensity(tile) != 0) {
41  price.AddCost(_price[clear_price_table[GetClearGround(tile)]]);
42  }
43 
44  if (flags & DC_EXEC) DoClearSquare(tile);
45 
46  return price;
47 }
48 
49 void DrawClearLandTile(const TileInfo *ti, byte set)
50 {
51  DrawGroundSprite(SPR_FLAT_BARE_LAND + SlopeToSpriteOffset(ti->tileh) + set * 19, PAL_NONE);
52 }
53 
54 void DrawHillyLandTile(const TileInfo *ti)
55 {
56  if (ti->tileh != SLOPE_FLAT) {
57  DrawGroundSprite(SPR_FLAT_ROUGH_LAND + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
58  } else {
59  DrawGroundSprite(_landscape_clear_sprites_rough[GB(TileHash(ti->x, ti->y), 0, 3)], PAL_NONE);
60  }
61 }
62 
63 static void DrawClearLandFence(const TileInfo *ti)
64 {
65  /* combine fences into one sprite object */
67 
68  int maxz = GetSlopeMaxPixelZ(ti->tileh);
69 
70  uint fence_nw = GetFence(ti->tile, DIAGDIR_NW);
71  if (fence_nw != 0) {
72  int z = GetSlopePixelZInCorner(ti->tileh, CORNER_W);
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);
75  }
76 
77  uint fence_ne = GetFence(ti->tile, DIAGDIR_NE);
78  if (fence_ne != 0) {
79  int z = GetSlopePixelZInCorner(ti->tileh, CORNER_E);
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);
82  }
83 
84  uint fence_sw = GetFence(ti->tile, DIAGDIR_SW);
85  uint fence_se = GetFence(ti->tile, DIAGDIR_SE);
86 
87  if (fence_sw != 0 || fence_se != 0) {
88  int z = GetSlopePixelZInCorner(ti->tileh, CORNER_S);
89 
90  if (fence_sw != 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);
93  }
94 
95  if (fence_se != 0) {
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);
98  }
99  }
101 }
102 
103 static void DrawTile_Clear(TileInfo *ti)
104 {
105  switch (GetClearGround(ti->tile)) {
106  case CLEAR_GRASS:
107  DrawClearLandTile(ti, GetClearDensity(ti->tile));
108  break;
109 
110  case CLEAR_ROUGH:
111  DrawHillyLandTile(ti);
112  break;
113 
114  case CLEAR_ROCKS:
115  DrawGroundSprite((HasGrfMiscBit(GMB_SECOND_ROCKY_TILE_SET) && (TileHash(ti->x, ti->y) & 1) ? SPR_FLAT_ROCKY_LAND_2 : SPR_FLAT_ROCKY_LAND_1) + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
116  break;
117 
118  case CLEAR_FIELDS:
119  DrawGroundSprite(_clear_land_sprites_farmland[GetFieldType(ti->tile)] + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
120  DrawClearLandFence(ti);
121  break;
122 
123  case CLEAR_SNOW:
124  case CLEAR_DESERT:
125  DrawGroundSprite(_clear_land_sprites_snow_desert[GetClearDensity(ti->tile)] + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
126  break;
127  }
128 
129  DrawBridgeMiddle(ti);
130 }
131 
132 static int GetSlopePixelZ_Clear(TileIndex tile, uint x, uint y)
133 {
134  int z;
135  Slope tileh = GetTilePixelSlope(tile, &z);
136 
137  return z + GetPartialPixelZ(x & 0xF, y & 0xF, tileh);
138 }
139 
140 static Foundation GetFoundation_Clear(TileIndex tile, Slope tileh)
141 {
142  return FOUNDATION_NONE;
143 }
144 
145 static void UpdateFences(TileIndex tile)
146 {
147  assert(IsTileType(tile, MP_CLEAR) && IsClearGround(tile, CLEAR_FIELDS));
148  bool dirty = false;
149 
150  bool neighbour = (IsTileType(TILE_ADDXY(tile, 1, 0), MP_CLEAR) && IsClearGround(TILE_ADDXY(tile, 1, 0), CLEAR_FIELDS));
151  if (!neighbour && GetFence(tile, DIAGDIR_SW) == 0) {
152  SetFence(tile, DIAGDIR_SW, 3);
153  dirty = true;
154  }
155 
156  neighbour = (IsTileType(TILE_ADDXY(tile, 0, 1), MP_CLEAR) && IsClearGround(TILE_ADDXY(tile, 0, 1), CLEAR_FIELDS));
157  if (!neighbour && GetFence(tile, DIAGDIR_SE) == 0) {
158  SetFence(tile, DIAGDIR_SE, 3);
159  dirty = true;
160  }
161 
162  neighbour = (IsTileType(TILE_ADDXY(tile, -1, 0), MP_CLEAR) && IsClearGround(TILE_ADDXY(tile, -1, 0), CLEAR_FIELDS));
163  if (!neighbour && GetFence(tile, DIAGDIR_NE) == 0) {
164  SetFence(tile, DIAGDIR_NE, 3);
165  dirty = true;
166  }
167 
168  neighbour = (IsTileType(TILE_ADDXY(tile, 0, -1), MP_CLEAR) && IsClearGround(TILE_ADDXY(tile, 0, -1), CLEAR_FIELDS));
169  if (!neighbour && GetFence(tile, DIAGDIR_NW) == 0) {
170  SetFence(tile, DIAGDIR_NW, 3);
171  dirty = true;
172  }
173 
174  if (dirty) MarkTileDirtyByTile(tile);
175 }
176 
177 
179 static void TileLoopClearAlps(TileIndex tile)
180 {
181  int k = GetTileZ(tile) - GetSnowLine() + 1;
182 
183  if (k < 0) {
184  /* Below the snow line, do nothing if no snow. */
185  if (!IsSnowTile(tile)) return;
186  } else {
187  /* At or above the snow line, make snow tile if needed. */
188  if (!IsSnowTile(tile)) {
189  MakeSnow(tile);
190  MarkTileDirtyByTile(tile);
191  return;
192  }
193  }
194  /* Update snow density. */
195  uint current_density = GetClearDensity(tile);
196  uint req_density = (k < 0) ? 0u : min((uint)k, 3);
197 
198  if (current_density < req_density) {
199  AddClearDensity(tile, 1);
200  } else if (current_density > req_density) {
201  AddClearDensity(tile, -1);
202  } else {
203  /* Density at the required level. */
204  if (k >= 0) return;
205  ClearSnow(tile);
206  }
207  MarkTileDirtyByTile(tile);
208 }
209 
215 static inline bool NeighbourIsNormal(TileIndex tile)
216 {
217  for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) {
218  TileIndex t = tile + TileOffsByDiagDir(dir);
219  if (!IsValidTile(t)) continue;
220  if (GetTropicZone(t) != TROPICZONE_DESERT) return true;
221  if (HasTileWaterClass(t) && GetWaterClass(t) == WATER_CLASS_SEA) return true;
222  }
223  return false;
224 }
225 
226 static void TileLoopClearDesert(TileIndex tile)
227 {
228  /* Current desert level - 0 if it is not desert */
229  uint current = 0;
230  if (IsClearGround(tile, CLEAR_DESERT)) current = GetClearDensity(tile);
231 
232  /* Expected desert level - 0 if it shouldn't be desert */
233  uint expected = 0;
234  if (GetTropicZone(tile) == TROPICZONE_DESERT) {
235  expected = NeighbourIsNormal(tile) ? 1 : 3;
236  }
237 
238  if (current == expected) return;
239 
240  if (expected == 0) {
242  } else {
243  /* Transition from clear to desert is not smooth (after clearing desert tile) */
244  SetClearGroundDensity(tile, CLEAR_DESERT, expected);
245  }
246 
247  MarkTileDirtyByTile(tile);
248 }
249 
250 static void TileLoop_Clear(TileIndex tile)
251 {
252  /* If the tile is at any edge flood it to prevent maps without water. */
254  int z;
255  if (IsTileFlat(tile, &z) && z == 0) {
256  DoFloodTile(tile);
257  MarkTileDirtyByTile(tile);
258  return;
259  }
260  }
261  AmbientSoundEffect(tile);
262 
264  case LT_TROPIC: TileLoopClearDesert(tile); break;
265  case LT_ARCTIC: TileLoopClearAlps(tile); break;
266  }
267 
268  switch (GetClearGround(tile)) {
269  case CLEAR_GRASS:
270  if (GetClearDensity(tile) == 3) return;
271 
272  if (_game_mode != GM_EDITOR) {
273  if (GetClearCounter(tile) < 7) {
274  AddClearCounter(tile, 1);
275  return;
276  } else {
277  SetClearCounter(tile, 0);
278  AddClearDensity(tile, 1);
279  }
280  } else {
281  SetClearGroundDensity(tile, GB(Random(), 0, 8) > 21 ? CLEAR_GRASS : CLEAR_ROUGH, 3);
282  }
283  break;
284 
285  case CLEAR_FIELDS:
286  UpdateFences(tile);
287 
288  if (_game_mode == GM_EDITOR) return;
289 
290  if (GetClearCounter(tile) < 7) {
291  AddClearCounter(tile, 1);
292  return;
293  } else {
294  SetClearCounter(tile, 0);
295  }
296 
297  if (GetIndustryIndexOfField(tile) == INVALID_INDUSTRY && GetFieldType(tile) >= 7) {
298  /* This farmfield is no longer farmfield, so make it grass again */
299  MakeClear(tile, CLEAR_GRASS, 2);
300  } else {
301  uint field_type = GetFieldType(tile);
302  field_type = (field_type < 8) ? field_type + 1 : 0;
303  SetFieldType(tile, field_type);
304  }
305  break;
306 
307  default:
308  return;
309  }
310 
311  MarkTileDirtyByTile(tile);
312 }
313 
314 void GenerateClearTile()
315 {
316  uint i, gi;
317  TileIndex tile;
318 
319  /* add rough tiles */
320  i = ScaleByMapSize(GB(Random(), 0, 10) + 0x400);
321  gi = ScaleByMapSize(GB(Random(), 0, 7) + 0x80);
322 
324  do {
326  tile = RandomTile();
328  } while (--i);
329 
330  /* add rocky tiles */
331  i = gi;
332  do {
333  uint32 r = Random();
334  tile = RandomTileSeed(r);
335 
337  if (IsTileType(tile, MP_CLEAR) && !IsClearGround(tile, CLEAR_DESERT)) {
338  uint j = GB(r, 16, 4) + 5;
339  for (;;) {
340  TileIndex tile_new;
341 
343  do {
344  if (--j == 0) goto get_out;
345  tile_new = tile + TileOffsByDiagDir((DiagDirection)GB(Random(), 0, 2));
346  } while (!IsTileType(tile_new, MP_CLEAR) || IsClearGround(tile_new, CLEAR_DESERT));
347  tile = tile_new;
348  }
349 get_out:;
350  }
351  } while (--i);
352 }
353 
354 static TrackStatus GetTileTrackStatus_Clear(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
355 {
356  return 0;
357 }
358 
359 static const StringID _clear_land_str[] = {
360  STR_LAI_CLEAR_DESCRIPTION_GRASS,
361  STR_LAI_CLEAR_DESCRIPTION_ROUGH_LAND,
362  STR_LAI_CLEAR_DESCRIPTION_ROCKS,
363  STR_LAI_CLEAR_DESCRIPTION_FIELDS,
364  STR_LAI_CLEAR_DESCRIPTION_SNOW_COVERED_LAND,
365  STR_LAI_CLEAR_DESCRIPTION_DESERT
366 };
367 
368 static void GetTileDesc_Clear(TileIndex tile, TileDesc *td)
369 {
370  if (IsClearGround(tile, CLEAR_GRASS) && GetClearDensity(tile) == 0) {
371  td->str = STR_LAI_CLEAR_DESCRIPTION_BARE_LAND;
372  } else {
373  td->str = _clear_land_str[GetClearGround(tile)];
374  }
375  td->owner[0] = GetTileOwner(tile);
376 }
377 
378 static void ChangeTileOwner_Clear(TileIndex tile, Owner old_owner, Owner new_owner)
379 {
380  return;
381 }
382 
383 static CommandCost TerraformTile_Clear(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
384 {
385  return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
386 }
387 
388 extern const TileTypeProcs _tile_type_clear_procs = {
389  DrawTile_Clear,
390  GetSlopePixelZ_Clear,
391  ClearTile_Clear,
392  NULL,
393  GetTileDesc_Clear,
394  GetTileTrackStatus_Clear,
395  NULL,
396  NULL,
397  TileLoop_Clear,
398  ChangeTileOwner_Clear,
399  NULL,
400  NULL,
401  GetFoundation_Clear,
402  TerraformTile_Clear,
403 };
#define RandomTile()
Get a valid random tile.
Definition: map_func.h:437
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Definition: settings.cpp:77
static TropicZone GetTropicZone(TileIndex tile)
Get the tropic zone.
Definition: tile_map.h:240
Tile information, used while rendering the tile.
Definition: tile_cmd.h:44
byte landscape
the landscape we&#39;re currently in
Tile is desert.
Definition: tile_type.h:73
static bool IsSnowTile(TileIndex t)
Test if a tile is covered with snow.
Definition: clear_map.h:37
uint GetPartialPixelZ(int x, int y, Slope corners)
Determines height at given coordinate of a slope.
Definition: landscape.cpp:217
static WaterClass GetWaterClass(TileIndex t)
Get the water class at a tile.
Definition: water_map.h:106
Slope tileh
Slope of the tile.
Definition: tile_cmd.h:47
static uint ScaleByMapSize(uint n)
Scales the given value by the map size, where the given value is for a 256 by 256 map...
Definition: map_func.h:124
static bool NeighbourIsNormal(TileIndex tile)
Tests if at least one surrounding tile is non-desert.
Definition: clear_cmd.cpp:215
Price
Enumeration of all base prices for use with Prices.
Definition: economy_type.h:67
demolish a tile
Definition: command_type.h:182
Tile description for the &#39;land area information&#39; tool.
Definition: tile_cmd.h:53
Northeast, upper right on your monitor.
Functions related to world/map generation.
Common return value for all commands.
Definition: command_type.h:25
Used for iterations.
void StartSpriteCombine()
Starts a block of sprites, which are "combined" into a single bounding box.
Definition: viewport.cpp:751
static bool IsClearGround(TileIndex t, ClearGround ct)
Set the type of clear tile.
Definition: clear_map.h:73
static void AmbientSoundEffect(TileIndex tile)
Play an ambient sound effect for an empty tile.
bool IsTileFlat(TileIndex tile, int *h)
Check if a given tile is flat.
Definition: tile_map.cpp:102
static IndustryID GetIndustryIndexOfField(TileIndex t)
Get the industry (farm) that made the field.
Definition: clear_map.h:197
a flat tile
Definition: slope_type.h:51
int z
Height.
Definition: tile_cmd.h:49
Owner owner[4]
Name of the owner(s)
Definition: tile_cmd.h:55
static uint GetFence(TileIndex t, DiagDirection side)
Is there a fence at the given border?
Definition: clear_map.h:223
int GetTileZ(TileIndex tile)
Get bottom height of the tile.
Definition: tile_map.cpp:123
Functions related to (drawing on) viewports.
Pseudo random number generator.
bool freeform_edges
allow terraforming the tiles at the map edges
static bool IsValidTile(TileIndex tile)
Checks if a tile is valid.
Definition: tile_map.h:163
void EndSpriteCombine()
Terminates a block of sprites started by StartSpriteCombine.
Definition: viewport.cpp:761
uint x
X position of the tile in unit coordinates.
Definition: tile_cmd.h:45
static uint GetFieldType(TileIndex t)
Get the field type (production stage) of the field.
Definition: clear_map.h:173
static TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
Definition: map_func.h:343
Foundation
Enumeration for Foundations.
Definition: slope_type.h:95
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a given tiletype.
Definition: tile_map.h:152
TileIndex tile
Tile index.
Definition: tile_cmd.h:48
CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags)
Shorthand for calling the long DoCommand with a container.
Definition: command.cpp:440
static Owner GetTileOwner(TileIndex tile)
Returns the owner of a tile.
Definition: tile_map.h:180
DoCommandFlag
List of flags for a command.
Definition: command_type.h:343
Southeast.
Southwest.
Definition of base types and functions in a cross-platform compatible way.
#define TILE_ADDXY(tile, x, y)
Adds a given offset to a tile.
Definition: map_func.h:260
A number of safeguards to prevent using unsafe methods.
uint y
Y position of the tile in unit coordinates.
Definition: tile_cmd.h:46
static void SetClearGroundDensity(TileIndex t, ClearGround type, uint density)
Sets ground type and density in one go, also sets the counter to 0.
Definition: clear_map.h:160
Used for iterations.
static Slope GetTilePixelSlope(TileIndex tile, int *h)
Return the slope of a given tile.
Definition: tile_map.h:282
static void SetFieldType(TileIndex t, uint f)
Set the field type (production stage) of the field.
Definition: clear_map.h:185
Tables with sprites for clear land and fences.
Northwest.
void MarkTileDirtyByTile(TileIndex tile, int bridge_level_offset, int tile_height_override)
Mark a tile given by its index dirty for repaint.
Definition: viewport.cpp:1785
DiagDirection
Enumeration for diagonal directions.
static uint TileHash(uint x, uint y)
Calculate a hash value from a tile position.
Definition: tile_map.h:318
static T min(const T a, const T b)
Returns the minimum of two values.
Definition: math_func.hpp:42
static ClearGround GetClearGround(TileIndex t)
Get the type of clear tile.
Definition: clear_map.h:61
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Definition: strings_type.h:18
uint DistanceFromEdge(TileIndex tile)
Param the minimum distance to an edge.
Definition: map.cpp:219
void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int w, int h, int dz, int z, bool transparent, int bb_offset_x, int bb_offset_y, int bb_offset_z, const SubSprite *sub)
Draw a (transparent) sprite at given coordinates with a given bounding box.
Definition: viewport.cpp:654
static void AddClearDensity(TileIndex t, int d)
Increment the density of a non-field clear tile.
Definition: clear_map.h:97
static uint GetClearDensity(TileIndex t)
Get the density of a non-field clear tile.
Definition: clear_map.h:85
Construction costs.
Definition: economy_type.h:151
static TileIndex RandomTileSeed(uint32 r)
Get a random tile out of a given seed.
Definition: map_func.h:426
execute the given command
Definition: command_type.h:345
static int GetSlopeMaxPixelZ(Slope s)
Returns the height of the highest corner of a slope relative to TileZ (= minimal height) ...
Definition: slope_func.h:175
static int GetSlopePixelZInCorner(Slope tileh, Corner corner)
Determine the Z height of a corner relative to TileZ.
Definition: landscape.h:55
Functions related to generic callbacks.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition: gfx_type.h:19
static uint GetClearCounter(TileIndex t)
Get the counter used to advance to the next clear density/field type.
Definition: clear_map.h:122
Set of callback functions for performing tile operations of a given tile type.
Definition: tile_cmd.h:144
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:80
Map accessors for &#39;clear&#39; tiles.
static void MakeSnow(TileIndex t, uint density=0)
Make a snow tile.
Definition: clear_map.h:302
static void MakeClear(TileIndex t, ClearGround g, uint density)
Make a clear tile.
Definition: clear_map.h:261
The tile has no foundation, the slope remains unchanged.
Definition: slope_type.h:96
TransportType
Available types of transport.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
Slope
Enumeration for the slope-type.
Definition: slope_type.h:50
0-3
Definition: clear_map.h:26
static void AddClearCounter(TileIndex t, int c)
Increments the counter used to advance to the next clear density/field type.
Definition: clear_map.h:134
Functions related to OTTD&#39;s landscape.
Functions related to commands.
void DrawGroundSprite(SpriteID image, PaletteID pal, const SubSprite *sub, int extra_offs_x, int extra_offs_y)
Draws a ground sprite for the current tile.
Definition: viewport.cpp:570
byte GetSnowLine()
Get the current snow line, either variable or static.
Definition: landscape.cpp:646
Make rough and rocky areas.
Definition: genworld.h:72
static uint SlopeToSpriteOffset(Slope s)
Returns the Sprite offset for a given Slope.
Definition: slope_func.h:417
ConstructionSettings construction
construction of things in-game
StringID str
Description of the tile.
Definition: tile_cmd.h:54
static bool HasTileWaterClass(TileIndex t)
Checks whether the tile has an waterclass associated.
Definition: water_map.h:95
static void SetClearCounter(TileIndex t, uint c)
Sets the counter used to advance to the next clear density/field type.
Definition: clear_map.h:146
static void SetFence(TileIndex t, DiagDirection side, uint h)
Sets the type of fence (and whether there is one) for the given border.
Definition: clear_map.h:242
GameCreationSettings game_creation
settings used during the creation of a game (map)
A tile without any structures, i.e. grass, rocks, farm fields etc.
Definition: tile_type.h:43
Owner
Enum for all companies/owners.
Definition: company_type.h:20
void SetGeneratingWorldProgress(GenWorldProgress cls, uint total)
Set the total of a stage of the world generation.
Functions related to water (management)
void IncreaseGeneratingWorldProgress(GenWorldProgress cls)
Increases the current stage of the world generation with one.
static bool HasGrfMiscBit(GrfMiscBit bit)
Check for grf miscellaneous bits.
Definition: newgrf.h:174
static void ClearSnow(TileIndex t)
Clear the snow from a tile and return it to its previous type.
Definition: clear_map.h:318
void DrawBridgeMiddle(const TileInfo *ti)
Draw the middle bits of a bridge.
This file contains all sprite-related enums and defines.
void DoFloodTile(TileIndex target)
Floods a tile.
Definition: water_cmd.cpp:1041
static void TileLoopClearAlps(TileIndex tile)
Convert to or from snowy tiles.
Definition: clear_cmd.cpp:179