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

@@ -27,6 +27,7 @@
#include "querystring_gui.h"
#include "window_func.h"
#include "townname_func.h"
#include "core/backup_type.hpp"
#include "core/geometry_func.hpp"
#include "genworld.h"
#include "stringfilter_type.h"
@@ -85,8 +86,7 @@ private:
static int GetNthSetBit(uint32 bits, int n)
{
if (n >= 0) {
uint i;
FOR_EACH_SET_BIT(i, bits) {
for (uint i : SetBitIterator(bits)) {
n--;
if (n < 0) return i;
}
@@ -339,9 +339,10 @@ public:
this->SetWidgetDisabledState(WID_TV_CHANGE_NAME, _networking && !_network_server);
}
~TownViewWindow()
void Close() override
{
SetViewportCatchmentTown(Town::Get(this->window_number), false);
this->Window::Close();
}
void SetStringParameters(int widget) const override
@@ -438,7 +439,7 @@ public:
}
if (!this->town->text.empty()) {
SetDParamStr(0, this->town->text.c_str());
SetDParamStr(0, this->town->text);
DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y += FONT_HEIGHT_NORMAL, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK);
}
}
@@ -520,7 +521,7 @@ public:
if (_settings_game.economy.station_noise_level) aimed_height += FONT_HEIGHT_NORMAL;
if (!this->town->text.empty()) {
SetDParamStr(0, this->town->text.c_str());
SetDParamStr(0, this->town->text);
aimed_height += GetStringHeight(STR_JUST_RAW_STRING, width - WD_FRAMERECT_LEFT - WD_FRAMERECT_RIGHT);
}
@@ -579,7 +580,7 @@ static const NWidgetPart _nested_town_game_view_widgets[] = {
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN),
NWidget(WWT_INSET, COLOUR_BROWN), SetPadding(2, 2, 2, 2),
NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_TV_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 0), SetResize(1, 1), SetPadding(1, 1, 1, 1),
NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_TV_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 0), SetResize(1, 1),
EndContainer(),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN, WID_TV_INFO), SetMinimalSize(260, 32), SetResize(1, 0), SetFill(1, 0), EndContainer(),
@@ -608,7 +609,7 @@ static const NWidgetPart _nested_town_editor_view_widgets[] = {
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN),
NWidget(WWT_INSET, COLOUR_BROWN), SetPadding(2, 2, 2, 2),
NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_TV_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 1), SetResize(1, 1), SetPadding(1, 1, 1, 1),
NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_TV_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 1), SetResize(1, 1),
EndContainer(),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN, WID_TV_INFO), SetMinimalSize(260, 32), SetResize(1, 0), SetFill(1, 0), EndContainer(),
@@ -1164,7 +1165,7 @@ public:
void ExecuteFoundTownCommand(TileIndex tile, bool random, StringID errstr, CommandCallback cc)
{
const char *name = nullptr;
std::string name;
if (!this->townnamevalid) {
name = this->townname_editbox.text.buf;
@@ -1198,15 +1199,16 @@ public:
this->SetFocusedWidget(WID_TF_TOWN_NAME_EDITBOX);
break;
case WID_TF_MANY_RANDOM_TOWNS:
_generating_world = true;
case WID_TF_MANY_RANDOM_TOWNS: {
Backup<bool> old_generating_world(_generating_world, true, FILE_LINE);
UpdateNearestTownForRoadTiles(true);
if (!GenerateTowns(this->town_layout)) {
ShowErrorMessage(STR_ERROR_CAN_T_GENERATE_TOWN, STR_ERROR_NO_SPACE_FOR_TOWN, WL_INFO);
}
UpdateNearestTownForRoadTiles(false);
_generating_world = false;
old_generating_world.Restore();
break;
}
case WID_TF_SIZE_SMALL: case WID_TF_SIZE_MEDIUM: case WID_TF_SIZE_LARGE: case WID_TF_SIZE_RANDOM:
this->town_size = (TownSize)(widget - WID_TF_SIZE_SMALL);
@@ -1274,7 +1276,7 @@ static WindowDesc _found_town_desc(
void ShowFoundTownWindow()
{
if (_game_mode != GM_EDITOR && !Company::IsValidID(_local_company)) return;
DeleteToolbarLinkedWindows();
CloseToolbarLinkedWindows();
AllocateWindowDescFront<FoundTownWindow>(&_found_town_desc, 0);
}