# heightmap.h File Reference

Go to the source code of this file.

## Enumerations
enum | { HM_COUNTER_CLOCKWISE, HM_CLOCKWISE }
## Functions
bool | GetHeightmapDimensions (char *filename, uint *x, uint *y)
| Get the dimensions of a heightmap.
void | LoadHeightmap (char *filename)
| Load a heightmap from file and change the map in his current dimensions to a landscape representing the heightmap.
void | FlatEmptyWorld (byte tile_height)
| Make an empty world where all tiles are of height 'tile_height'.

## Detailed Description

Definition in file heightmap.h.

## Enumeration Type Documentation

anonymous enum

Enumerator:

  HM_COUNTER_CLOCKWISE | Rotate the map counter clockwise 45 degrees.
  HM_CLOCKWISE | Rotate the map clockwise 45 degrees.

Definition at line 12 of file heightmap.h.

## Function Documentation

void FlatEmptyWorld | ( | byte | tile_height | ) |

Make an empty world where all tiles are of height 'tile_height'.

Parameters:

  | tile_height | of the desired new empty world

Definition at line 448 of file heightmap.cpp.

References FixSlopes(), MapSizeX(), MapSizeY(), MarkWholeScreenDirty(), SetTileHeight(), and TileXY().

Referenced by _GenerateWorld().

bool GetHeightmapDimensions | ( | char * | filename,
|  | uint * | x,
|  | uint * | y |
| ) |  |  |

Get the dimensions of a heightmap.

Parameters:

  | filename | to query
  | x | dimension x
  | y | dimension y

Returns:
  Returns false if loading of the image failed.

Definition at line 426 of file heightmap.cpp.

References ReadHeightMap().

void LoadHeightmap | ( | char * | filename | ) |

Load a heightmap from file and change the map in his current dimensions to a landscape representing the heightmap.

It converts pixels to height. The brighter, the higher.

Parameters:

  | filename | of the heighmap file to be imported

Definition at line 431 of file heightmap.cpp.

References FixSlopes(), GrayscaleToMapHeights(), MarkWholeScreenDirty(), and ReadHeightMap().