New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: [NewGRF] Allow fixed layout up to 256 tiles per NewGRF rail station. #12554
base: master
Are you sure you want to change the base?
Conversation
…AYOUT. These callbacks both select rail station tile layouts, the difference is one happens when drawing, the other happens when building. Change the names to make this clearer.
Using std::span provides both the start and end of the list, which allows validating that the requested layout is in range.
My understanding of station tiles was, they are mostly used to control |
The only reason for that's what "they are mostly used to control" is because with only 8 layouts there isn't flexibility to do much else. Added new property 1E to define per-tile flags as a list. |
…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.
Properties 11, 14 and 15 to set pylons/nowires/blocked intrinsically only support 8 station tiles. Add new property to define all three flags for each station tile layout.
An additional (but out of scope) idea that may be desirable is to automatically "rebuild" the layout if parts are over-built or removed, so it could behave as a semi-dynamic layout. |
Motivation / Problem
Station layouts may contain more than 8 different tile types, but due to hysterical reasons, only 8 tiles can be used and stored in the map on build.
Callback 24 exists which allows to choose the fixed layout dynamically but this is still limited to 8.
Using more than this requires using callback 14, which allows more (more than 256 even) but also requires complex calculations for each station tile to be drawn.
The technical limit that originally prevented using more than 8 tile layouts on the map was removed in 2007, in commit 3dd6362.
Description
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.
Using more than 256 layouts still requires callback 14.
Limitations
Not actually tested as this requires skill at creating NewGRF stations...
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.