mirror of https://github.com/OpenTTD/OpenTTD
Change: Limit scheduled window invalidation events to just one.
Stacking up window invalidation events does not serve much use as in all cases the data passed is the same. When processing the events, it would then invalidate windows multiple times for no reason.pull/11896/head
parent
8a4a99b7e8
commit
82872d0a29
|
@ -3121,8 +3121,10 @@ void Window::InvalidateData(int data, bool gui_scope)
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
if (!gui_scope) {
|
if (!gui_scope) {
|
||||||
/* Schedule GUI-scope invalidation for next redraw. */
|
/* Schedule GUI-scope invalidation for next redraw. */
|
||||||
|
if (std::find(std::begin(this->scheduled_invalidation_data), std::end(this->scheduled_invalidation_data), data) == std::end(this->scheduled_invalidation_data)) {
|
||||||
this->scheduled_invalidation_data.push_back(data);
|
this->scheduled_invalidation_data.push_back(data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this->OnInvalidateData(data, gui_scope);
|
this->OnInvalidateData(data, gui_scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue