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

Function ScreenSizeChanged

src/gfx.cpp:1318–1334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1316}
1317
1318void ScreenSizeChanged()
1319{
1320 _dirty_blocks_per_row = CeilDiv(_screen.width, DIRTY_BLOCK_WIDTH);
1321 _dirty_blocks_per_column = CeilDiv(_screen.height, DIRTY_BLOCK_HEIGHT);
1322 _dirty_blocks.resize(_dirty_blocks_per_column * _dirty_blocks_per_row);
1323
1324 /* check the dirty rect */
1325 if (_invalid_rect.right >= _screen.width) _invalid_rect.right = _screen.width;
1326 if (_invalid_rect.bottom >= _screen.height) _invalid_rect.bottom = _screen.height;
1327
1328 /* screen size changed and the old bitmap is invalid now, so we don't want to undraw it */
1329 _cursor.visible = false;
1330
1331 if (VideoDriver::GetInstance() != nullptr) {
1332 if (AdjustGUIZoom(true)) ReInitAllWindows(true);
1333 }
1334}
1335
1336void UndrawMouseCursor()
1337{

Callers 3

GameSizeChangedFunction · 0.85
StartMethod · 0.85
StartMethod · 0.85

Calls 4

CeilDivFunction · 0.85
AdjustGUIZoomFunction · 0.85
ReInitAllWindowsFunction · 0.85
resizeMethod · 0.80

Tested by

no test coverage detected