src/roadveh_cmd.cpp
changeset 8813 6d054db96ede
parent 8798 eea3a465bd86
child 8846 f3e877a92e2b
equal deleted inserted replaced
8812:1d894693b4da 8813:6d054db96ede
   562 
   562 
   563 void RoadVehicle::MarkDirty()
   563 void RoadVehicle::MarkDirty()
   564 {
   564 {
   565 	for (Vehicle *v = this; v != NULL; v = v->Next()) {
   565 	for (Vehicle *v = this; v != NULL; v = v->Next()) {
   566 		v->cur_image = v->GetImage(v->direction);
   566 		v->cur_image = v->GetImage(v->direction);
   567 		MarkAllViewportsDirty(v->left_coord, v->top_coord, v->right_coord + 1, v->bottom_coord + 1);
   567 		MarkSingleVehicleDirty(v);
   568 	}
   568 	}
   569 }
   569 }
   570 
   570 
   571 void RoadVehicle::UpdateDeltaXY(Direction direction)
   571 void RoadVehicle::UpdateDeltaXY(Direction direction)
   572 {
   572 {
   613 	RebuildVehicleLists();
   613 	RebuildVehicleLists();
   614 	InvalidateWindow(WC_COMPANY, v->owner);
   614 	InvalidateWindow(WC_COMPANY, v->owner);
   615 
   615 
   616 	if (IsTileType(v->tile, MP_STATION)) ClearCrashedStation(v);
   616 	if (IsTileType(v->tile, MP_STATION)) ClearCrashedStation(v);
   617 
   617 
   618 	BeginVehicleMove(v);
   618 	MarkSingleVehicleDirty(v);
   619 	EndVehicleMove(v);
       
   620 
   619 
   621 	delete v;
   620 	delete v;
   622 }
   621 }
   623 
   622 
   624 static byte SetRoadVehPosition(Vehicle *v, int x, int y)
   623 static byte SetRoadVehPosition(Vehicle *v, int x, int y)
   688 	for (Vehicle *u = v; u != NULL; u = u->Next()) {
   687 	for (Vehicle *u = v; u != NULL; u = u->Next()) {
   689 		if (IsCargoInClass(u->cargo_type, CC_PASSENGERS)) pass += u->cargo.Count();
   688 		if (IsCargoInClass(u->cargo_type, CC_PASSENGERS)) pass += u->cargo.Count();
   690 
   689 
   691 		u->vehstatus |= VS_CRASHED;
   690 		u->vehstatus |= VS_CRASHED;
   692 
   691 
   693 		MarkAllViewportsDirty(u->left_coord, u->top_coord, u->right_coord + 1, u->bottom_coord + 1);
   692 		MarkSingleVehicleDirty(u);
   694 	}
   693 	}
   695 
   694 
   696 	ClearSlot(v);
   695 	ClearSlot(v);
   697 
   696 
   698 	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
   697 	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);