Merge remote-tracking branch 'upstream/1.11' into 1.11

This commit is contained in:
dP
2021-01-25 22:53:44 +03:00
1111 changed files with 23665 additions and 81723 deletions

View File

@@ -376,12 +376,12 @@ struct NewGRFInspectWindow : Window {
case WID_NGRFI_VEH_CHAIN: {
assert(this->HasChainIndex());
GrfSpecFeature f = GetFeatureNum(this->window_number);
size->height = max(size->height, GetVehicleImageCellSize((VehicleType)(VEH_TRAIN + (f - GSF_TRAINS)), EIT_IN_DEPOT).height + 2 + WD_BEVEL_TOP + WD_BEVEL_BOTTOM);
size->height = std::max(size->height, GetVehicleImageCellSize((VehicleType)(VEH_TRAIN + (f - GSF_TRAINS)), EIT_IN_DEPOT).height + 2 + WD_BEVEL_TOP + WD_BEVEL_BOTTOM);
break;
}
case WID_NGRFI_MAINPANEL:
resize->height = max(11, FONT_HEIGHT_NORMAL + 1);
resize->height = std::max(11, FONT_HEIGHT_NORMAL + 1);
resize->width = 1;
size->height = 5 * resize->height + TOP_OFFSET + BOTTOM_OFFSET;
@@ -432,7 +432,7 @@ struct NewGRFInspectWindow : Window {
int skip = 0;
if (total_width > width) {
int sel_center = (sel_start + sel_end) / 2;
if (sel_center > width / 2) skip = min(total_width - width, sel_center - width / 2);
if (sel_center > width / 2) skip = std::min(total_width - width, sel_center - width / 2);
}
GrfSpecFeature f = GetFeatureNum(this->window_number);
@@ -807,7 +807,7 @@ GrfSpecFeature GetGrfSpecFeature(VehicleType type)
/** Window used for aligning sprites. */
struct SpriteAlignerWindow : Window {
typedef SmallPair<int16, int16> XyOffs; ///< Pair for x and y offsets of the sprite before alignment. First value contains the x offset, second value y offset.
typedef std::pair<int16, int16> XyOffs; ///< Pair for x and y offsets of the sprite before alignment. First value contains the x offset, second value y offset.
SpriteID current_sprite; ///< The currently shown sprite.
Scrollbar *vscroll;
@@ -864,7 +864,7 @@ struct SpriteAlignerWindow : Window {
size->height = ScaleGUITrad(200);
break;
case WID_SA_LIST:
resize->height = max(11, FONT_HEIGHT_NORMAL + 1);
resize->height = std::max(11, FONT_HEIGHT_NORMAL + 1);
resize->width = 1;
break;
default:
@@ -900,7 +900,7 @@ struct SpriteAlignerWindow : Window {
int step_size = nwid->resize_y;
std::vector<SpriteID> &list = _newgrf_debug_sprite_picker.sprites;
int max = min<int>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), (uint)list.size());
int max = std::min<int>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), (uint)list.size());
int y = r.top + WD_FRAMERECT_TOP;
for (int i = this->vscroll->GetPosition(); i < max; i++) {