Introduce BinaryFormat extension point#249
Draft
nickbabcock wants to merge 1 commit into
Draft
Conversation
Whereas BinaryFlavor is a more narrow extension point, BinaryFormat trait allows downstream implementations to be almost entirely decoupled from the standard format. A good example of this is HOI4, whose 0x000d token may represent 32 or 64 bits of data. This can't be captured by BinaryFlavor, whereas BinaryFormat can.
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.
The binary format needs 3 features:
0x000das 64 bits since patch 1.17, instead of 32 bits. The patch is contained within the data as an i32 value following an0x349did.0x00eefield.0x0167values are encoded as Q49.15 instead of decimal fixed point. For instance if agoldid field is encountered within the scope ofalive_datathen is encoded as Q49.15 unlike othergoldinstances0x000csignalling an I32 value, and only fallback to generic parsing if this assumption is not met. This should give a healthy speedup.