diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2021-01-08 10:16:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 11:16:18 +0100 |
commit | 9b800a96ed32720ff60b74e498a0e0a6351004f9 (patch) | |
tree | 3f287d339e15c4902ee415556475fd9b2918d33c /src/newgrf_debug_gui.cpp | |
parent | c1fddb9a6ae5c3af6865461a7295788a341011a2 (diff) | |
download | openttd-9b800a96ed32720ff60b74e498a0e0a6351004f9.tar.xz |
Codechange: Remove min/max functions in favour of STL variants (#8502)
Diffstat (limited to 'src/newgrf_debug_gui.cpp')
-rw-r--r-- | src/newgrf_debug_gui.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index 511436b27..da3ddff0a 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -374,12 +374,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; @@ -430,7 +430,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); @@ -861,7 +861,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: @@ -897,7 +897,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++) { |