OpenEnroth f32f0c9
|
#include <TileGenerator.h>
Public Member Functions | |
TileGenerator () | |
~TileGenerator () | |
void | fillTable () |
void | ensureTile (std::string_view name) |
Private Member Functions | |
RgbaImage | generateTile (Tileset tileset, TileVariant variant) |
RgbaImageView | loadTile (Tileset tileset, TileVariant variant) |
TileVariant | findSpanningVariant (Directions currentDirections, Directions targetDirections) const |
void | blendTile (RgbaImageView base, RgbaImageView dirt, RgbaImageView layer1, RgbaImage *layer0) const |
Private Attributes | |
std::vector< std::pair< TileVariant, Directions > > | _standardTiles |
std::unordered_map< std::pair< Tileset, TileVariant >, RgbaImage > | _tileByTilesetVariant |
std::unordered_map< std::string, std::pair< Tileset, TileVariant >, TransparentStringHash, TransparentStringEquals > | _tilesetVariantByName |
This class populates the tile table and generates tiles for tile transitions that were missing in MM7 data.
Actual terrain patching to use the new tiles is done in OutdoorTerrain::recalculateTransitions
.
TileGenerator::TileGenerator | ( | ) |
|
default |
|
private |
void TileGenerator::ensureTile | ( | std::string_view | name | ) |
name | Name of the tile to generate if it doesn't exist yet. Name must come from what was generated by a call to fillTable . |
void TileGenerator::fillTable | ( | ) |
Fills the tile table with the new tiles. Be sure to call ensureTile
for each of the tiles you'll actually use.
|
private |
|
private |
|
private |
|
private |
All standard transition tiles & their directions.
|
private |
Cached images for standard transition tiles. We can't use images from AssetsManager
because they are desaturation-adjusted.
|
private |
Name to tileset-variant mapping. Used for figuring out at runtime which tile is requested w/o having to parse the name.