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

Function AddSideToSignalBuffer

src/signal.cpp:621–635  ·  view source on GitHub ↗

* Add side of tile to signal update buffer * * @param tile tile where we start * @param side side of tile * @param owner owner whose signals we will update */

Source from the content-addressed store, hash-verified

619 * @param owner owner whose signals we will update
620 */
621void AddSideToSignalBuffer(TileIndex tile, DiagDirection side, Owner owner)
622{
623 /* do not allow signal updates for two companies in one run */
624 assert(_globset.IsEmpty() || owner == _last_owner);
625
626 _last_owner = owner;
627
628 _globset.Add(tile, side);
629
630 if (_globset.Items() >= SIG_GLOB_UPDATE) {
631 /* too many items, force update */
632 UpdateSignalsInBuffer(_last_owner);
633 _last_owner = INVALID_OWNER;
634 }
635}
636
637/**
638 * Update signals, starting at one side of a tile

Callers 7

CmdBuildTrainDepotFunction · 0.85
RemoveTrainDepotFunction · 0.85
CmdBuildBridgeFunction · 0.85
CmdBuildTunnelFunction · 0.85
DoClearTunnelFunction · 0.85
DoClearBridgeFunction · 0.85

Calls 4

UpdateSignalsInBufferFunction · 0.85
ItemsMethod · 0.80
IsEmptyMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected