Skip to content
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

grfID of the extra newgrf for base sets #3385

Closed
DorpsGek opened this issue Dec 18, 2009 · 4 comments
Closed

grfID of the extra newgrf for base sets #3385

DorpsGek opened this issue Dec 18, 2009 · 4 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

planetmaker opened the ticket and wrote:

I tried to define 10 additional shore sprites in OpenGFX's extra newgrf. The corresponding diff and description is found at http://dev.openttdcoop.org/issues/688

Unfortunately the extra newgrf is not recognized as as valid grf to define these, as newgrf.cpp:503 checks IsOpenTTDGRFid for a hard-coded 0xFF4F5400 (or the first three bytes thereof) which is the ID of openttdw.grf as far as I know.

The question now remains, whether not all GRFs starting their ID with FF should be recognized as valid input in these cases and allow other base grfs to use different newgrfIDs for their extra file.

The attached diff introduces a new routine IsBaseGRF which checks for the presence of FF as the first byte of the GRFid. Together with the OpenGFX patch it will then allow
- to use different GRFids for the extra newgrfs of different base sets
- allow the extra newgrfs to define the 10 shore sprites while still allowing newgrfs to define their own shores without glitches.

Something worth considering is to use something like
# define BASEGRFID_IDENTIFIER 0xFF000000
in order to replace the 0xFF000000 and avoid it as magic constant

Tested in trunk r18527

Attachments

Reported version: other
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/3385
@DorpsGek
Copy link
Member Author

planetmaker wrote:

Additionally maybe: http://wiki.ttdpatch.net/tiki-index.php?page=Action8 defines grfIDs starting with FF as internal to TTDP (so I guess also to OTTD). I haven't entirely checked for other places where such check for a general IsBaseGRF might also be more appropriate than IsOpenTTDBaseGRF.

If, on the other hand, any check for a grf starting with FF may return true for IsOpenTTDBaseGRF then the attached patch might help. But... I'm not sure there are cases where it fails horribly.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3385#comment7079

@DorpsGek
Copy link
Member Author

Rubidium wrote:

Just start the GRF ID with FF "OT" and not end with "D" or "W". If you want to I can add this requirement to the specs :)


This comment was imported from FlySpray: https://bugs.openttd.org/task/3385#comment7080

@DorpsGek
Copy link
Member Author

planetmaker wrote:

Well. Fine for me, too. I'll add it to the requirements and we call it closed. We chose 01 then (if you want to keep track of it ;-) )


This comment was imported from FlySpray: https://bugs.openttd.org/task/3385#comment7081

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Not a bug

Thanks to planetmaker the spec's updated too.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3385

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant