monkeyman192 / MBINCompiler

A tool for decompiling No Man's Sky .MBIN files to XML format
https://monkeyman192.github.io/MBINCompiler
Other
253 stars 50 forks source link

Fixes for scene files and AlignOf optimization #596

Closed monkeyman192 closed 7 months ago

monkeyman192 commented 7 months ago

First set of changes to try fix some issues. This should get scene files working again. I had to remove the custom deserialization code since it was causing issues now that the NameHash field is before the Name field. I don't think this was really being used anyway so hopefully it's fine... (The value it would set was wrong anyway...)

I also added an optimization to the AlignOf method in NMSTemplate to utilize the fact that the first field of a class will always have the largest offset, so we no longer need to recursively go through all fields of a class to figure out the alignment, but can instead stop at the first one. Not sure if this will have any noticable change, but it's a free optimization...