Merge branch 'master' into jgrpp

# Conflicts:
#	CMakeLists.txt
#	bin/ai/CMakeLists.txt
#	bin/game/CMakeLists.txt
#	src/ai/ai_info.cpp
#	src/company_base.h
#	src/economy.cpp
#	src/game/game_info.cpp
#	src/gfx_type.h
#	src/linkgraph/linkgraph_gui.cpp
#	src/palette.cpp
#	src/palette_func.h
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/ship_cmd.cpp
#	src/train_cmd.cpp
#	src/vehicle_base.h
#	src/window.cpp
#	src/window_func.h
This commit is contained in:
Jonathan G Rennison
2024-02-26 18:19:34 +00:00
115 changed files with 3467 additions and 2164 deletions

View File

@@ -1006,7 +1006,7 @@ void Window::ReInit(int rx, int ry, bool reposition)
this->FindWindowPlacementAndResize(this->window_desc->GetDefaultWidth(), this->window_desc->GetDefaultHeight());
}
ResizeWindow(this, dx, dy);
ResizeWindow(this, dx, dy, true, false);
/* ResizeWindow() does this->SetDirty() already, no need to do it again here. */
}
@@ -1580,8 +1580,8 @@ void Window::FindWindowPlacementAndResize(int def_width, int def_height)
ResizeWindow(this, enlarge_x, enlarge_y);
/* ResizeWindow() calls this->OnResize(). */
} else {
/* Schedule OnResize; that way the scrollbars and matrices get initialized. */
this->ScheduleResize();
/* Always call OnResize; that way the scrollbars and matrices get initialized. */
this->OnResize();
}
int nx = this->left;
@@ -2174,7 +2174,7 @@ static void EnsureVisibleCaption(Window *w, int nx, int ny)
* @param delta_y Delta y-size of changed window
* @param clamp_to_screen Whether to make sure the whole window stays visible
*/
void ResizeWindow(Window *w, int delta_x, int delta_y, bool clamp_to_screen)
void ResizeWindow(Window *w, int delta_x, int delta_y, bool clamp_to_screen, bool schedule_resize)
{
if (delta_x != 0 || delta_y != 0) {
if (clamp_to_screen) {
@@ -2201,7 +2201,12 @@ void ResizeWindow(Window *w, int delta_x, int delta_y, bool clamp_to_screen)
EnsureVisibleCaption(w, w->left, w->top);
/* Schedule OnResize to make sure everything is initialised correctly if it needs to be. */
w->ScheduleResize();
if (schedule_resize) {
w->ScheduleResize();
} else {
w->OnResize();
}
extern bool _gfx_draw_active;
if (_gfx_draw_active) {
SetWindowDirtyPending(w);