OpenTTD Source
12.0-beta2
|
Represents a tile area containing containing individually set tiles. More...
#include <bitmap_type.h>
Public Member Functions | |
BitmapTileArea (const TileArea &ta) | |
void | Reset () |
Reset and clear the BitmapTileArea. | |
void | Initialize (const Rect &r) |
Initialize the BitmapTileArea with the specified Rect. More... | |
void | Initialize (const TileArea &ta) |
void | SetTile (TileIndex tile) |
Add a tile as part of the tile area. More... | |
void | ClrTile (TileIndex tile) |
Clear a tile from the tile area. More... | |
bool | HasTile (TileIndex tile) const |
Test if a tile is part of the tile area. More... | |
![]() | |
OrthogonalTileArea (TileIndex tile=INVALID_TILE, uint8 w=0, uint8 h=0) | |
Construct this tile area with some set values. More... | |
OrthogonalTileArea (TileIndex start, TileIndex end) | |
Construct this tile area based on two points. More... | |
void | Add (TileIndex to_add) |
Add a single tile to a tile area; enlarge if needed. More... | |
void | Clear () |
Clears the 'tile area', i.e. More... | |
bool | Intersects (const OrthogonalTileArea &ta) const |
Does this tile area intersect with another? More... | |
bool | Contains (TileIndex tile) const |
Does this tile area contain a tile? More... | |
OrthogonalTileArea & | Expand (int rad) |
Expand a tile area by rad tiles in each direction, keeping within map bounds. More... | |
void | ClampToMap () |
Clamp the tile area to map borders. | |
TileIndex | GetCenterTile () const |
Get the center tile. More... | |
OrthogonalTileIterator | begin () const |
Returns an iterator to the beginning of the tile area. More... | |
OrthogonalTileIterator | end () const |
Returns an iterator to the end of the tile area. More... | |
Protected Member Functions | |
uint | Index (uint x, uint y) const |
uint | Index (TileIndex tile) const |
Protected Attributes | |
std::vector< bool > | data |
Additional Inherited Members | |
![]() | |
TileIndex | tile |
The base tile of the area. | |
uint16 | w |
The width of the area. | |
uint16 | h |
The height of the area. | |
Represents a tile area containing containing individually set tiles.
Each tile must be contained within the preallocated area. A std::vector<bool> is used to mark which tiles are contained.
Definition at line 19 of file bitmap_type.h.
|
inline |
Clear a tile from the tile area.
tile | Tile to clear |
Definition at line 90 of file bitmap_type.h.
References OrthogonalTileArea::Contains(), and OrthogonalTileArea::tile.
|
inline |
Test if a tile is part of the tile area.
tile | Tile to check |
Definition at line 100 of file bitmap_type.h.
References OrthogonalTileArea::Contains(), and OrthogonalTileArea::tile.
Referenced by BitmapTileIterator::BitmapTileIterator(), and BitmapTileIterator::operator++().
|
inline |
Initialize the BitmapTileArea with the specified Rect.
rect | Rect to use. |
Definition at line 58 of file bitmap_type.h.
References OrthogonalTileArea::h, TileXY(), and OrthogonalTileArea::w.
Referenced by Station::RecomputeCatchment().
|
inline |
Add a tile as part of the tile area.
tile | Tile to add. |
Definition at line 80 of file bitmap_type.h.
References OrthogonalTileArea::Contains(), and OrthogonalTileArea::tile.
Referenced by Station::RecomputeCatchment().