131 sign.left + ScaleByZoom(sign.width_1 + 12, ZOOM_LVL_MAX), |
131 sign.left + ScaleByZoom(sign.width_1 + 12, ZOOM_LVL_MAX), |
132 sign.top + ScaleByZoom(12, ZOOM_LVL_MAX)); |
132 sign.top + ScaleByZoom(12, ZOOM_LVL_MAX)); |
133 } |
133 } |
134 } |
134 } |
135 |
135 |
136 void Station::MarkTilesDirty() const |
136 void Station::MarkTilesDirty(bool cargo_change) const |
137 { |
137 { |
138 TileIndex tile = train_tile; |
138 TileIndex tile = train_tile; |
139 int w, h; |
139 int w, h; |
140 |
140 |
141 /* XXX No station is recorded as 0, not INVALID_TILE... */ |
141 /* XXX No station is recorded as 0, not INVALID_TILE... */ |
142 if (tile == 0) return; |
142 if (tile == 0) return; |
|
143 |
|
144 /* cargo_change is set if we're refreshing the tiles due to cargo moving |
|
145 * around. */ |
|
146 if (cargo_change) { |
|
147 /* Don't waste time updating if there are no custom station graphics |
|
148 * that might change. Even if there are custom graphics, they might |
|
149 * not change. Unfortunately we have no way of telling. */ |
|
150 if (this->num_specs == 0) return; |
|
151 } |
143 |
152 |
144 for (h = 0; h < trainst_h; h++) { |
153 for (h = 0; h < trainst_h; h++) { |
145 for (w = 0; w < trainst_w; w++) { |
154 for (w = 0; w < trainst_w; w++) { |
146 if (TileBelongsToRailStation(tile)) { |
155 if (TileBelongsToRailStation(tile)) { |
147 MarkTileDirtyByTile(tile); |
156 MarkTileDirtyByTile(tile); |