summaryrefslogtreecommitdiff
path: root/src/ship_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-09-13 19:15:59 +0000
committerfrosch <frosch@openttd.org>2009-09-13 19:15:59 +0000
commitebd916be3def20902cf19ffd16555074728eb9c3 (patch)
treec7748d7612a61b9558ffd10ffb176e34584f2376 /src/ship_cmd.cpp
parent5de9cc46b50b8e677395543c10b26b59c860212b (diff)
downloadopenttd-ebd916be3def20902cf19ffd16555074728eb9c3.tar.xz
(svn r17532) -Codechange: Rename several Invalidate functions to SetDirty for more consistency and distinguishability.
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r--src/ship_cmd.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 5b1e005fe..a88d4f429 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -146,14 +146,14 @@ static void CheckIfShipNeedsService(Vehicle *v)
if (depot == NULL || DistanceManhattan(v->tile, depot->xy) > 12) {
if (v->current_order.IsType(OT_GOTO_DEPOT)) {
v->current_order.MakeDummy();
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
+ SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return;
}
v->current_order.MakeGoToDepot(depot->index, ODTFB_SERVICE);
v->dest_tile = depot->xy;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
+ SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
Money Ship::GetRunningCost() const
@@ -181,9 +181,9 @@ void Ship::OnNewDay()
SubtractMoneyFromCompanyFract(this->owner, cost);
- InvalidateWindow(WC_VEHICLE_DETAILS, this->index);
+ SetWindowDirty(WC_VEHICLE_DETAILS, this->index);
/* we need this for the profit */
- InvalidateWindowClasses(WC_SHIPS_LIST);
+ SetWindowClassesDirty(WC_SHIPS_LIST);
}
Trackdir Ship::GetVehicleTrackdir() const
@@ -212,8 +212,8 @@ static void HandleBrokenShip(Vehicle *v)
if (v->breakdowns_since_last_service != 255)
v->breakdowns_since_last_service++;
- InvalidateWindow(WC_VEHICLE_VIEW, v->index);
- InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
+ SetWindowDirty(WC_VEHICLE_VIEW, v->index);
+ SetWindowDirty(WC_VEHICLE_DETAILS, v->index);
if (!PlayVehicleSound(v, VSE_BREAKDOWN)) {
SndPlayVehicleFx((_settings_game.game_creation.landscape != LT_TOYLAND) ?
@@ -229,7 +229,7 @@ static void HandleBrokenShip(Vehicle *v)
if (!(v->tick_counter & 1)) {
if (!--v->breakdown_delay) {
v->breakdown_ctr = 0;
- InvalidateWindow(WC_VEHICLE_VIEW, v->index);
+ SetWindowDirty(WC_VEHICLE_VIEW, v->index);
}
}
}
@@ -290,7 +290,7 @@ void Ship::UpdateDeltaXY(Direction direction)
void RecalcShipStuff(Vehicle *v)
{
v->UpdateViewport(false, true);
- InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
+ SetWindowDirty(WC_VEHICLE_DEPOT, v->tile);
}
static const TileIndexDiffC _ship_leave_depot_offs[] = {
@@ -324,7 +324,7 @@ static void CheckShipLeaveDepot(Ship *v)
PlayShipSound(v);
VehicleServiceInDepot(v);
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
- InvalidateWindowClasses(WC_SHIPS_LIST);
+ SetWindowClassesDirty(WC_SHIPS_LIST);
}
static bool ShipAccelerate(Vehicle *v)
@@ -338,7 +338,7 @@ static bool ShipAccelerate(Vehicle *v)
if (spd != v->cur_speed) {
v->cur_speed = spd;
if (_settings_client.gui.vehicle_speed)
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
+ SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
/* Decrease somewhat when turning */
@@ -627,7 +627,7 @@ static void ShipController(Ship *v)
* always skip ahead. */
if (v->current_order.IsType(OT_LEAVESTATION)) {
v->current_order.Free();
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
+ SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
} else if (v->dest_tile != 0) {
/* We have a target, let's see if we reached it... */
if (v->current_order.IsType(OT_GOTO_WAYPOINT) &&
@@ -819,7 +819,7 @@ CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
InvalidateWindowClassesData(WC_SHIPS_LIST, 0);
- InvalidateWindow(WC_COMPANY, v->owner);
+ SetWindowDirty(WC_COMPANY, v->owner);
if (IsLocalCompany())
InvalidateAutoreplaceWindow(v->engine_type, v->group_id); // updates the replace Ship window
@@ -948,8 +948,8 @@ CommandCost CmdRefitShip(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
v->cargo_subtype = new_subtype;
v->colourmap = PAL_NONE; // invalidate vehicle colour map
v->InvalidateNewGRFCacheOfChain();
- InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
- InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
+ SetWindowDirty(WC_VEHICLE_DETAILS, v->index);
+ SetWindowDirty(WC_VEHICLE_DEPOT, v->tile);
InvalidateWindowClassesData(WC_SHIPS_LIST, 0);
}