1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 17:02:37 +01:00

Codechange: Restructure RoadStop Entries to reduce pointers. (#14069)

A RoadStop must own both west and east `Entry`s, but they are allocated separately.

Combine this allocation into one instead.
This commit is contained in:
Peter Nelson
2025-04-23 08:29:34 +01:00
committed by GitHub
parent 41ed5f9822
commit 6d5aee0545
5 changed files with 53 additions and 62 deletions

View File

@@ -74,9 +74,8 @@ void CheckCaches()
for (const RoadStop *rs : RoadStop::Iterate()) {
if (IsBayRoadStopTile(rs->xy)) continue;
assert(rs->GetEntry(DIAGDIR_NE) != rs->GetEntry(DIAGDIR_NW));
rs->GetEntry(DIAGDIR_NE)->CheckIntegrity(rs);
rs->GetEntry(DIAGDIR_NW)->CheckIntegrity(rs);
rs->GetEntry(DIAGDIR_NE).CheckIntegrity(rs);
rs->GetEntry(DIAGDIR_NW).CheckIntegrity(rs);
}
std::vector<NewGRFCache> grf_cache;