Merge branch 'master' into jgrpp

# Conflicts:
#	cmake/CompileFlags.cmake
#	src/aircraft_cmd.cpp
#	src/blitter/32bpp_anim.cpp
#	src/cargopacket.cpp
#	src/cheat_gui.cpp
#	src/company_cmd.cpp
#	src/company_gui.cpp
#	src/core/pool_func.hpp
#	src/date.cpp
#	src/economy.cpp
#	src/error_gui.cpp
#	src/ground_vehicle.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/industry_cmd.cpp
#	src/lang/dutch.txt
#	src/lang/french.txt
#	src/lang/german.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/linkgraph/mcf.cpp
#	src/network/network_content.cpp
#	src/network/network_server.cpp
#	src/network/network_udp.cpp
#	src/newgrf_engine.cpp
#	src/newgrf_station.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/pathfinder/follow_track.hpp
#	src/pathfinder/yapf/yapf_common.hpp
#	src/saveload/saveload.cpp
#	src/settings_gui.cpp
#	src/station_cmd.cpp
#	src/station_kdtree.h
#	src/string_func.h
#	src/table/settings.ini
#	src/tgp.cpp
#	src/timetable_cmd.cpp
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/train_cmd.cpp
#	src/train_gui.cpp
#	src/tree_gui.cpp
#	src/tunnelbridge_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
#	src/viewport.cpp
#	src/viewport_sprite_sorter_sse4.cpp
#	src/window.cpp
This commit is contained in:
Jonathan G Rennison
2021-02-01 17:07:34 +00:00
290 changed files with 2135 additions and 1577 deletions

View File

@@ -83,7 +83,7 @@ DropDownListIconItem::DropDownListIconItem(SpriteID sprite, PaletteID pal, Strin
uint DropDownListIconItem::Height(uint width) const
{
return max(this->dim.height, (uint)FONT_HEIGHT_NORMAL);
return std::max(this->dim.height, (uint)FONT_HEIGHT_NORMAL);
}
uint DropDownListIconItem::Width() const
@@ -402,7 +402,7 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button
for (const auto &item : list) {
height += item->Height(width);
if (auto_width) max_item_width = max(max_item_width, item->Width() + 5);
if (auto_width) max_item_width = std::max(max_item_width, item->Width() + 5);
}
/* Scrollbar needed? */
@@ -412,12 +412,12 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button
bool above = false;
/* Available height below (or above, if the dropdown is placed above the widget). */
uint available_height = (uint)max(GetMainViewBottom() - top - 4, 0);
uint available_height = std::max(GetMainViewBottom() - top - 4, 0);
/* If the dropdown doesn't fully fit below the widget... */
if (height > available_height) {
uint available_height_above = (uint)max(w->top + wi_rect.top - GetMainViewTop() - 4, 0);
uint available_height_above = std::max(w->top + wi_rect.top - GetMainViewTop() - 4, 0);
/* Put the dropdown above if there is more available space. */
if (available_height_above > available_height) {
@@ -447,7 +447,7 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button
}
}
if (auto_width) width = max(width, max_item_width);
if (auto_width) width = std::max(width, max_item_width);
Point dw_pos = { w->left + (_current_text_dir == TD_RTL ? wi_rect.right + 1 - (int)width : wi_rect.left), top};
Dimension dw_size = {width, height};