Merge remote-tracking branch 'upstream/master'

This commit is contained in:
pelya
2021-01-25 00:50:42 +02:00
1076 changed files with 25433 additions and 61762 deletions

View File

@@ -285,7 +285,7 @@ static const StringID _num_towns[] = {STR_NUM_VERY_LOW, STR_NUM_LOW, STR_NUM_N
static const StringID _num_inds[] = {STR_FUNDING_ONLY, STR_MINIMAL, STR_NUM_VERY_LOW, STR_NUM_LOW, STR_NUM_NORMAL, STR_NUM_HIGH, INVALID_STRING_ID};
static const StringID _variety[] = {STR_VARIETY_NONE, STR_VARIETY_VERY_LOW, STR_VARIETY_LOW, STR_VARIETY_MEDIUM, STR_VARIETY_HIGH, STR_VARIETY_VERY_HIGH, INVALID_STRING_ID};
assert_compile(lengthof(_num_inds) == ID_END + 1);
static_assert(lengthof(_num_inds) == ID_END + 1);
struct GenerateLandscapeWindow : public Window {
uint widget_id;
@@ -497,7 +497,7 @@ struct GenerateLandscapeWindow : public Window {
}
}
size->width += padding.width;
size->height = max(size->height, (uint)(FONT_HEIGHT_NORMAL + WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM));
size->height = std::max(size->height, (uint)(FONT_HEIGHT_NORMAL + WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM));
}
void DrawWidget(const Rect &r, int widget) const override
@@ -815,7 +815,7 @@ static void _ShowGenerateLandscape(GenerateLandscapeWindowMode mode)
if (mode == GLWM_HEIGHTMAP) {
/* If the function returns negative, it means there was a problem loading the heightmap */
if (!GetHeightmapDimensions(_file_to_saveload.detail_ftype, _file_to_saveload.name, &x, &y)) return;
if (!GetHeightmapDimensions(_file_to_saveload.detail_ftype, _file_to_saveload.name.c_str(), &x, &y)) return;
}
WindowDesc *desc = (mode == GLWM_HEIGHTMAP) ? &_heightmap_load_desc : &_generate_landscape_desc;
@@ -1157,7 +1157,7 @@ static const StringID _generation_class_table[] = {
STR_GENERATION_PREPARING_SCRIPT,
STR_GENERATION_PREPARING_GAME
};
assert_compile(lengthof(_generation_class_table) == GWP_CLASS_COUNT);
static_assert(lengthof(_generation_class_table) == GWP_CLASS_COUNT);
static void AbortGeneratingWorldCallback(Window *w, bool confirmed)
@@ -1205,7 +1205,7 @@ struct GenerateProgressWindow : public Window {
case WID_GP_PROGRESS_TEXT:
for (uint i = 0; i < GWP_CLASS_COUNT; i++) {
size->width = max(size->width, GetStringBoundingBox(_generation_class_table[i]).width);
size->width = std::max(size->width, GetStringBoundingBox(_generation_class_table[i]).width);
}
size->height = FONT_HEIGHT_NORMAL * 2 + WD_PAR_VSEP_NORMAL;
break;
@@ -1259,7 +1259,7 @@ void ShowGenerateWorldProgress()
static void _SetGeneratingWorldProgress(GenWorldProgress cls, uint progress, uint total)
{
static const int percent_table[] = {0, 5, 14, 17, 20, 40, 60, 65, 80, 85, 95, 99, 100 };
assert_compile(lengthof(percent_table) == GWP_CLASS_COUNT + 1);
static_assert(lengthof(percent_table) == GWP_CLASS_COUNT + 1);
assert(cls < GWP_CLASS_COUNT);
/* Do not run this function if we aren't in a thread */