diff options
Diffstat (limited to 'src/waypoint_cmd.cpp')
-rw-r--r-- | src/waypoint_cmd.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index 986579c83..e2ad292ba 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -26,13 +26,13 @@ #include "table/strings.h" /** - * Update the sign for the waypoint - * @param wp Waypoint to update sign */ -void UpdateWaypointSign(Waypoint *wp) + * Update the virtual coords needed to draw the waypoint sign. + */ +void Waypoint::UpdateVirtCoord() { - Point pt = RemapCoords2(TileX(wp->xy) * TILE_SIZE, TileY(wp->xy) * TILE_SIZE); - SetDParam(0, wp->index); - wp->sign.UpdatePosition(pt.x, pt.y - 0x20, STR_WAYPOINT_VIEWPORT); + Point pt = RemapCoords2(TileX(this->xy) * TILE_SIZE, TileY(this->xy) * TILE_SIZE); + SetDParam(0, this->index); + this->sign.UpdatePosition(pt.x, pt.y - 0x20, STR_WAYPOINT_VIEWPORT); } /** @@ -211,7 +211,7 @@ CommandCost CmdBuildTrainWaypoint(TileIndex tile, DoCommandFlag flags, uint32 p1 if (wp->town_index == INVALID_TOWN) MakeDefaultWaypointName(wp); - UpdateWaypointSign(wp); + wp->UpdateVirtCoord(); wp->sign.MarkDirty(); YapfNotifyTrackLayoutChange(tile, AxisToTrack(axis)); } @@ -319,7 +319,7 @@ CommandCost CmdRenameWaypoint(TileIndex tile, DoCommandFlag flags, uint32 p1, ui wp->name = strdup(text); } - UpdateWaypointSign(wp); + wp->UpdateVirtCoord(); MarkWholeScreenDirty(); } return CommandCost(); |