Merge branch 'master' into jgrpp
# Conflicts: # Makefile.src.in # findversion.sh # projects/determineversion.vbs # src/aircraft_cmd.cpp # src/lang/dutch.txt # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/linkgraph_gui.h # src/order_cmd.cpp # src/settings_gui.cpp # src/smallmap_gui.cpp # src/town_cmd.cpp # src/viewport.cpp # src/water_map.h
This commit is contained in:
@@ -74,6 +74,7 @@ void LinkGraphOverlay::RebuildCache(bool incremental)
|
||||
if (!incremental) {
|
||||
this->cached_links.clear();
|
||||
this->cached_stations.clear();
|
||||
this->last_update_number = GetWindowUpdateNumber();
|
||||
}
|
||||
if (this->company_mask == 0) return;
|
||||
|
||||
@@ -344,6 +345,10 @@ void LinkGraphOverlay::RefreshDrawCache()
|
||||
*/
|
||||
void LinkGraphOverlay::Draw(const DrawPixelInfo *dpi)
|
||||
{
|
||||
if (this->dirty) {
|
||||
this->RebuildCache();
|
||||
this->dirty = false;
|
||||
}
|
||||
if (this->last_update_number != GetWindowUpdateNumber()) {
|
||||
this->last_update_number = GetWindowUpdateNumber();
|
||||
this->RefreshDrawCache();
|
||||
|
@@ -75,6 +75,9 @@ public:
|
||||
void SetCargoMask(CargoTypes cargo_mask);
|
||||
void SetCompanyMask(uint32 company_mask);
|
||||
|
||||
/** Mark the linkgraph dirty to be rebuilt next time Draw() is called. */
|
||||
void SetDirty() { this->dirty = true; }
|
||||
|
||||
/** Get a bitmask of the currently shown cargoes. */
|
||||
CargoTypes GetCargoMask() { return this->cargo_mask; }
|
||||
|
||||
@@ -90,6 +93,7 @@ protected:
|
||||
StationSupplyList cached_stations; ///< Cache for stations to be drawn.
|
||||
Rect cached_region; ///< Region covered by cached_links and cached_stations.
|
||||
uint scale; ///< Width of link lines.
|
||||
bool dirty; ///< Set if overlay should be rebuilt.
|
||||
uint64 last_update_number = 0; ///< Last window update number
|
||||
|
||||
Point GetStationMiddle(const Station *st) const;
|
||||
|
Reference in New Issue
Block a user