Merge tag '1.11.0-beta1' into jgrpp
# Conflicts: # src/console_cmds.cpp # src/gfx_func.h # src/industry.h # src/lang/czech.txt # src/lang/estonian.txt # src/lang/german.txt # src/lang/indonesian.txt # src/lang/japanese.txt # src/lang/norwegian_bokmal.txt # src/lang/russian.txt # src/lang/slovak.txt # src/saveload/saveload.h # src/station_gui.cpp # src/town_gui.cpp # src/vehicle_gui.cpp # src/video/sdl2_v.cpp # src/waypoint_gui.cpp
This commit is contained in:
@@ -862,14 +862,12 @@ int openttd_main(int argc, char *argv[])
|
||||
|
||||
if (resolution.width != 0) _cur_resolution = resolution;
|
||||
|
||||
/*
|
||||
* The width and height must be at least 1 pixel and width times
|
||||
* height times bytes per pixel must still fit within a 32 bits
|
||||
* integer, even for 32 bpp video modes. This way all internal
|
||||
* drawing routines work correctly.
|
||||
*/
|
||||
_cur_resolution.width = ClampU(_cur_resolution.width, 1, UINT16_MAX / 2);
|
||||
_cur_resolution.height = ClampU(_cur_resolution.height, 1, UINT16_MAX / 2);
|
||||
/* Limit width times height times bytes per pixel to fit a 32 bit
|
||||
* integer, This way all internal drawing routines work correctly.
|
||||
* A resolution that has one component as 0 is treated as a marker to
|
||||
* auto-detect a good window size. */
|
||||
_cur_resolution.width = std::min(_cur_resolution.width, UINT16_MAX / 2u);
|
||||
_cur_resolution.height = std::min(_cur_resolution.height, UINT16_MAX / 2u);
|
||||
|
||||
/* Assume the cursor starts within the game as not all video drivers
|
||||
* get an event that the cursor is within the window when it is opened.
|
||||
|
Reference in New Issue
Block a user