Change: add --no-palette-validation optional arg#322
Merged
glx22 merged 1 commit intoOpenTTD:masterfrom Feb 24, 2024
Merged
Conversation
glx22
reviewed
Feb 24, 2024
nml/main.py
Outdated
| "--no-extra-zoom", action="store_false", dest="allow_extra_zoom", help="Skip extra zoom alternative sprites" | ||
| ) | ||
| opt_parser.add_option("--no-32bpp", action="store_false", dest="allow_32bpp", help="Skip 32bpp alternative sprites") | ||
| opt_parser.add_option("--forcibly-skip-sprite-processing", action="store_true", dest="forcibly_skip_sprite_processing", help="Skip sprite validation processing") |
Contributor
There was a problem hiding this comment.
That's a quite long option name.
Contributor
Author
There was a problem hiding this comment.
Changed to --no-palette-validation
6d7eb3a to
9d74fe2
Compare
glx22
reviewed
Feb 24, 2024
…r sprites if the grf author doesn't need it
6e276c6 to
c2d5d2b
Compare
glx22
approved these changes
Feb 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To defend authors against mixing Windows / DOS palettes in the same grf, nmlc will open all sprite files from the filesystem and validate their palette. This is a separate step to sprite encoding.
For certain cases, this is of no benefit, and just increases compile times. For example, with Iron Horse:
The nmlc palette check adds 1s to 2s to every Iron Horse compile for me, which is 5% to 10% of total compile time.
I previously tried to solve this in #254, by inferring when the sprites might not need processed, but that route was not viable, as it depended too much on assuming that we don't want validation if we're outputting nfo.
This route provides an explicit arg flag for authors to suppress validation.
The names of the flag and option probably are too long and not the best choice.