mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r7313) -Codechange: Calling invalidate data on a window will surely warrant a redraw, so call
that after the WE_INVALIDATE_DATA event and remove (some of) the superflouous calls.
This commit is contained in:
parent
9b4d3ff4b8
commit
04f9944746
|
@ -402,7 +402,6 @@ int32 CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||
GetPlayer(_current_player)->num_engines[p1]++;
|
||||
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
RebuildVehicleLists();
|
||||
InvalidateWindow(WC_COMPANY, v->owner);
|
||||
if (IsLocalPlayer())
|
||||
|
@ -1435,7 +1434,6 @@ static void AircraftLeaveHangar(Vehicle *v)
|
|||
VehicleServiceInDepot(v);
|
||||
SetAircraftPosition(v, v->x_pos, v->y_pos, v->z_pos);
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
|
||||
}
|
||||
|
||||
|
|
|
@ -428,7 +428,6 @@ static void NewAircraftWndProc(Window *w, WindowEvent *e)
|
|||
switch (e->event) {
|
||||
case WE_INVALIDATE_DATA:
|
||||
GenerateBuildList(w);
|
||||
SetWindowDirty(w);
|
||||
break;
|
||||
|
||||
case WE_DESTROY:
|
||||
|
|
|
@ -2010,11 +2010,10 @@ static uint32 VehicleEnter_Track(Vehicle *v, TileIndex tile, int x, int y)
|
|||
v->u.rail.track = 0x80,
|
||||
v->vehstatus |= VS_HIDDEN; /* hide it */
|
||||
v->direction = ReverseDir(v->direction);
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
if (v->next == NULL)
|
||||
VehicleEnterDepot(v);
|
||||
if (v->next == NULL) VehicleEnterDepot(v);
|
||||
v->tile = tile;
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, tile);
|
||||
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
return 4;
|
||||
}
|
||||
} else if (fract_coord_leave == fract_coord) {
|
||||
|
|
|
@ -195,7 +195,6 @@ int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||
GetPlayer(_current_player)->num_engines[p1]++;
|
||||
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
RebuildVehicleLists();
|
||||
InvalidateWindow(WC_COMPANY, v->owner);
|
||||
if (IsLocalPlayer())
|
||||
|
@ -1307,7 +1306,6 @@ static void RoadVehController(Vehicle *v)
|
|||
SetRoadVehPosition(v,x,y);
|
||||
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -455,10 +455,6 @@ void CcBuildRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2)
|
|||
static void NewRoadVehWndProc(Window *w, WindowEvent *e)
|
||||
{
|
||||
switch (e->event) {
|
||||
case WE_INVALIDATE_DATA:
|
||||
SetWindowDirty(w);
|
||||
break;
|
||||
|
||||
case WE_PAINT:
|
||||
DrawNewRoadVehWindow(w);
|
||||
break;
|
||||
|
|
|
@ -884,7 +884,6 @@ int32 CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||
GetPlayer(_current_player)->num_engines[p1]++;
|
||||
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
RebuildVehicleLists();
|
||||
InvalidateWindow(WC_COMPANY, v->owner);
|
||||
if (IsLocalPlayer())
|
||||
|
|
|
@ -242,10 +242,6 @@ void CcCloneShip(bool success, TileIndex tile, uint32 p1, uint32 p2)
|
|||
static void NewShipWndProc(Window *w, WindowEvent *e)
|
||||
{
|
||||
switch (e->event) {
|
||||
case WE_INVALIDATE_DATA:
|
||||
SetWindowDirty(w);
|
||||
break;
|
||||
|
||||
case WE_PAINT: {
|
||||
EngineID selected_id;
|
||||
EngineID eid;
|
||||
|
|
|
@ -851,7 +851,6 @@ int32 CmdBuildRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||
|
||||
GetPlayer(_current_player)->num_engines[p1]++;
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, tile);
|
||||
RebuildVehicleLists();
|
||||
InvalidateWindow(WC_COMPANY, v->owner);
|
||||
if (IsLocalPlayer()) {
|
||||
|
@ -1682,7 +1681,6 @@ static void ReverseTrainDirection(Vehicle *v)
|
|||
|
||||
if (IsTileDepotType(v->tile, TRANSPORT_RAIL)) {
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
}
|
||||
|
||||
/* Check if we were approaching a rail/road-crossing */
|
||||
|
@ -1716,7 +1714,6 @@ static void ReverseTrainDirection(Vehicle *v)
|
|||
|
||||
if (IsTileDepotType(v->tile, TRANSPORT_RAIL)) {
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
}
|
||||
|
||||
CLRBIT(v->u.rail.flags, VRF_REVERSING);
|
||||
|
@ -2213,7 +2210,6 @@ static bool CheckTrainStayInDepot(Vehicle *v)
|
|||
UpdateSignalsOnSegment(v->tile, DirToDiagDir(v->direction));
|
||||
UpdateTrainAcceleration(v);
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -473,7 +473,6 @@ static void NewRailVehicleWndProc(Window *w, WindowEvent *e)
|
|||
|
||||
case WE_INVALIDATE_DATA:
|
||||
GenerateBuildList(w);
|
||||
SetWindowDirty(w);
|
||||
break;
|
||||
|
||||
case WE_DESTROY:
|
||||
|
|
Loading…
Reference in New Issue