Merge branch 'master' into jgrpp

# Conflicts:
#	src/autoreplace_cmd.cpp
#	src/company_base.h
#	src/company_gui.cpp
#	src/cpu.cpp
#	src/debug.h
#	src/group.h
#	src/group_cmd.cpp
#	src/house.h
#	src/industry.h
#	src/newgrf_house.cpp
#	src/news_type.h
#	src/openttd.cpp
#	src/saveload/company_sl.cpp
#	src/settings_type.h
#	src/sl/oldloader_sl.cpp
#	src/story.cpp
#	src/table/town_land.h
#	src/viewport.cpp
This commit is contained in:
Jonathan G Rennison
2024-02-09 18:11:42 +00:00
51 changed files with 553 additions and 839 deletions

View File

@@ -23,6 +23,8 @@
#include "table/strings.h"
#include "table/string_colours.h"
#include <numeric>
#include "safeguards.h"
WidgetDimensions WidgetDimensions::scaled = {};
@@ -1258,10 +1260,10 @@ void NWidgetStacked::SetupSmallestSize(Window *w)
this->smallest_x = std::max(this->smallest_x, child_wid->smallest_x + child_wid->padding.Horizontal());
this->smallest_y = std::max(this->smallest_y, child_wid->smallest_y + child_wid->padding.Vertical());
this->fill_x = LeastCommonMultiple(this->fill_x, child_wid->fill_x);
this->fill_y = LeastCommonMultiple(this->fill_y, child_wid->fill_y);
this->resize_x = LeastCommonMultiple(this->resize_x, child_wid->resize_x);
this->resize_y = LeastCommonMultiple(this->resize_y, child_wid->resize_y);
this->fill_x = std::lcm(this->fill_x, child_wid->fill_x);
this->fill_y = std::lcm(this->fill_y, child_wid->fill_y);
this->resize_x = std::lcm(this->resize_x, child_wid->resize_x);
this->resize_y = std::lcm(this->resize_y, child_wid->resize_y);
}
}
@@ -1449,12 +1451,12 @@ void NWidgetHorizontal::SetupSmallestSize(Window *w)
if (child_wid->fill_x > 0) {
if (this->fill_x == 0 || this->fill_x > child_wid->fill_x) this->fill_x = child_wid->fill_x;
}
this->fill_y = LeastCommonMultiple(this->fill_y, child_wid->fill_y);
this->fill_y = std::lcm(this->fill_y, child_wid->fill_y);
if (child_wid->resize_x > 0) {
if (this->resize_x == 0 || this->resize_x > child_wid->resize_x) this->resize_x = child_wid->resize_x;
}
this->resize_y = LeastCommonMultiple(this->resize_y, child_wid->resize_y);
this->resize_y = std::lcm(this->resize_y, child_wid->resize_y);
}
if (this->fill_x == 0 && this->pip_ratio_pre + this->pip_ratio_inter + this->pip_ratio_post > 0) this->fill_x = 1;
/* 4. Increase by required PIP space. */
@@ -1638,12 +1640,12 @@ void NWidgetVertical::SetupSmallestSize(Window *w)
if (child_wid->fill_y > 0) {
if (this->fill_y == 0 || this->fill_y > child_wid->fill_y) this->fill_y = child_wid->fill_y;
}
this->fill_x = LeastCommonMultiple(this->fill_x, child_wid->fill_x);
this->fill_x = std::lcm(this->fill_x, child_wid->fill_x);
if (child_wid->resize_y > 0) {
if (this->resize_y == 0 || this->resize_y > child_wid->resize_y) this->resize_y = child_wid->resize_y;
}
this->resize_x = LeastCommonMultiple(this->resize_x, child_wid->resize_x);
this->resize_x = std::lcm(this->resize_x, child_wid->resize_x);
}
if (this->fill_y == 0 && this->pip_ratio_pre + this->pip_ratio_inter + this->pip_ratio_post > 0) this->fill_y = 1;
/* 4. Increase by required PIP space. */