|
OpenTTD Source 20260711-master-g3fb3006dff
|
Commands related to clear tiles. More...
#include "stdafx.h"#include "clear_map.h"#include "command_func.h"#include "landscape.h"#include "genworld.h"#include "viewport_func.h"#include "core/random_func.hpp"#include "newgrf_generic.h"#include "landscape_cmd.h"#include "table/strings.h"#include "table/sprites.h"#include "table/clear_land.h"#include "safeguards.h"Go to the source code of this file.
Functions | |
| static CommandCost | ClearTile_Clear (TileIndex tile, DoCommandFlags flags) |
| Tile callback function signature for clearing a tile. | |
| void | DrawClearLandTile (const TileInfo *ti, uint8_t density) |
| Draw a ClearGround::Grass tile. | |
| void | DrawRoughLandTile (const TileInfo *ti) |
| Draw a ClearGround::Rough tile. | |
| static void | DrawClearLandFence (const TileInfo *ti) |
| Draw the fences atop a ClearGround::Fields tile. | |
| static void | DrawTile_Clear (TileInfo *ti) |
| Tile callback function signature for drawing a tile and its contents to the screen. | |
| static int | GetSlopePixelZ_Clear (TileIndex tile, uint x, uint y, bool ground_vehicle) |
Tile callback function signature for obtaining the world Z coordinate of a given point of a tile. | |
| static void | UpdateFences (TileIndex tile) |
| static void | TileLoopClearAlps (TileIndex tile) |
| Convert to or from snowy tiles. | |
| static bool | NeighbourIsNormal (TileIndex tile) |
| Tests if at least one surrounding tile is non-desert. | |
| static void | TileLoopClearDesert (TileIndex tile) |
| static void | TileLoop_Clear (TileIndex tile) |
| Tile callback function signature for running periodic tile updates. | |
| void | GenerateClearTile () |
| static void | GetTileDesc_Clear (TileIndex tile, TileDesc &td) |
| Tile callback function signature for obtaining a tile description. | |
Variables | |
| const TileTypeProcs | _tile_type_clear_procs |
| TileTypeProcs definitions for TileType::Clear tiles. | |
Commands related to clear tiles.
Definition in file clear_cmd.cpp.
|
static |
Tile callback function signature for clearing a tile.
| tile | The tile to clear. |
| flags | The command flags. |
Definition at line 27 of file clear_cmd.cpp.
References _price, CommandCost::AddCost(), ClearFields, ClearGrass, ClearRocks, ClearRough, Construction, Execute, GetClearDensity(), GetClearGround(), Grass, IsSnowTile(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
|
static |
Draw the fences atop a ClearGround::Fields tile.
| ti | The tile to draw. |
Definition at line 83 of file clear_cmd.cpp.
References _clear_land_fence_sprites, _fence_mod_by_tileh_ne, _fence_mod_by_tileh_nw, _fence_mod_by_tileh_se, _fence_mod_by_tileh_sw, AddSortableSpriteToDraw(), EndSpriteCombine(), SpriteBounds::extent, GetFence(), GetSlopeMaxPixelZ(), GetSlopePixelZInCorner(), NE, NW, SpriteBounds::offset, SE, StartSpriteCombine(), SW, TileInfo::tile, TILE_SIZE, TileInfo::tileh, Coord3D< T >::x, Coord3D< T >::y, and Coord3D< T >::z.
Referenced by DrawTile_Clear().
| void DrawClearLandTile | ( | const TileInfo * | ti, |
| uint8_t | density ) |
Draw a ClearGround::Grass tile.
| ti | The tile to draw. |
| density | The density of the dirt -> grass transition to draw. |
Definition at line 61 of file clear_cmd.cpp.
References _clear_land_sprites_grass, DrawGroundSprite(), SlopeToSpriteOffset(), and TileInfo::tileh.
Referenced by DrawTile_Clear(), DrawTile_Object(), DrawTile_Station(), DrawTile_Trees(), and DrawTile_TunnelBridge().
| void DrawRoughLandTile | ( | const TileInfo * | ti | ) |
Draw a ClearGround::Rough tile.
| ti | The tile to draw. |
Definition at line 70 of file clear_cmd.cpp.
References _landscape_clear_sprites_rough, DrawGroundSprite(), GB(), SLOPE_FLAT, SlopeToSpriteOffset(), SPR_FLAT_ROUGH_LAND, TileInfo::tileh, TileHash(), Coord3D< T >::x, and Coord3D< T >::y.
Referenced by DrawTile_Clear(), and DrawTile_Trees().
|
static |
Tile callback function signature for drawing a tile and its contents to the screen.
| ti | Information about the tile to draw |
Definition at line 133 of file clear_cmd.cpp.
References _clear_land_sprites_farmland, _clear_land_sprites_snow_desert, Desert, DrawBridgeMiddle(), DrawClearLandFence(), DrawClearLandTile(), DrawGroundSprite(), DrawRoughLandTile(), Fields, GetClearDensity(), GetClearGround(), GetFieldType(), GetTropicZone(), Grass, HasGrfMiscBit(), IsSnowTile(), Rocks, Rough, SecondRockyTileSet, SlopeToSpriteOffset(), SPR_FLAT_ROCKY_LAND_1, SPR_FLAT_ROCKY_LAND_2, SPR_OVERLAY_ROCKS_BASE, TileInfo::tile, TileInfo::tileh, TileHash(), Coord3D< T >::x, and Coord3D< T >::y.
| void GenerateClearTile | ( | ) |
Definition at line 344 of file clear_cmd.cpp.
|
static |
Tile callback function signature for obtaining the world Z coordinate of a given point of a tile.
| tile | The queries tile for the Z coordinate. |
| x | World X coordinate in tile "units". |
| y | World Y coordinate in tile "units". |
| ground_vehicle | Whether to get the Z coordinate of the ground vehicle, or the ground. |
Definition at line 183 of file clear_cmd.cpp.
References GetPartialPixelZ(), and GetTilePixelSlope().
Tile callback function signature for obtaining a tile description.
| tile | Tile being queried |
| td | Storage pointer for returned tile description |
Definition at line 386 of file clear_cmd.cpp.
References GetClearDensity(), GetClearGround(), GetTileOwner(), Grass, IsClearGround(), IsSnowTile(), MaxSize, TileDesc::owner, and TileDesc::str.
|
inlinestatic |
Tests if at least one surrounding tile is non-desert.
| tile | tile to check |
Definition at line 246 of file clear_cmd.cpp.
References Desert, End, GetTropicZone(), GetWaterClass(), HasTileWaterClass(), IsValidTile(), Sea, and TileOffsByDiagDir().
|
static |
Tile callback function signature for running periodic tile updates.
| tile | The tile to update. |
Definition at line 286 of file clear_cmd.cpp.
References _settings_game, AddClearCounter(), AddClearDensity(), AmbientSoundEffect(), Arctic, Editor, Fields, GB(), GetClearCounter(), GetClearDensity(), GetClearGround(), GetFieldType(), GetIndustryIndexOfField(), Grass, IsSnowTile(), MakeClear(), MarkTileDirtyByTile(), Rough, SetClearCounter(), SetClearGroundDensity(), SetFieldType(), TileLoopClearAlps(), and Tropic.
|
static |
Convert to or from snowy tiles.
| tile | The tile to consider. |
Definition at line 211 of file clear_cmd.cpp.
References AddClearDensity(), ClearSnow(), GetClearDensity(), GetSnowLine(), GetTileZ(), IsSnowTile(), MakeSnow(), and MarkTileDirtyByTile().
Referenced by TileLoop_Clear().
|
static |
Definition at line 257 of file clear_cmd.cpp.
|
static |
Definition at line 190 of file clear_cmd.cpp.
|
extern |
TileTypeProcs definitions for TileType::Clear tiles.