Codechange: Use std::vector for NewGRF station tile sprite layouts.

This commit is contained in:
Peter Nelson
2021-05-01 20:28:23 +01:00
committed by PeterN
parent bd1a20f6ee
commit a3e49178d1
4 changed files with 26 additions and 27 deletions

View File

@@ -798,10 +798,10 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID
const NewGRFSpriteLayout *layout = nullptr;
DrawTileSprites tmp_rail_layout;
if (statspec->renderdata == nullptr) {
if (statspec->renderdata.empty()) {
sprites = GetStationTileLayout(STATION_RAIL, tile + axis);
} else {
layout = &statspec->renderdata[(tile < statspec->tiles) ? tile + axis : (uint)axis];
layout = &statspec->renderdata[(tile < statspec->renderdata.size()) ? tile + axis : (uint)axis];
if (!layout->NeedsPreprocessing()) {
sprites = layout;
layout = nullptr;