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

@@ -26,7 +26,6 @@
#include "../thread.h"
#include "allegro_v.h"
#include <allegro.h>
#include <algorithm>
#include "../safeguards.h"

View File

@@ -146,7 +146,7 @@ static DBusHandlerResult FcitxDBusMessageFilter(DBusConnection *connection, DBus
if (!dbus_message_get_args(message, nullptr, DBUS_TYPE_STRING, &text, DBUS_TYPE_INT32, &cursor, DBUS_TYPE_INVALID)) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
if (text != nullptr && EditBoxInGlobalFocus()) {
HandleTextInput(text, true, text + min<uint>(cursor, strlen(text)));
HandleTextInput(text, true, text + std::min<uint>(cursor, strlen(text)));
}
return DBUS_HANDLER_RESULT_HANDLED;
}
@@ -956,8 +956,8 @@ int VideoDriver_SDL::PollEvent()
// Force a redraw of the entire screen.
_num_dirty_rects = MAX_DIRTY_RECTS + 1;
} else if (ev.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
int w = max(ev.window.data1, 64);
int h = max(ev.window.data2, 64);
int w = std::max(ev.window.data1, 64);
int h = std::max(ev.window.data2, 64);
CreateMainSurface(w, h, w != ev.window.data1 || h != ev.window.data2);
} else if (ev.window.event == SDL_WINDOWEVENT_ENTER) {
// mouse entered the window, enable cursor

View File

@@ -588,8 +588,8 @@ int VideoDriver_SDL::PollEvent()
break;
case SDL_VIDEORESIZE: {
int w = max(ev.resize.w, 64);
int h = max(ev.resize.h, 64);
int w = std::max(ev.resize.w, 64);
int h = std::max(ev.resize.h, 64);
CreateMainSurface(w, h);
break;
}

View File

@@ -907,8 +907,8 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
w = r->right - r->left - (r2.right - r2.left);
h = r->bottom - r->top - (r2.bottom - r2.top);
w = max(w, 64);
h = max(h, 64);
w = std::max(w, 64);
h = std::max(h, 64);
SetRect(&r2, 0, 0, w, h);
AdjustWindowRect(&r2, GetWindowLong(hwnd, GWL_STYLE), FALSE);
@@ -1041,8 +1041,8 @@ static bool AllocateDibSection(int w, int h, bool force)
HDC dc;
uint bpp = BlitterFactory::GetCurrentBlitter()->GetScreenDepth();
w = max(w, 64);
h = max(h, 64);
w = std::max(w, 64);
h = std::max(h, 64);
if (bpp == 0) usererror("Can't use a blitter that blits 0 bpp for normal visuals");