Feature: [NewGRF] Allow fixed layout up to 256 tiles per NewGRF rail station.
Allow using up to 256 tile layouts in property 0E or callback 24, which defines the layout to be saved into the map. This was originally limited to 8, because station graphics above 8 referred to other station types but that was changed in 2007. 1) More efficient than using callback 14, as that needs to be checked every time a station tile is rendered. 2) The layout does not get changed when the station is changed (this may or may not be desirable!) Using more than 256 layouts still requires callback 14.
This commit is contained in:
committed by
Peter Nelson
parent
d08636c841
commit
6e553410d3
@@ -1475,7 +1475,7 @@ CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailTyp
|
||||
/* As the station is not yet completely finished, the station does not yet exist. */
|
||||
uint16_t callback = GetStationCallback(CBID_STATION_BUILD_TILE_LAYOUT, platinfo, 0, statspec, nullptr, tile);
|
||||
if (callback != CALLBACK_FAILED) {
|
||||
if (callback < 8) {
|
||||
if (callback <= UINT8_MAX) {
|
||||
SetStationGfx(tile, (callback & ~1) + axis);
|
||||
} else {
|
||||
ErrorUnknownCallbackResult(statspec->grf_prop.grffile->grfid, CBID_STATION_BUILD_TILE_LAYOUT, callback);
|
||||
|
||||
Reference in New Issue
Block a user