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

Function DrawOverlappedWindowForAll

src/window.cpp:947–962  ·  view source on GitHub ↗

* From a rectangle that needs redrawing, find the windows that intersect with the rectangle. * These windows should be re-painted. * @param left Left edge of the rectangle that should be repainted * @param top Top edge of the rectangle that should be repainted * @param right Right edge of the rectangle that should be repainted * @param bottom Bottom edge of the rectangle that should be repain

Source from the content-addressed store, hash-verified

945 * @param bottom Bottom edge of the rectangle that should be repainted
946 */
947void DrawOverlappedWindowForAll(int left, int top, int right, int bottom)
948{
949 DrawPixelInfo bk;
950 AutoRestoreBackup dpi_backup(_cur_dpi, &bk);
951
952 for (Window *w : Window::IterateFromBack()) {
953 if (MayBeShown(w) &&
954 right > w->left &&
955 bottom > w->top &&
956 left < w->left + w->width &&
957 top < w->top + w->height) {
958 /* Window w intersects with the rectangle => needs repaint */
959 DrawOverlappedWindow(w, std::max(left, w->left), std::max(top, w->top), std::min(right, w->left + w->width), std::min(bottom, w->top + w->height));
960 }
961 }
962}
963
964/**
965 * Mark entire window as dirty (in need of re-paint)

Callers 1

RedrawScreenRectFunction · 0.85

Calls 2

MayBeShownFunction · 0.85
DrawOverlappedWindowFunction · 0.85

Tested by

no test coverage detected