OpenTTD Source 20261112-master-gbcbec5e63f
heightmap.cpp
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
9
10#include "stdafx.h"
11#include "core/random_func.hpp"
12#include "heightmap.h"
13#include "landscape.h"
14#include "clear_map.h"
15#include "strings_func.h"
16#include "void_map.h"
17#include "error.h"
18#include "bmp.h"
19#include "gfx_func.h"
20#include "fileio_func.h"
21
22#include "table/strings.h"
23
24#ifdef WITH_PNG
25#include <png.h>
26#endif /* WITH_PNG */
27
28#include "safeguards.h"
29
36
40static const uint MAX_HEIGHTMAP_SIZE_PIXELS = 256 << 20; // ~256 million
41/*
42 * When loading a PNG or BMP the 24 bpp variant requires at least 4 bytes per pixel
43 * of memory to load the data. Make sure the "reasonable" limit is well within the
44 * maximum amount of memory allocatable on 32 bit platforms.
45 */
46static_assert(MAX_HEIGHTMAP_SIZE_PIXELS < UINT32_MAX / 8);
47
57static inline bool IsValidHeightmapDimension(size_t width, size_t height)
58{
59 return (uint64_t)width * height <= MAX_HEIGHTMAP_SIZE_PIXELS &&
60 width > 0 && width <= MAX_HEIGHTMAP_SIDE_LENGTH_IN_PIXELS &&
61 height > 0 && height <= MAX_HEIGHTMAP_SIDE_LENGTH_IN_PIXELS;
62}
63
72static inline uint8_t RGBToGreyscale(uint8_t red, uint8_t green, uint8_t blue)
73{
74 /* To avoid doubles and stuff, multiply it with a total of 65536 (16bits), then
75 * divide by it to normalize the value to a byte again. */
76 return ((red * 19595) + (green * 38470) + (blue * 7471)) / 65536;
77}
78
79
80#ifdef WITH_PNG
81
88static void ReadHeightmapPNGImageData(std::span<uint8_t> map, png_structp png_ptr, png_infop info_ptr)
89{
90 uint x, y;
91 uint8_t gray_palette[256];
92 png_bytep *row_pointers = nullptr;
93 bool has_palette = png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE;
94 uint channels = png_get_channels(png_ptr, info_ptr);
95
96 /* Get palette and convert it to greyscale */
97 if (has_palette) {
98 int i;
99 int palette_size;
100 png_color *palette;
101 bool all_gray = true;
102
103 png_get_PLTE(png_ptr, info_ptr, &palette, &palette_size);
104 for (i = 0; i < palette_size && (palette_size != 16 || all_gray); i++) {
105 all_gray &= palette[i].red == palette[i].green && palette[i].red == palette[i].blue;
106 gray_palette[i] = RGBToGreyscale(palette[i].red, palette[i].green, palette[i].blue);
107 }
108
115 if (palette_size == 16 && !all_gray) {
116 for (i = 0; i < palette_size; i++) {
117 gray_palette[i] = 256 * i / palette_size;
118 }
119 }
120 }
121
122 row_pointers = png_get_rows(png_ptr, info_ptr);
123
124 /* Read the raw image data and convert in 8-bit greyscale */
125 for (x = 0; x < png_get_image_width(png_ptr, info_ptr); x++) {
126 for (y = 0; y < png_get_image_height(png_ptr, info_ptr); y++) {
127 uint8_t *pixel = &map[y * png_get_image_width(png_ptr, info_ptr) + x];
128 uint x_offset = x * channels;
129
130 if (has_palette) {
131 *pixel = gray_palette[row_pointers[y][x_offset]];
132 } else if (channels == 3) {
133 *pixel = RGBToGreyscale(row_pointers[y][x_offset + 0],
134 row_pointers[y][x_offset + 1], row_pointers[y][x_offset + 2]);
135 } else {
136 *pixel = row_pointers[y][x_offset];
137 }
138 }
139 }
140}
141
152static bool ReadHeightmapPNG(std::string_view filename, uint *x, uint *y, std::vector<uint8_t> *map)
153{
154 png_structp png_ptr = nullptr;
155 png_infop info_ptr = nullptr;
156
157 auto fp = FioFOpenFile(filename, "rb", Subdirectory::Heightmap);
158 if (!fp.has_value()) {
159 ShowErrorMessage(GetEncodedString(STR_ERROR_PNGMAP), GetEncodedString(STR_ERROR_PNGMAP_FILE_NOT_FOUND), WarningLevel::Error);
160 return false;
161 }
162
163 png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
164 if (png_ptr == nullptr) {
165 ShowErrorMessage(GetEncodedString(STR_ERROR_PNGMAP), GetEncodedString(STR_ERROR_PNGMAP_MISC), WarningLevel::Error);
166 return false;
167 }
168
169 info_ptr = png_create_info_struct(png_ptr);
170 if (info_ptr == nullptr || setjmp(png_jmpbuf(png_ptr))) {
171 ShowErrorMessage(GetEncodedString(STR_ERROR_PNGMAP), GetEncodedString(STR_ERROR_PNGMAP_MISC), WarningLevel::Error);
172 png_destroy_read_struct(&png_ptr, &info_ptr, nullptr);
173 return false;
174 }
175
176 png_init_io(png_ptr, *fp);
177
178 /* Allocate memory and read image, without alpha or 16-bit samples
179 * (result is either 8-bit indexed/greyscale or 24-bit RGB) */
180 png_set_packing(png_ptr);
181 png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_PACKING | PNG_TRANSFORM_STRIP_ALPHA | PNG_TRANSFORM_STRIP_16, nullptr);
182
183 /* Maps of wrong colour-depth are not used.
184 * (this should have been taken care of by stripping alpha and 16-bit samples on load) */
185 if ((png_get_channels(png_ptr, info_ptr) != 1) && (png_get_channels(png_ptr, info_ptr) != 3) && (png_get_bit_depth(png_ptr, info_ptr) != 8)) {
186 ShowErrorMessage(GetEncodedString(STR_ERROR_PNGMAP), GetEncodedString(STR_ERROR_PNGMAP_IMAGE_TYPE), WarningLevel::Error);
187 png_destroy_read_struct(&png_ptr, &info_ptr, nullptr);
188 return false;
189 }
190
191 uint width = png_get_image_width(png_ptr, info_ptr);
192 uint height = png_get_image_height(png_ptr, info_ptr);
193
194 if (!IsValidHeightmapDimension(width, height)) {
195 ShowErrorMessage(GetEncodedString(STR_ERROR_PNGMAP), GetEncodedString(STR_ERROR_HEIGHTMAP_TOO_LARGE), WarningLevel::Error);
196 png_destroy_read_struct(&png_ptr, &info_ptr, nullptr);
197 return false;
198 }
199
200 if (map != nullptr) {
201 map->resize(static_cast<size_t>(width) * height);
202 ReadHeightmapPNGImageData(*map, png_ptr, info_ptr);
203 }
204
205 *x = width;
206 *y = height;
207
208 png_destroy_read_struct(&png_ptr, &info_ptr, nullptr);
209 return true;
210}
211
212#endif /* WITH_PNG */
213
214
221static void ReadHeightmapBMPImageData(std::span<uint8_t> map, const BmpInfo &info, const BmpData &data)
222{
223 uint8_t gray_palette[256];
224
225 if (!data.palette.empty()) {
226 bool all_gray = true;
227
228 if (info.palette_size != 2) {
229 for (uint i = 0; i < info.palette_size && (info.palette_size != 16 || all_gray); i++) {
230 all_gray &= data.palette[i].r == data.palette[i].g && data.palette[i].r == data.palette[i].b;
231 gray_palette[i] = RGBToGreyscale(data.palette[i].r, data.palette[i].g, data.palette[i].b);
232 }
233
240 if (info.palette_size == 16 && !all_gray) {
241 for (uint i = 0; i < info.palette_size; i++) {
242 gray_palette[i] = 256 * i / info.palette_size;
243 }
244 }
245 } else {
250 gray_palette[0] = 0;
251 gray_palette[1] = 16;
252 }
253 }
254
255 /* Read the raw image data and convert in 8-bit greyscale */
256 for (uint y = 0; y < info.height; y++) {
257 uint8_t *pixel = &map[y * static_cast<size_t>(info.width)];
258 const uint8_t *bitmap = &data.bitmap[y * static_cast<size_t>(info.width) * (info.bpp == 24 ? 3 : 1)];
259
260 for (uint x = 0; x < info.width; x++) {
261 if (info.bpp != 24) {
262 *pixel++ = gray_palette[*bitmap++];
263 } else {
264 *pixel++ = RGBToGreyscale(*bitmap, *(bitmap + 1), *(bitmap + 2));
265 bitmap += 3;
266 }
267 }
268 }
269}
270
281static bool ReadHeightmapBMP(std::string_view filename, uint *x, uint *y, std::vector<uint8_t> *map)
282{
283 auto f = FioFOpenFile(filename, "rb", Subdirectory::Heightmap);
284 if (!f.has_value()) {
285 ShowErrorMessage(GetEncodedString(STR_ERROR_BMPMAP), GetEncodedString(STR_ERROR_PNGMAP_FILE_NOT_FOUND), WarningLevel::Error);
286 return false;
287 }
288
290 BmpInfo info{};
291 BmpData data{};
292
293 if (!BmpReadHeader(file, info, data)) {
294 ShowErrorMessage(GetEncodedString(STR_ERROR_BMPMAP), GetEncodedString(STR_ERROR_BMPMAP_IMAGE_TYPE), WarningLevel::Error);
295 return false;
296 }
297
298 if (!IsValidHeightmapDimension(info.width, info.height)) {
299 ShowErrorMessage(GetEncodedString(STR_ERROR_BMPMAP), GetEncodedString(STR_ERROR_HEIGHTMAP_TOO_LARGE), WarningLevel::Error);
300 return false;
301 }
302
303 if (map != nullptr) {
304 if (!BmpReadBitmap(file, info, data)) {
305 ShowErrorMessage(GetEncodedString(STR_ERROR_BMPMAP), GetEncodedString(STR_ERROR_BMPMAP_IMAGE_TYPE), WarningLevel::Error);
306 return false;
307 }
308
309 map->resize(static_cast<size_t>(info.width) * info.height);
310 ReadHeightmapBMPImageData(*map, info, data);
311 }
312
313 *x = info.width;
314 *y = info.height;
315
316 return true;
317}
318
326static void GreyscaleToMapHeights(uint img_width, uint img_height, std::span<const uint8_t> map)
327{
328 /* Defines the detail of the aspect ratio (to avoid doubles) */
329 const uint num_div = 16384;
330 /* Ensure multiplication with num_div does not cause overflows. */
331 static_assert(num_div <= std::numeric_limits<uint>::max() / MAX_HEIGHTMAP_SIDE_LENGTH_IN_PIXELS);
332
333 uint width, height;
334 uint row, col;
335 uint row_pad = 0, col_pad = 0;
336 uint img_scale;
337 uint img_row, img_col;
338 TileIndex tile;
339
340 /* Get map size and calculate scale and padding values */
341 switch (_settings_game.game_creation.heightmap_rotation) {
342 default: NOT_REACHED();
344 width = Map::SizeX();
345 height = Map::SizeY();
346 break;
347 case HM_CLOCKWISE:
348 width = Map::SizeY();
349 height = Map::SizeX();
350 break;
351 }
352
353 if ((img_width * num_div) / img_height > ((width * num_div) / height)) {
354 /* Image is wider than map - center vertically */
355 img_scale = (width * num_div) / img_width;
356 row_pad = (1 + height - ((img_height * img_scale) / num_div)) / 2;
357 } else {
358 /* Image is taller than map - center horizontally */
359 img_scale = (height * num_div) / img_height;
360 col_pad = (1 + width - ((img_width * img_scale) / num_div)) / 2;
361 }
362
363 if (_settings_game.construction.freeform_edges) {
364 for (uint x = 0; x < Map::SizeX(); x++) MakeVoid(TileXY(x, 0));
365 for (uint y = 0; y < Map::SizeY(); y++) MakeVoid(TileXY(0, y));
366 }
367
368 /* Form the landscape */
369 for (row = 0; row < height; row++) {
370 for (col = 0; col < width; col++) {
371 switch (_settings_game.game_creation.heightmap_rotation) {
372 default: NOT_REACHED();
373 case HM_COUNTER_CLOCKWISE: tile = TileXY(col, row); break;
374 case HM_CLOCKWISE: tile = TileXY(row, col); break;
375 }
376
377 /* Check if current tile is within the 1-pixel map edge or padding regions */
378 if ((!_settings_game.construction.freeform_edges && DistanceFromEdge(tile) <= 1) ||
379 (row < row_pad) || (row >= (height - row_pad - (_settings_game.construction.freeform_edges ? 0 : 1))) ||
380 (col < col_pad) || (col >= (width - col_pad - (_settings_game.construction.freeform_edges ? 0 : 1)))) {
381 SetTileHeight(tile, 0);
382 } else {
383 /* Use nearest neighbour resizing to scale map data.
384 * We rotate the map 45 degrees (counter)clockwise */
385 img_row = (((row - row_pad) * num_div) / img_scale);
386 switch (_settings_game.game_creation.heightmap_rotation) {
387 default: NOT_REACHED();
389 img_col = (((width - 1 - col - col_pad) * num_div) / img_scale);
390 break;
391 case HM_CLOCKWISE:
392 img_col = (((col - col_pad) * num_div) / img_scale);
393 break;
394 }
395
396 assert(img_row < img_height);
397 assert(img_col < img_width);
398
399 uint heightmap_height = map[img_row * img_width + img_col];
400
401 if (heightmap_height > 0) {
402 /* 0 is sea level.
403 * Other grey scales are scaled evenly to the available height levels > 0.
404 * (The coastline is independent from the number of height levels) */
405 heightmap_height = 1 + (heightmap_height - 1) * _settings_game.game_creation.heightmap_height / 255;
406 }
407
408 SetTileHeight(tile, heightmap_height);
409 }
410 /* Only clear the tiles within the map area. */
411 if (IsInnerTile(tile)) {
413 }
414 }
415 }
416}
417
423{
424 uint width, height;
425 int row, col;
426 uint8_t current_height;
427 uint8_t max_height = _settings_game.construction.map_height_limit;
428
429 /* Adjust height difference to maximum one horizontal/vertical change. */
430 width = Map::SizeX();
431 height = Map::SizeY();
432
433 /* Top and left edge */
434 for (row = 0; (uint)row < height; row++) {
435 for (col = 0; (uint)col < width; col++) {
436 current_height = MAX_TILE_HEIGHT;
437 if (col != 0) {
438 /* Find lowest tile; either the top or left one */
439 current_height = TileHeight(TileXY(col - 1, row)); // top edge
440 }
441 if (row != 0) {
442 if (TileHeight(TileXY(col, row - 1)) < current_height) {
443 current_height = TileHeight(TileXY(col, row - 1)); // left edge
444 }
445 }
446
447 /* Does the height differ more than one? */
448 TileIndex tile = TileXY(col, row);
449 if (TileHeight(tile) >= (uint)current_height + 2) {
450 /* Then change the height to be no more than one */
451 SetTileHeight(tile, current_height + 1);
452 /* Height was changed so now there's a chance, more likely at higher altitude, of the
453 * tile turning into rock. */
454 if (IsInnerTile(tile) && RandomRange(max_height) <= current_height) {
456 }
457 }
458 }
459 }
460
461 /* Bottom and right edge */
462 for (row = height - 1; row >= 0; row--) {
463 for (col = width - 1; col >= 0; col--) {
464 current_height = MAX_TILE_HEIGHT;
465 if ((uint)col != width - 1) {
466 /* Find lowest tile; either the bottom and right one */
467 current_height = TileHeight(TileXY(col + 1, row)); // bottom edge
468 }
469
470 if ((uint)row != height - 1) {
471 if (TileHeight(TileXY(col, row + 1)) < current_height) {
472 current_height = TileHeight(TileXY(col, row + 1)); // right edge
473 }
474 }
475
476 /* Does the height differ more than one? */
477 TileIndex tile = TileXY(col, row);
478 if (TileHeight(tile) >= (uint)current_height + 2) {
479 /* Then change the height to be no more than one */
480 SetTileHeight(tile, current_height + 1);
481 /* Height was changed so now there's a chance, more likely at higher altitude, of the
482 * tile turning into rock. */
483 if (IsInnerTile(tile) && RandomRange(max_height) <= current_height) {
485 }
486 }
487 }
488 }
489}
490
500static bool ReadHeightMap(DetailedFileType dft, std::string_view filename, uint *x, uint *y, std::vector<uint8_t> *map)
501{
502 switch (dft) {
503 default:
504 NOT_REACHED();
505
506#ifdef WITH_PNG
508 return ReadHeightmapPNG(filename, x, y, map);
509#endif /* WITH_PNG */
510
512 return ReadHeightmapBMP(filename, x, y, map);
513 }
514}
515
524bool GetHeightmapDimensions(DetailedFileType dft, std::string_view filename, uint *x, uint *y)
525{
526 return ReadHeightMap(dft, filename, x, y, nullptr);
527}
528
537bool LoadHeightmap(DetailedFileType dft, std::string_view filename)
538{
539 uint x, y;
540 std::vector<uint8_t> map;
541
542 if (!ReadHeightMap(dft, filename, &x, &y, &map)) {
543 return false;
544 }
545
546 GreyscaleToMapHeights(x, y, map);
547
548 FixSlopes();
549
550 /* If all map borders are water, we will draw infinite water. */
551 _settings_game.construction.freeform_edges = !IsMapSurroundedByWater();
552
554
555 return true;
556}
557
562void FlatEmptyWorld(uint8_t tile_height)
563{
564 int edge_distance = _settings_game.construction.freeform_edges ? 0 : 2;
565 for (uint row = edge_distance; row < Map::SizeY() - edge_distance; row++) {
566 for (uint col = edge_distance; col < Map::SizeX() - edge_distance; col++) {
567 SetTileHeight(TileXY(col, row), tile_height);
568 }
569 }
570
571 FixSlopes();
573}
bool BmpReadBitmap(RandomAccessFile &file, BmpInfo &info, BmpData &data)
Reads the bitmap 1 bpp and 4 bpp bitmaps are converted to 8 bpp bitmaps.
Definition bmp.cpp:313
bool BmpReadHeader(RandomAccessFile &file, BmpInfo &info, BmpData &data)
Reads bitmap headers, and palette (if any).
Definition bmp.cpp:236
Read and write support for bmps.
A file from which bytes, words and double words are read in (potentially) a random order.
Map accessors for 'clear' tiles.
@ Rocks
Rocks with snow transition (0-3).
Definition clear_map.h:24
@ Grass
Plain grass with dirt transition (0-3).
Definition clear_map.h:22
void MakeClear(Tile t, ClearGround g, uint density)
Make a clear tile.
Definition clear_map.h:253
Functions related to errors.
@ Error
Errors (eg. saving/loading failed).
Definition error.h:24
void ShowErrorMessage(EncodedString &&summary_msg, int x, int y, CommandCost &cc)
Display an error message in a window.
std::optional< FileHandle > FioFOpenFile(std::string_view filename, std::string_view mode, Subdirectory subdir, size_t *filesize)
Opens a OpenTTD file somewhere in a personal or global directory.
Definition fileio.cpp:248
Functions for standard in/out file operations.
DetailedFileType
Kinds of files in each AbstractFileType.
Definition fileio_type.h:27
@ HeightmapPng
PNG file.
Definition fileio_type.h:34
@ HeightmapBmp
BMP file.
Definition fileio_type.h:33
@ Heightmap
Subdirectory of scenario for heightmaps.
Definition fileio_type.h:92
Functions related to the gfx engine.
void MarkWholeScreenDirty()
This function mark the whole screen as dirty.
Definition gfx.cpp:1548
static const uint MAX_HEIGHTMAP_SIDE_LENGTH_IN_PIXELS
Maximum number of pixels for one dimension of a heightmap image.
Definition heightmap.cpp:35
static bool ReadHeightmapBMP(std::string_view filename, uint *x, uint *y, std::vector< uint8_t > *map)
Reads the heightmap and/or size of the heightmap from a BMP file.
bool GetHeightmapDimensions(DetailedFileType dft, std::string_view filename, uint *x, uint *y)
Get the dimensions of a heightmap.
static bool ReadHeightmapPNG(std::string_view filename, uint *x, uint *y, std::vector< uint8_t > *map)
Reads the heightmap and/or size of the heightmap from a PNG file.
void FlatEmptyWorld(uint8_t tile_height)
Make an empty world where all tiles are of height 'tile_height'.
static void GreyscaleToMapHeights(uint img_width, uint img_height, std::span< const uint8_t > map)
Converts a given greyscale map to something that fits in OTTD map system and create a map of that dat...
static const uint MAX_HEIGHTMAP_SIZE_PIXELS
Maximum size in pixels of the heightmap image.
Definition heightmap.cpp:40
static void ReadHeightmapPNGImageData(std::span< uint8_t > map, png_structp png_ptr, png_infop info_ptr)
The PNG Heightmap loader.
Definition heightmap.cpp:88
static bool ReadHeightMap(DetailedFileType dft, std::string_view filename, uint *x, uint *y, std::vector< uint8_t > *map)
Reads the heightmap with the correct file reader.
bool LoadHeightmap(DetailedFileType dft, std::string_view filename)
Load a heightmap from file and change the map in its current dimensions to a landscape representing t...
static uint8_t RGBToGreyscale(uint8_t red, uint8_t green, uint8_t blue)
Convert RGB colours to Greyscale using 29.9% Red, 58.7% Green, 11.4% Blue (average luminosity formula...
Definition heightmap.cpp:72
static bool IsValidHeightmapDimension(size_t width, size_t height)
Check whether the loaded dimension of the heightmap image are considered valid enough to attempt to l...
Definition heightmap.cpp:57
void FixSlopes()
This function takes care of the fact that land in OpenTTD can never differ more than 1 in height.
static void ReadHeightmapBMPImageData(std::span< uint8_t > map, const BmpInfo &info, const BmpData &data)
The BMP Heightmap loader.
Functions related to creating heightmaps from files.
@ HM_CLOCKWISE
Rotate the map clockwise 45 degrees.
Definition heightmap.h:21
@ HM_COUNTER_CLOCKWISE
Rotate the map counter clockwise 45 degrees.
Definition heightmap.h:20
bool IsMapSurroundedByWater()
Check if all tiles on the map edge should be considered water borders.
Functions related to OTTD's landscape.
uint DistanceFromEdge(TileIndex tile)
Param the minimum distance to an edge.
Definition map.cpp:228
static TileIndex TileXY(uint x, uint y)
Returns the TileIndex of a coordinate.
Definition map_func.h:376
static const uint MAX_MAP_SIZE
Maximal map size = 4096.
Definition map_type.h:40
Pseudo random number generator.
uint32_t RandomRange(uint32_t limit, const std::source_location location=std::source_location::current())
Pick a random number between 0 and limit - 1, inclusive.
A number of safeguards to prevent using unsafe methods.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Definition settings.cpp:61
Definition of base types and functions in a cross-platform compatible way.
EncodedString GetEncodedString(StringID str)
Encode a string with no parameters into an encoded string.
Definition strings.cpp:89
Functions related to OTTD's strings.
Definition bmp.h:26
Definition bmp.h:16
uint32_t height
bitmap height
Definition bmp.h:19
uint32_t width
bitmap width
Definition bmp.h:18
uint32_t palette_size
number of colours in palette
Definition bmp.h:23
uint16_t bpp
bits per pixel
Definition bmp.h:21
static uint SizeX()
Get the size of the map along the X.
Definition map_func.h:262
static uint SizeY()
Get the size of the map along the Y.
Definition map_func.h:271
static uint TileHeight(Tile tile)
Returns the height of a tile.
Definition tile_map.h:29
bool IsInnerTile(Tile tile)
Check if a tile is within the map (not a border).
Definition tile_map.h:109
void SetTileHeight(Tile tile, uint height)
Sets the height of a tile.
Definition tile_map.h:57
static constexpr uint MAX_TILE_HEIGHT
Maximum allowed tile height.
Definition tile_type.h:24
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
Map accessors for void tiles.
void MakeVoid(Tile t)
Make a nice void tile ;).
Definition void_map.h:19