(svn r10062) -Codechange: Don't redraw all station tiles when cargo is added or removed if the station has no custom graphics.

This commit is contained in:
peter1138
2007-06-08 09:35:39 +00:00
parent 29f6ae952c
commit 9c66082b07
5 changed files with 16 additions and 7 deletions

View File

@@ -133,7 +133,7 @@ void Station::MarkDirty() const
}
}
void Station::MarkTilesDirty() const
void Station::MarkTilesDirty(bool cargo_change) const
{
TileIndex tile = train_tile;
int w, h;
@@ -141,6 +141,15 @@ void Station::MarkTilesDirty() const
/* XXX No station is recorded as 0, not INVALID_TILE... */
if (tile == 0) return;
/* cargo_change is set if we're refreshing the tiles due to cargo moving
* around. */
if (cargo_change) {
/* Don't waste time updating if there are no custom station graphics
* that might change. Even if there are custom graphics, they might
* not change. Unfortunately we have no way of telling. */
if (this->num_specs == 0) return;
}
for (h = 0; h < trainst_h; h++) {
for (w = 0; w < trainst_w; w++) {
if (TileBelongsToRailStation(tile)) {