OpenTTD Source: src/heightmap.h Source File

OpenTTD Source 15.0-RC2

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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef HEIGHTMAP_H
11#define HEIGHTMAP_H
12
13#include "fileio_type.h"
14
19 enum HeightmapRotation : uint8_t {
20 HM_COUNTER_CLOCKWISE,
21 HM_CLOCKWISE,
22};
23
24bool GetHeightmapDimensions(DetailedFileType dft, std::string_view filename, uint *x, uint *y);
25bool LoadHeightmap(DetailedFileType dft, std::string_view filename);
26void FlatEmptyWorld(uint8_t tile_height);
27void FixSlopes();
28
29#endif /* HEIGHTMAP_H */
fileio_type.h
Types for Standard In/Out file operations.
DetailedFileType
DetailedFileType
Kinds of files in each AbstractFileType.
Definition fileio_type.h:28
GetHeightmapDimensions
bool GetHeightmapDimensions(DetailedFileType dft, std::string_view filename, uint *x, uint *y)
Get the dimensions of a heightmap.
Definition heightmap.cpp:505
FlatEmptyWorld
void FlatEmptyWorld(uint8_t tile_height)
Make an empty world where all tiles are of height 'tile_height'.
Definition heightmap.cpp:542
HeightmapRotation
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
@ HM_CLOCKWISE
Rotate the map clockwise 45 degrees.
Definition heightmap.h:21
HM_COUNTER_CLOCKWISE
@ HM_COUNTER_CLOCKWISE
Rotate the map counter clockwise 45 degrees.
Definition heightmap.h:20
LoadHeightmap
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...
Definition heightmap.cpp:517
FixSlopes
void FixSlopes()
This function takes care of the fact that land in OpenTTD can never differ more than 1 in height.
Definition heightmap.cpp:403