Replies: 2 comments 3 replies
-
This is definitely a solid refactor. Considering the quirky nature of the WoW formats, I am seeing a few loose ends - from a quick birds eye view - here that I consider showstoppers:
If you want to continue with this, I would definitely be interested in seeing more! |
Beta Was this translation helpful? Give feedback.
0 replies
-
I am wondering if using "nom" would be better because it seems to be more suitable for the kind of chunk soup we do find in WoW formats. I could also see a combo of nom and the derive macro approach working really well here. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. I've implemented a complete binary data handling overhaul and applied it to m2 loading on my repository. File parsing and writing is mostly declarative with the rust type system, and it also has native handling of different file versions. I think this can also be applied to all crates, so I implemented it in a new workspace crate called wow-data. I also removed lots of useless testing code and comments. I think it's probably a good idea to incorporate it in the main repo.
Here's an example:
This is all the code that's needed to define the structs, parsing and writing is automatically implemented using the
derive
s, but it's also completely customizable and extendable. This is all the code that's need to parse and write now:Example of the entirety of the parsing code for the model data now, which reads everything according to https://wowdev.wiki/M2: https://github.com/davidrios/warcraft-rs/blob/refactor-data-handling/file-formats/graphics/wow-m2/src/model.rs
Main implementation of shared types and traits: https://github.com/davidrios/warcraft-rs/blob/refactor-data-handling/file-formats/wow-data/src/types.rs
Derive procmacros : https://github.com/davidrios/warcraft-rs/blob/refactor-data-handling/file-formats/wow-data-derive/src/lib.rs
Beta Was this translation helpful? Give feedback.
All reactions