Merge branch upstream/master while introducing compile errors and reverting parts of Android changes, video BPP options are gone

This commit is contained in:
Sergii Pylypenko
2021-11-29 02:17:14 +02:00
667 changed files with 66564 additions and 29169 deletions

View File

@@ -8,6 +8,7 @@
/** @file terraform_gui.cpp GUI related to terraforming the map. */
#include "stdafx.h"
#include "core/backup_type.hpp"
#include "clear_map.h"
#include "company_func.h"
#include "company_base.h"
@@ -54,15 +55,15 @@ static void GenerateDesertArea(TileIndex end, TileIndex start)
{
if (_game_mode != GM_EDITOR) return;
_generating_world = true;
Backup<bool> old_generating_world(_generating_world, true, FILE_LINE);
TileArea ta(start, end);
TILE_AREA_LOOP(tile, ta) {
for (TileIndex tile : ta) {
SetTropicZone(tile, (_ctrl_pressed) ? TROPICZONE_NORMAL : TROPICZONE_DESERT);
DoCommandP(tile, 0, 0, CMD_LANDSCAPE_CLEAR);
MarkTileDirtyByTile(tile);
}
_generating_world = false;
old_generating_world.Restore();
InvalidateWindowClassesData(WC_TOWN_VIEW, 0);
}
@@ -74,7 +75,7 @@ static void GenerateRockyArea(TileIndex end, TileIndex start)
bool success = false;
TileArea ta(start, end);
TILE_AREA_LOOP(tile, ta) {
for (TileIndex tile : ta) {
switch (GetTileType(tile)) {
case MP_TREES:
if (GetTreeGround(tile) == TREE_GROUND_SHORE) continue;
@@ -380,7 +381,7 @@ Window *ShowTerraformToolbar(Window *link)
}
/* Delete the terraform toolbar to place it again. */
DeleteWindowById(WC_SCEN_LAND_GEN, 0, true);
CloseWindowById(WC_SCEN_LAND_GEN, 0, true);
w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
/* Align the terraform toolbar under the main toolbar. */
w->top -= w->height;
@@ -424,18 +425,18 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode)
if (mode != 0) {
/* Raise land */
h = MAX_TILE_HEIGHT;
TILE_AREA_LOOP(tile2, ta) {
for (TileIndex tile2 : ta) {
h = std::min(h, TileHeight(tile2));
}
} else {
/* Lower land */
h = 0;
TILE_AREA_LOOP(tile2, ta) {
for (TileIndex tile2 : ta) {
h = std::max(h, TileHeight(tile2));
}
}
TILE_AREA_LOOP(tile2, ta) {
for (TileIndex tile2 : ta) {
if (TileHeight(tile2) == h) {
DoCommandP(tile2, SLOPE_N, (uint32)mode, CMD_TERRAFORM_LAND);
}
@@ -513,7 +514,7 @@ static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed)
if (confirmed) {
/* Set generating_world to true to get instant-green grass after removing
* company property. */
_generating_world = true;
Backup<bool> old_generating_world(_generating_world, true, FILE_LINE);
/* Delete all companies */
for (Company *c : Company::Iterate()) {
@@ -521,7 +522,7 @@ static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed)
delete c;
}
_generating_world = false;
old_generating_world.Restore();
/* Delete all station signs */
for (BaseStation *st : BaseStation::Iterate()) {