Codechange: Make TileLayoutSpriteGroup::ProcessRegisters return a DrawTileSpriteSpan on the stack, instead of a reference to a global.

This commit is contained in:
frosch
2025-05-05 18:51:26 +02:00
committed by frosch
parent 51a7edd941
commit d9c43e7fda
11 changed files with 41 additions and 44 deletions
+4 -4
View File
@@ -293,12 +293,12 @@ void DrawRoadStopTile(int x, int y, RoadType roadtype, const RoadStopSpec *spec,
RoadStopResolverObject object(spec, nullptr, INVALID_TILE, roadtype, type, view);
const auto *group = object.Resolve<TileLayoutSpriteGroup>();
if (group == nullptr) return;
const DrawTileSprites *dts = group->ProcessRegisters(nullptr);
auto dts = group->ProcessRegisters(nullptr);
PaletteID palette = GetCompanyPalette(_local_company);
SpriteID image = dts->ground.sprite;
PaletteID pal = dts->ground.pal;
SpriteID image = dts.ground.sprite;
PaletteID pal = dts.ground.pal;
RoadStopDrawModes draw_mode;
if (spec->flags.Test(RoadStopSpecFlag::DrawModeRegister)) {
@@ -340,7 +340,7 @@ void DrawRoadStopTile(int x, int y, RoadType roadtype, const RoadStopSpec *spec,
}
}
DrawCommonTileSeqInGUI(x, y, dts, 0, 0, palette, true);
DrawCommonTileSeqInGUI(x, y, &dts, 0, 0, palette, true);
}
const TileLayoutSpriteGroup *GetRoadStopLayout(TileInfo *ti, const RoadStopSpec *spec, BaseStation *st, StationType type, int view)