MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ReInitAllWindows

Function ReInitAllWindows

src/window.cpp:3413–3436  ·  view source on GitHub ↗

Re-initialize all windows. */

Source from the content-addressed store, hash-verified

3411
3412/** Re-initialize all windows. */
3413void ReInitAllWindows(bool zoom_changed)
3414{
3415 SetupWidgetDimensions();
3416 NWidgetLeaf::InvalidateDimensionCache(); // Reset cached sizes of several widgets.
3417 NWidgetScrollbar::InvalidateDimensionCache();
3418
3419 InitDepotWindowBlockSizes();
3420
3421 /* When _gui_zoom has changed, we need to resize toolbar and statusbar first,
3422 * so EnsureVisibleCaption uses the updated size information. */
3423 ReInitWindow(FindWindowById(WC_MAIN_TOOLBAR, 0), zoom_changed);
3424 ReInitWindow(FindWindowById(WC_STATUS_BAR, 0), zoom_changed);
3425 for (Window *w : Window::Iterate()) {
3426 if (w->window_class == WC_MAIN_TOOLBAR || w->window_class == WC_STATUS_BAR) continue;
3427 ReInitWindow(w, zoom_changed);
3428 }
3429
3430 if (_networking) NetworkUndrawChatMessage();
3431 NetworkReInitChatBoxSize();
3432
3433 /* Make sure essential parts of all windows are visible */
3434 RelocateAllWindows(_screen.width, _screen.height);
3435 MarkWholeScreenDirty();
3436}
3437
3438/**
3439 * (Re)position a window at the screen.

Callers 11

ScreenSizeChangedFunction · 0.85
RealChangeBlitterFunction · 0.85
CheckBlitterFunction · 0.85
SetFontFunction · 0.85
OnClickMethod · 0.85
OnMouseLoopMethod · 0.85
OnDropdownSelectMethod · 0.85
ZoomMinMaxChangedFunction · 0.85
WndProcGdiFunction · 0.85

Calls 8

SetupWidgetDimensionsFunction · 0.85
ReInitWindowFunction · 0.85
FindWindowByIdFunction · 0.85
NetworkUndrawChatMessageFunction · 0.85
NetworkReInitChatBoxSizeFunction · 0.85
RelocateAllWindowsFunction · 0.85
MarkWholeScreenDirtyFunction · 0.85

Tested by

no test coverage detected