Rename Polyline struct due to name collision on Windows

This commit is contained in:
Jonathan G Rennison
2018-05-06 09:17:42 +01:00
parent 71852c3f37
commit 53e943386e

View File

@@ -197,7 +197,7 @@ struct LineSnapPoint : Point {
typedef SmallVector<LineSnapPoint, 4> LineSnapPoints; ///< Set of snapping points typedef SmallVector<LineSnapPoint, 4> LineSnapPoints; ///< Set of snapping points
/** Coordinates of a polyline track made of 2 connected line segments. */ /** Coordinates of a polyline track made of 2 connected line segments. */
struct Polyline { struct PolylineInfo {
Point start; ///< The point where the first segment starts (as given in LineSnapPoint). Point start; ///< The point where the first segment starts (as given in LineSnapPoint).
Direction first_dir; ///< Direction of the first line segment. Direction first_dir; ///< Direction of the first line segment.
uint first_len; ///< Length of the first segment - number of track pieces. uint first_len; ///< Length of the first segment - number of track pieces.
@@ -4051,7 +4051,7 @@ Trackdir PointDirToTrackdir(const Point &pt, Direction dir)
return ret; return ret;
} }
static bool FindPolyline(const Point &pt, const LineSnapPoint &start, Polyline *ret) static bool FindPolyline(const Point &pt, const LineSnapPoint &start, PolylineInfo *ret)
{ {
/* relative coordinats of the mouse point (offset against the snap point) */ /* relative coordinats of the mouse point (offset against the snap point) */
int x = pt.x - start.x; int x = pt.x - start.x;
@@ -4157,7 +4157,7 @@ static inline uint SqrDist(const Point &a, const Point &b)
return (b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y); return (b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y);
} }
static LineSnapPoint *FindBestPolyline(const Point &pt, LineSnapPoint *snap_points, uint num_points, Polyline *ret) static LineSnapPoint *FindBestPolyline(const Point &pt, LineSnapPoint *snap_points, uint num_points, PolylineInfo *ret)
{ {
/* Find the best polyline (a pair of two lines - the white one and the blue /* Find the best polyline (a pair of two lines - the white one and the blue
* one) led from any of saved snap points to the mouse cursor. */ * one) led from any of saved snap points to the mouse cursor. */
@@ -4166,7 +4166,7 @@ static LineSnapPoint *FindBestPolyline(const Point &pt, LineSnapPoint *snap_poin
for (int i = 0; i < (int)num_points; i++) { for (int i = 0; i < (int)num_points; i++) {
/* try to fit a polyline */ /* try to fit a polyline */
Polyline polyline; PolylineInfo polyline;
if (!FindPolyline(pt, snap_points[i], &polyline)) continue; // skip non-matching snap points if (!FindPolyline(pt, snap_points[i], &polyline)) continue; // skip non-matching snap points
/* check whether we've found a better polyline */ /* check whether we've found a better polyline */
if (best_snap_point != NULL) { if (best_snap_point != NULL) {
@@ -4395,7 +4395,7 @@ static HighLightStyle CalcPolyrailDrawstyle(Point pt, bool dragging)
} }
/* find the best track */ /* find the best track */
Polyline line; PolylineInfo line;
bool lock_snapping = dragging && snap_mode == RSM_SNAP_TO_RAIL; bool lock_snapping = dragging && snap_mode == RSM_SNAP_TO_RAIL;
if (!lock_snapping) _current_snap_lock.x = -1; if (!lock_snapping) _current_snap_lock.x = -1;