mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 18:40:29 +00:00
Codechange: Don't access SmallMapWindow method directly from LinkGraphOverlay.
This commit is contained in:
parent
ff5e8bb9a3
commit
f91462f54b
@ -425,7 +425,7 @@ Point LinkGraphOverlay::GetStationMiddle(const Station *st) const
|
||||
return GetViewportStationMiddle(this->window->viewport, st);
|
||||
} else {
|
||||
/* assume this is a smallmap */
|
||||
return static_cast<const SmallMapWindow *>(this->window)->GetStationMiddle(st);
|
||||
return GetSmallMapStationMiddle(this->window, st);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1888,3 +1888,13 @@ bool ScrollMainWindowTo(int x, int y, int z, bool instant)
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the middle of a station in the smallmap window.
|
||||
* @param st The station we're looking for.
|
||||
* @return Middle point of the station in the smallmap window.
|
||||
*/
|
||||
Point GetSmallMapStationMiddle(const Window *w, const Station *st)
|
||||
{
|
||||
return static_cast<const SmallMapWindow *>(w)->GetStationMiddle(st);
|
||||
}
|
||||
|
@ -212,4 +212,6 @@ public:
|
||||
void OnMouseOver([[maybe_unused]] Point pt, int widget) override;
|
||||
};
|
||||
|
||||
Point GetSmallMapStationMiddle(const Window *w, const Station *st);
|
||||
|
||||
#endif /* SMALLMAP_GUI_H */
|
||||
|
Loading…
Reference in New Issue
Block a user