MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / MarkTilesDirty

Method MarkTilesDirty

src/station.cpp:247–265  ·  view source on GitHub ↗

* Marks the tiles of the station as dirty. * * @ingroup dirty */

Source from the content-addressed store, hash-verified

245 * @ingroup dirty
246 */
247void Station::MarkTilesDirty(bool cargo_change) const
248{
249 if (this->train_station.tile == INVALID_TILE) return;
250
251 /* cargo_change is set if we're refreshing the tiles due to cargo moving
252 * around. */
253 if (cargo_change) {
254 /* Don't waste time updating if there are no custom station graphics
255 * that might change. Even if there are custom graphics, they might
256 * not change. Unfortunately we have no way of telling. */
257 if (this->speclist.empty()) return;
258 }
259
260 for (TileIndex tile : this->train_station) {
261 if (this->TileBelongsToRailStation(tile)) {
262 MarkTileDirtyByTile(tile);
263 }
264 }
265}
266
267/* virtual */ uint Station::GetPlatformLength(TileIndex tile) const
268{

Callers 5

BeginLoadingMethod · 0.80
CmdBuildRailStationFunction · 0.80
CmdRemoveFromRailStationFunction · 0.80
UpdateStationWaitingFunction · 0.80
LoadUnloadVehicleFunction · 0.80

Calls 3

MarkTileDirtyByTileFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected