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

Function UndrawMouseCursor

src/gfx.cpp:1336–1350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1334}
1335
1336void UndrawMouseCursor()
1337{
1338 /* Don't undraw mouse cursor if it is handled by the video driver. */
1339 if (VideoDriver::GetInstance()->UseSystemCursor()) return;
1340
1341 /* Don't undraw the mouse cursor if the screen is not ready */
1342 if (_screen.dst_ptr == nullptr) return;
1343
1344 if (_cursor.visible) {
1345 Blitter *blitter = BlitterFactory::GetCurrentBlitter();
1346 _cursor.visible = false;
1347 blitter->CopyFromBuffer(blitter->MoveTo(_screen.dst_ptr, _cursor.draw_pos.x, _cursor.draw_pos.y), _cursor_backup.GetBuffer(), _cursor.draw_size.x, _cursor.draw_size.y);
1348 VideoDriver::GetInstance()->MakeDirty(_cursor.draw_pos.x, _cursor.draw_pos.y, _cursor.draw_size.x, _cursor.draw_size.y);
1349 }
1350}
1351
1352void DrawMouseCursor()
1353{

Callers 7

GfxScrollFunction · 0.85
DrawMouseCursorFunction · 0.85
RedrawScreenRectFunction · 0.85
RealMakeScreenshotFunction · 0.85
NetworkUndrawChatMessageFunction · 0.85
WndProcGdiFunction · 0.85
PollEventMethod · 0.85

Calls 5

GetBufferMethod · 0.80
UseSystemCursorMethod · 0.45
CopyFromBufferMethod · 0.45
MoveToMethod · 0.45
MakeDirtyMethod · 0.45

Tested by

no test coverage detected