OpenTTD Source 20260304-master-g1baaa74679
void_cmd.cpp File Reference

Handling of void tiles. More...

#include "stdafx.h"
#include "landscape.h"
#include "command_func.h"
#include "viewport_func.h"
#include "slope_func.h"
#include "water.h"
#include "table/strings.h"
#include "table/sprites.h"
#include "safeguards.h"

Go to the source code of this file.

Functions

static void DrawTile_Void (TileInfo *ti)
 Tile callback function signature for drawing a tile and its contents to the screen.
static int GetSlopePixelZ_Void (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 GetTileDesc_Void (TileIndex tile, TileDesc &td)
 Tile callback function signature for obtaining a tile description.
static void TileLoop_Void (TileIndex tile)
 Tile callback function signature for running periodic tile updates.

Variables

const TileTypeProcs _tile_type_void_procs
 TileTypeProcs definitions for TileType::Void tiles.

Detailed Description

Handling of void tiles.

Definition in file void_cmd.cpp.

Function Documentation

◆ DrawTile_Void()

void DrawTile_Void ( TileInfo * ti)
static

Tile callback function signature for drawing a tile and its contents to the screen.

Parameters
tiInformation about the tile to draw

Definition at line 23 of file void_cmd.cpp.

References _settings_game, DrawGroundSprite(), PALETTE_ALL_BLACK, SlopeToSpriteOffset(), and TileInfo::tileh.

◆ GetSlopePixelZ_Void()

int GetSlopePixelZ_Void ( TileIndex tile,
uint x,
uint y,
bool ground_vehicle )
static

Tile callback function signature for obtaining the world Z coordinate of a given point of a tile.

Parameters
tileThe queries tile for the Z coordinate.
xWorld X coordinate in tile "units".
yWorld Y coordinate in tile "units".
ground_vehicleWhether to get the Z coordinate of the ground vehicle, or the ground.
Returns
World Z coordinate at tile ground (vehicle) level, including slopes and foundations.
See also
GetSlopePixelZ

Definition at line 34 of file void_cmd.cpp.

References GetPartialPixelZ(), and GetTilePixelSlopeOutsideMap().

◆ GetTileDesc_Void()

void GetTileDesc_Void ( TileIndex tile,
TileDesc & td )
static

Tile callback function signature for obtaining a tile description.

Parameters
tileTile being queried
tdStorage pointer for returned tile description
See also
GetTileDesc

Definition at line 44 of file void_cmd.cpp.

References TileDesc::owner, OWNER_NONE, and TileDesc::str.

◆ TileLoop_Void()

void TileLoop_Void ( TileIndex tile)
static

Tile callback function signature for running periodic tile updates.

Parameters
tileThe tile to update.
See also
RunTileLoop

Definition at line 51 of file void_cmd.cpp.

References TileLoop_Water().

Variable Documentation

◆ _tile_type_void_procs

const TileTypeProcs _tile_type_void_procs
extern
Initial value:
= {
.draw_tile_proc = DrawTile_Void,
.get_slope_pixel_z_proc = GetSlopePixelZ_Void,
.clear_tile_proc = [](TileIndex, DoCommandFlags) { return CommandCost(STR_ERROR_OFF_EDGE_OF_MAP); },
.get_tile_desc_proc = GetTileDesc_Void,
.tile_loop_proc = TileLoop_Void,
.terraform_tile_proc = [](TileIndex, DoCommandFlags, int, Slope) { return CommandCost(STR_ERROR_OFF_EDGE_OF_MAP); },
}
Common return value for all commands.
Slope
Enumeration for the slope-type.
Definition slope_type.h:47
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > > TileIndex
The index/ID of a Tile.
Definition tile_type.h:92
static void TileLoop_Void(TileIndex tile)
Tile callback function signature for running periodic tile updates.
Definition void_cmd.cpp:51
static void GetTileDesc_Void(TileIndex tile, TileDesc &td)
Tile callback function signature for obtaining a tile description.
Definition void_cmd.cpp:44
static void DrawTile_Void(TileInfo *ti)
Tile callback function signature for drawing a tile and its contents to the screen.
Definition void_cmd.cpp:23
static int GetSlopePixelZ_Void(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.
Definition void_cmd.cpp:34

TileTypeProcs definitions for TileType::Void tiles.

Definition at line 59 of file landscape.cpp.