OpenTTD Source
1.11.0-beta2
|
10 #ifndef BITMAP_TYPE_HPP
11 #define BITMAP_TYPE_HPP
21 std::vector<bool> data;
23 inline uint Index(uint x, uint y)
const {
return y * this->
w + x; }
40 this->data.resize(Index(this->
w, this->
h));
60 this->tile =
TileXY(r.left, r.top);
61 this->
w = r.right - r.left + 1;
62 this->
h = r.bottom - r.top + 1;
64 this->data.resize(Index(
w,
h));
73 this->data.resize(Index(
w,
h));
83 this->data[Index(
tile)] =
true;
93 this->data[Index(
tile)] =
false;
122 (*this).OrthogonalTileIterator::operator++();
124 (*this).OrthogonalTileIterator::operator++();
uint32 TileIndex
The index/ID of a Tile.
void Initialize(const Rect &r)
Initialize the BitmapTileArea with the specified Rect.
TileIterator & operator++()
Move ourselves to the next tile in the rectangle on the map.
void SetTile(TileIndex tile)
Add a tile as part of the tile area.
Iterator to iterate over all tiles belonging to a bitmaptilearea.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
static uint TileX(TileIndex tile)
Get the X component of a tile.
Iterator to iterate over a tile area (rectangle) of the map.
Represents a tile area containing containing individually set tiles.
Base class for tile iterators.
void Reset()
Reset and clear the BitmapTileArea.
uint16 w
The width of the area.
Represents the covered area of e.g.
bool HasTile(TileIndex tile) const
Test if a tile is part of the tile area.
virtual TileIterator * Clone() const
Allocate a new iterator that is a copy of this one.
void ClrTile(TileIndex tile)
Clear a tile from the tile area.
uint16 h
The height of the area.
static TileIndex TileXY(uint x, uint y)
Returns the TileIndex of a coordinate.
TileIndex tile
The base tile of the area.
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
BitmapTileIterator(const BitmapTileArea &bitmap)
Construct the iterator.
Specification of a rectangle with absolute coordinates of all edges.
bool Contains(TileIndex tile) const
Does this tile area contain a tile?