Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/Terrain.h
/* Copyright (C) 2011 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | public: | ||||
// get the precise slope of a point, accounting for triangulation direction | // get the precise slope of a point, accounting for triangulation direction | ||||
fixed GetExactSlopeFixed(fixed x, fixed z) const; | fixed GetExactSlopeFixed(fixed x, fixed z) const; | ||||
// Returns true if the triangulation diagonal for tile (i, j) | // Returns true if the triangulation diagonal for tile (i, j) | ||||
// should be in the direction (1,-1); false if it should be (1,1) | // should be in the direction (1,-1); false if it should be (1,1) | ||||
bool GetTriangulationDir(ssize_t i, ssize_t j) const; | bool GetTriangulationDir(ssize_t i, ssize_t j) const; | ||||
// resize this terrain such that each side has given number of patches | // Resize this terrain such that each side has given number of patches, | ||||
void Resize(ssize_t size); | // with the center offset in patches from the larger of the two sizes. | ||||
void ResizeRecenter(ssize_t size, int horizontalOffset = 0, int verticalOffset = 0); | |||||
vladislavbelov: Different arguments types in definition and implementation. I think we need to use `ssize_t`… | |||||
Done Inline ActionsI think I tried that, and it failed, so I reverted to int. Stan: I think I tried that, and it failed, so I reverted to int. | |||||
// set up a new heightmap from 16 bit data; assumes heightmap matches current terrain size | // set up a new heightmap from 16 bit data; assumes heightmap matches current terrain size | ||||
void SetHeightMap(u16* heightmap); | void SetHeightMap(u16* heightmap); | ||||
// return a pointer to the heightmap | // return a pointer to the heightmap | ||||
u16* GetHeightMap() const { return m_Heightmap; } | u16* GetHeightMap() const { return m_Heightmap; } | ||||
// get patch at given coordinates, expressed in patch-space; return 0 if | // get patch at given coordinates, expressed in patch-space; return 0 if | ||||
// coordinates represent patch off the edge of the map | // coordinates represent patch off the edge of the map | ||||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Different arguments types in definition and implementation. I think we need to use ssize_t, since we do most calculations using ssize_t.