Merge branch 'master' into auto_timetables

This commit is contained in:
Jonathan G Rennison
2015-08-09 17:07:41 +01:00
242 changed files with 5938 additions and 4594 deletions

View File

@@ -1500,11 +1500,10 @@ void Vehicle::UpdateViewport(bool dirty)
this->MarkAllViewportsDirty();
} else {
::MarkAllViewportsDirty(
min(old_coord.left, this->coord.left),
min(old_coord.top, this->coord.top),
max(old_coord.right, this->coord.right) + 1 * ZOOM_LVL_BASE,
max(old_coord.bottom, this->coord.bottom) + 1 * ZOOM_LVL_BASE
);
min(old_coord.left, this->coord.left),
min(old_coord.top, this->coord.top),
max(old_coord.right, this->coord.right),
max(old_coord.bottom, this->coord.bottom));
}
}
}
@@ -1523,7 +1522,7 @@ void Vehicle::UpdatePositionAndViewport()
*/
void Vehicle::MarkAllViewportsDirty() const
{
::MarkAllViewportsDirty(this->coord.left, this->coord.top, this->coord.right + 1 * ZOOM_LVL_BASE, this->coord.bottom + 1 * ZOOM_LVL_BASE);
::MarkAllViewportsDirty(this->coord.left, this->coord.top, this->coord.right, this->coord.bottom);
}
/**
@@ -2428,7 +2427,9 @@ void Vehicle::ShowVisualEffect() const
return;
}
uint max_speed = this->vcache.cached_max_speed;
/* Use the speed as limited by underground and orders. */
uint max_speed = this->GetCurrentMaxSpeed();
if (this->type == VEH_TRAIN) {
const Train *t = Train::From(this);
/* For trains, do not show any smoke when:
@@ -2437,14 +2438,10 @@ void Vehicle::ShowVisualEffect() const
*/
if (HasBit(t->flags, VRF_REVERSING) ||
(IsRailStationTile(t->tile) && t->IsFrontEngine() && t->current_order.ShouldStopAtStation(t, GetStationIndex(t->tile)) &&
t->cur_speed >= t->Train::GetCurrentMaxSpeed())) {
t->cur_speed >= max_speed)) {
return;
}
max_speed = min(max_speed, t->gcache.cached_max_track_speed);
max_speed = min(max_speed, this->current_order.GetMaxSpeed());
}
if (this->type == VEH_ROAD || this->type == VEH_SHIP) max_speed = min(max_speed, this->current_order.GetMaxSpeed() * 2);
const Vehicle *v = this;