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

Function RedrawScreenRect

src/gfx.cpp:1426–1443  ·  view source on GitHub ↗

* Repaints a specific rectangle of the screen. * * @param left,top,right,bottom The area of the screen that needs repainting * @pre The rectangle should have been previously marked dirty with \c AddDirtyBlock. * @see AddDirtyBlock * @see DrawDirtyBlocks * @ingroup dirty * */

Source from the content-addressed store, hash-verified

1424 *
1425 */
1426void RedrawScreenRect(int left, int top, int right, int bottom)
1427{
1428 assert(right <= _screen.width && bottom <= _screen.height);
1429 if (_cursor.visible) {
1430 if (right > _cursor.draw_pos.x &&
1431 left < _cursor.draw_pos.x + _cursor.draw_size.x &&
1432 bottom > _cursor.draw_pos.y &&
1433 top < _cursor.draw_pos.y + _cursor.draw_size.y) {
1434 UndrawMouseCursor();
1435 }
1436 }
1437
1438 if (_networking) NetworkUndrawChatMessage();
1439
1440 DrawOverlappedWindowForAll(left, top, right, bottom);
1441
1442 VideoDriver::GetInstance()->MakeDirty(left, top, right - left, bottom - top);
1443}
1444
1445/**
1446 * Repaints the rectangle blocks which are marked as 'dirty'.

Callers 2

DrawDirtyBlocksFunction · 0.85
DoSetViewportPositionFunction · 0.85

Calls 4

UndrawMouseCursorFunction · 0.85
NetworkUndrawChatMessageFunction · 0.85
MakeDirtyMethod · 0.45

Tested by

no test coverage detected