Merge branch 'master' into jgrpp

# Conflicts:
#	.github/workflows/ci-build.yml
#	src/ai/ai_gui.cpp
#	src/blitter/32bpp_optimized.cpp
#	src/blitter/32bpp_simple.cpp
#	src/blitter/32bpp_sse2.cpp
#	src/blitter/8bpp_optimized.cpp
#	src/blitter/8bpp_simple.cpp
#	src/blitter/null.cpp
#	src/blitter/null.hpp
#	src/company_gui.cpp
#	src/game/game_gui.cpp
#	src/genworld_gui.cpp
#	src/gfx.cpp
#	src/gfx_func.h
#	src/graph_gui.cpp
#	src/industry_gui.cpp
#	src/linkgraph/linkgraphjob.cpp
#	src/network/network_gui.cpp
#	src/newgrf_debug_gui.cpp
#	src/openttd.cpp
#	src/pathfinder/npf/aystar.h
#	src/road_gui.cpp
#	src/saveload/order_sl.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/script/api/script_log.cpp
#	src/script/api/script_town.cpp
#	src/script/script_gui.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_table.cpp
#	src/settings_type.h
#	src/smallmap_gui.cpp
#	src/sortlist_type.h
#	src/spritecache.cpp
#	src/spriteloader/grf.cpp
#	src/spriteloader/grf.hpp
#	src/spriteloader/spriteloader.hpp
#	src/station_cmd.cpp
#	src/station_cmd.h
#	src/station_gui.cpp
#	src/strings.cpp
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/town_gui.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
#	src/video/opengl.cpp
#	src/video/opengl.h
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_type.h
#	src/window_gui.h
This commit is contained in:
Jonathan G Rennison
2023-12-23 13:26:55 +00:00
249 changed files with 2737 additions and 2156 deletions

View File

@@ -977,8 +977,9 @@ void Window::ReInit(int rx, int ry, bool reposition)
this->SetDirtyAsBlocks(); // Mark whole current window as dirty.
/* Save current size. */
int window_width = this->width;
int window_height = this->height;
int window_width = this->width * _gui_scale / this->scale;
int window_height = this->height * _gui_scale / this->scale;
this->scale = _gui_scale;
this->OnInit();
/* Re-initialize the window from the ground up. No need to change the nested_array, as all widgets stay where they are. */
@@ -1888,7 +1889,7 @@ void Window::InitNested(WindowNumber window_number)
* Empty constructor, initialization has been moved to #InitNested() called from the constructor of the derived class.
* @param desc The description of the window.
*/
Window::Window(WindowDesc *desc) : window_desc(desc), mouse_capture_widget(-1)
Window::Window(WindowDesc *desc) : window_desc(desc), scale(_gui_scale), mouse_capture_widget(-1)
{
}
@@ -1927,9 +1928,12 @@ void InitWindowSystem()
_scrolling_viewport_bound = { 0, 0, 0, 0 };
_mouse_hovering = false;
SetupWidgetDimensions();
NWidgetLeaf::InvalidateDimensionCache(); // Reset cached sizes of several widgets.
NWidgetScrollbar::InvalidateDimensionCache();
InitDepotWindowBlockSizes();
ShowFirstError();
}