OpenTTD Source 20241224-master-gf74b0cf984
heightmap.h
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 <http://www.gnu.org/licenses/>.
6 */
7
10#ifndef HEIGHTMAP_H
11#define HEIGHTMAP_H
12
13#include "fileio_type.h"
14
23
24bool GetHeightmapDimensions(DetailedFileType dft, const char *filename, uint *x, uint *y);
25bool LoadHeightmap(DetailedFileType dft, const char *filename);
26void FlatEmptyWorld(uint8_t tile_height);
27void FixSlopes();
28
29#endif /* HEIGHTMAP_H */
Types for Standard In/Out file operations.
DetailedFileType
Kinds of files in each AbstractFileType.
Definition fileio_type.h:29
bool LoadHeightmap(DetailedFileType dft, const char *filename)
Load a heightmap from file and change the map in its current dimensions to a landscape representing t...
HeightmapRotation
Order of these enums has to be the same as in lang/english.txt Otherwise you will get inconsistent be...
Definition heightmap.h:19
@ 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 GetHeightmapDimensions(DetailedFileType dft, const char *filename, uint *x, uint *y)
Get the dimensions of a heightmap.
void FlatEmptyWorld(uint8_t tile_height)
Make an empty world where all tiles are of height 'tile_height'.
void FixSlopes()
This function takes care of the fact that land in OpenTTD can never differ more than 1 in height.