Change how dirty screen, window and viewport areas are tracked for later redrawing
Track dirty viewport areas seperately form general screen redraws. Maintain a dirty block grid per viewport, with a smaller block size. Use even smaller block size in viewport map mode. Use a rectangle array for general screen redraws instead of a block grid. Add a dirty bit to windows and widgets, to simplify the common case of repainting a whole window or widget, without catching neighbouring windows or viewports.
This commit is contained in:
@@ -1735,6 +1735,15 @@ public:
|
||||
{
|
||||
for (NWidgetBase *child_wid = this->head; child_wid != nullptr; child_wid = child_wid->next) child_wid->Draw(w);
|
||||
}
|
||||
|
||||
void FillDirtyWidgets(std::vector<NWidgetBase *> &dirty_widgets) override
|
||||
{
|
||||
if (this->base_flags & WBF_DIRTY) {
|
||||
dirty_widgets.push_back(this);
|
||||
} else {
|
||||
for (NWidgetBase *child_wid = this->head; child_wid != nullptr; child_wid = child_wid->next) child_wid->FillDirtyWidgets(dirty_widgets);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** Widget parts of the smallmap display. */
|
||||
|
Reference in New Issue
Block a user