Debug: Add new signals support to GRF debug window

This commit is contained in:
Jonathan G Rennison
2022-06-15 21:36:55 +01:00
parent 41117a52d2
commit 4d04a757cc
5 changed files with 114 additions and 12 deletions

View File

@@ -1378,6 +1378,21 @@ TraceRestrictProgram *GetTraceRestrictProgram(TraceRestrictRefId ref, bool creat
}
}
/**
* Gets the first signal program for the given tile
* This is for debug/display purposes only
*/
TraceRestrictProgram *GetFirstTraceRestrictProgramOnTile(TileIndex t)
{
// First mapping for this tile, or later
TraceRestrictMapping::iterator lower_bound = _tracerestrictprogram_mapping.lower_bound(MakeTraceRestrictRefId(t, static_cast<Track>(0)));
if ((lower_bound != _tracerestrictprogram_mapping.end()) && (GetTraceRestrictRefIdTileIndex(lower_bound->first) == t)) {
return _tracerestrictprogram_pool.Get(lower_bound->second.program_id);
}
return nullptr;
}
/**
* Notify that a signal is being removed
* Remove any trace restrict mappings associated with it