mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Make the style of MakeVoid calls uniform (#7192)
parent
5e4f76f2f9
commit
37bb2c9308
|
@ -120,8 +120,8 @@ static void _GenerateWorld(void *)
|
||||||
|
|
||||||
/* Make sure the tiles at the north border are void tiles if needed. */
|
/* Make sure the tiles at the north border are void tiles if needed. */
|
||||||
if (_settings_game.construction.freeform_edges) {
|
if (_settings_game.construction.freeform_edges) {
|
||||||
for (uint row = 0; row < MapSizeY(); row++) MakeVoid(TileXY(0, row));
|
for (uint x = 0; x < MapSizeX(); x++) MakeVoid(TileXY(x, 0));
|
||||||
for (uint col = 0; col < MapSizeX(); col++) MakeVoid(TileXY(col, 0));
|
for (uint y = 0; y < MapSizeY(); y++) MakeVoid(TileXY(0, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make the map the height of the setting */
|
/* Make the map the height of the setting */
|
||||||
|
|
|
@ -841,22 +841,17 @@ void RunTileLoop()
|
||||||
|
|
||||||
void InitializeLandscape()
|
void InitializeLandscape()
|
||||||
{
|
{
|
||||||
uint maxx = MapMaxX();
|
for (uint y = _settings_game.construction.freeform_edges ? 1 : 0; y < MapMaxY(); y++) {
|
||||||
uint maxy = MapMaxY();
|
for (uint x = _settings_game.construction.freeform_edges ? 1 : 0; x < MapMaxX(); x++) {
|
||||||
uint sizex = MapSizeX();
|
MakeClear(TileXY(x, y), CLEAR_GRASS, 3);
|
||||||
|
SetTileHeight(TileXY(x, y), 0);
|
||||||
uint y;
|
SetTropicZone(TileXY(x, y), TROPICZONE_NORMAL);
|
||||||
for (y = _settings_game.construction.freeform_edges ? 1 : 0; y < maxy; y++) {
|
ClearBridgeMiddle(TileXY(x, y));
|
||||||
uint x;
|
|
||||||
for (x = _settings_game.construction.freeform_edges ? 1 : 0; x < maxx; x++) {
|
|
||||||
MakeClear(sizex * y + x, CLEAR_GRASS, 3);
|
|
||||||
SetTileHeight(sizex * y + x, 0);
|
|
||||||
SetTropicZone(sizex * y + x, TROPICZONE_NORMAL);
|
|
||||||
ClearBridgeMiddle(sizex * y + x);
|
|
||||||
}
|
}
|
||||||
MakeVoid(sizex * y + x);
|
|
||||||
}
|
}
|
||||||
for (uint x = 0; x < sizex; x++) MakeVoid(sizex * y + x);
|
|
||||||
|
for (uint x = 0; x < MapSizeX(); x++) MakeVoid(TileXY(x, MapMaxY()));
|
||||||
|
for (uint y = 0; y < MapSizeY(); y++) MakeVoid(TileXY(MapMaxX(), y));
|
||||||
}
|
}
|
||||||
|
|
||||||
static const byte _genterrain_tbl_1[5] = { 10, 22, 33, 37, 4 };
|
static const byte _genterrain_tbl_1[5] = { 10, 22, 33, 37, 4 };
|
||||||
|
|
|
@ -204,10 +204,8 @@ static void UpdateCurrencies()
|
||||||
*/
|
*/
|
||||||
static void UpdateVoidTiles()
|
static void UpdateVoidTiles()
|
||||||
{
|
{
|
||||||
uint i;
|
for (uint x = 0; x < MapSizeX(); x++) MakeVoid(TileXY(x, MapMaxY()));
|
||||||
|
for (uint y = 0; y < MapSizeY(); y++) MakeVoid(TileXY(MapMaxX(), y));
|
||||||
for (i = 0; i < MapMaxY(); ++i) MakeVoid(i * MapSizeX() + MapMaxX());
|
|
||||||
for (i = 0; i < MapSizeX(); ++i) MakeVoid(MapSizeX() * MapMaxY() + i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline RailType UpdateRailType(RailType rt, RailType min)
|
static inline RailType UpdateRailType(RailType rt, RailType min)
|
||||||
|
|
|
@ -1222,8 +1222,8 @@ static bool CheckFreeformEdges(int32 p1)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (uint i = 0; i < MapSizeX(); i++) MakeVoid(TileXY(i, 0));
|
for (uint x = 0; x < MapSizeX(); x++) MakeVoid(TileXY(x, 0));
|
||||||
for (uint i = 0; i < MapSizeY(); i++) MakeVoid(TileXY(0, i));
|
for (uint y = 0; y < MapSizeY(); y++) MakeVoid(TileXY(0, y));
|
||||||
} else {
|
} else {
|
||||||
for (uint i = 0; i < MapMaxX(); i++) {
|
for (uint i = 0; i < MapMaxX(); i++) {
|
||||||
if (TileHeight(TileXY(i, 1)) != 0) {
|
if (TileHeight(TileXY(i, 1)) != 0) {
|
||||||
|
|
|
@ -995,8 +995,8 @@ void GenerateTerrainPerlin()
|
||||||
|
|
||||||
/* First make sure the tiles at the north border are void tiles if needed. */
|
/* First make sure the tiles at the north border are void tiles if needed. */
|
||||||
if (_settings_game.construction.freeform_edges) {
|
if (_settings_game.construction.freeform_edges) {
|
||||||
for (int y = 0; y < _height_map.size_y - 1; y++) MakeVoid(_height_map.size_x * y);
|
for (uint x = 0; x < MapSizeX(); x++) MakeVoid(TileXY(x, 0));
|
||||||
for (int x = 0; x < _height_map.size_x; x++) MakeVoid(x);
|
for (uint y = 0; y < MapSizeY(); y++) MakeVoid(TileXY(0, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
int max_height = H2I(TGPGetMaxHeight());
|
int max_height = H2I(TGPGetMaxHeight());
|
||||||
|
|
Loading…
Reference in New Issue