(svn r16764) -Codechange: unify the way viewport signs are marked dirty

This commit is contained in:
rubidium
2009-07-08 08:30:35 +00:00
parent b9e4c6653c
commit bb78e5bb14
13 changed files with 38 additions and 80 deletions

View File

@@ -35,18 +35,6 @@ void UpdateWaypointSign(Waypoint *wp)
wp->sign.UpdatePosition(pt.x, pt.y - 0x20, STR_WAYPOINT_VIEWPORT);
}
/**
* Redraw the sign of a waypoint
* @param wp Waypoint to redraw sign */
void RedrawWaypointSign(const Waypoint *wp)
{
MarkAllViewportsDirty(
wp->sign.left - 6,
wp->sign.top,
wp->sign.left + (wp->sign.width_1 << 2) + 12,
wp->sign.top + 48);
}
/**
* Set the default name for a waypoint
* @param wp Waypoint to work on
@@ -192,7 +180,7 @@ CommandCost CmdBuildTrainWaypoint(TileIndex tile, DoCommandFlag flags, uint32 p1
}
}
RedrawWaypointSign(wp);
wp->sign.MarkDirty();
wp->xy = tile;
InvalidateWindowData(WC_WAYPOINT_VIEW, wp->index);
}
@@ -224,7 +212,7 @@ CommandCost CmdBuildTrainWaypoint(TileIndex tile, DoCommandFlag flags, uint32 p1
if (wp->town_index == INVALID_TOWN) MakeDefaultWaypointName(wp);
UpdateWaypointSign(wp);
RedrawWaypointSign(wp);
wp->sign.MarkDirty();
YapfNotifyTrackLayoutChange(tile, AxisToTrack(axis));
}
@@ -254,7 +242,7 @@ CommandCost RemoveTrainWaypoint(TileIndex tile, DoCommandFlag flags, bool justre
wp = GetWaypointByTile(tile);
wp->deleted = 30; // let it live for this many days before we do the actual deletion.
RedrawWaypointSign(wp);
wp->sign.MarkDirty();
Train *v = NULL;
if (justremove) {