Commit graph

53 commits

Author SHA1 Message Date
47830cb926 Add more documentation for DateTime 2025-03-02 17:39:41 -05:00
bf3a1f9266 Add more documentation for LinearColor 2025-03-02 17:37:39 -05:00
6deddba56f Add more documentation for Guid 2025-03-02 17:35:13 -05:00
44ec3ada48 Add and re-organize more documentation 2025-03-02 17:32:18 -05:00
ca6e9cccac Move structures to top-level module 2025-03-02 17:22:23 -05:00
930aeb6956 Begin documenting properties, move them to the top-level module 2025-03-02 17:16:11 -05:00
3b26da6b57 Reorganize the entire project 2025-03-02 17:03:20 -05:00
53aba498d1 Remove some unused imports 2025-03-02 16:28:49 -05:00
d622799cfa Various set and map fixes, add structured object support 2025-03-02 16:28:17 -05:00
0b461c5b86 Remove more unused things 2025-03-02 14:29:39 -05:00
35fa818827 Move structs to their own files 2025-03-02 14:28:22 -05:00
fe745be3e3 Run clippy autofix and fmt 2025-03-02 14:13:41 -05:00
6b436b7af2 Rename PrimaryAssetNameProperty to GenericProperty 2025-03-02 14:12:26 -05:00
9424aa72fa Remove now unused StructField struct 2025-03-02 14:10:29 -05:00
4801c2678a Add new PropertyBase trait, implement more things needed for writing
The biggest change is that structs and properties now provide their own name,
which is needed when we want to write everything back to a file. Also a bunch of
reorganization of stuff I didn't understand before.
2025-03-02 14:07:39 -05:00
08ac990c15 Fix primary asset id and type tests 2025-03-01 20:05:51 -05:00
b0fbf39305 Update progress of the parser in the README
Almost everything can be read now, with only a few exceptions. Note that
write support is not yet complete.
2025-02-25 19:56:38 -05:00
9fa11ab760 Check entries that actually exist in slot roundtrip test
This doesn't fix it yet (because we're lacking some write capabilities)
but now it shouldn't assert before it even tries.
2025-02-25 19:54:48 -05:00
1be9734f65 Write "None" entry at the end of tagged objects
This also fixes the local profile roundtrip test.
2025-02-25 19:53:00 -05:00
ccc7182315 Fixup enum property test 2025-02-25 19:47:51 -05:00
22d431d410 Add actual members of DATriggerData 2025-02-25 19:45:36 -05:00
0474a68f26 Remove (currently) unused DACharacterCommonStatusStruct
I forgot where this is from (Player.sav maybe?) but I don't know what it
is yet. I'll add it back once I come across it again.
2025-02-25 19:37:42 -05:00
2e0403beb1 Add a much better, faster and more ergonomic way to parse structs
This adds a macro that helps deserialize structs when their properties &
types are known ahead of time. It's sole job is gluing different binrw
macros together so I don't have to.

The nice thing about this is that you have more direct access to the
underlying data.
2025-02-25 19:30:16 -05:00
cdb40e62cc Improve tagged object deserialization even more
Now there should be less random "Nones" and more resilient parsing based
on reported sizes and not EOF.
2025-02-24 18:33:32 -05:00
e725df9374 Hide compressed blocks from binrw output 2025-02-24 18:21:25 -05:00
2ce74d3177 Add TODO about none checks 2025-02-24 18:20:23 -05:00
111af5788d Add support for SoftObjectProperty
With this, my Persistent.sav can be now be parsed without errors!
2025-02-24 18:19:23 -05:00
be82857aba Find the magical missing bytes at the end of Persistent.sav
Turns out there can be multiple compressed blocks in a single .sav file,
so now we read all of them.
2025-02-24 18:15:54 -05:00
153c8610c9 Check magic of compressed .sav files 2025-02-24 17:48:17 -05:00
df33a0aace Fix DALoadOptionStruct and SaveSlotInfoStruct 2025-02-24 17:47:59 -05:00
8f55d00e24 Complete Persistent.sav parsing, fix up a ton of things
This is unfortunately one giant commit, but this now (partially) parses
Persistent.sav. There is still some structs and data left to parse, and
we're suspiciously missing 3KiB of data at the end. But... progress!
2025-02-24 00:30:16 -05:00
02269ecc68 Add roundtrip test for LocalProfile.sav 2025-02-23 17:04:26 -05:00
46e0cb3fb2 Add writing support for MapProperty 2025-02-23 16:52:54 -05:00
0561036f01 Add writing support for ArrayProperty 2025-02-23 16:50:10 -05:00
80b288051c Add writing support for FloatProperty 2025-02-23 16:39:59 -05:00
ee2de9c9ae Add writing support for IntProperty 2025-02-23 16:38:57 -05:00
ff87348e42 Add writing support for booleans and BoolProperty 2025-02-23 16:33:25 -05:00
beaa0e784f Add writing support for strings and StrProperty 2025-02-23 16:31:30 -05:00
8713a48351 De-duplicate all the GUID structs, implement better debug display
This replaces several of the duplicate GUID-like structs, and throws
them into a struct that more closely resembles FGuid.
2025-02-23 16:14:44 -05:00
5329fa08b2 Replace fragile string parsing in structs 2025-02-23 16:04:38 -05:00
4eb1e7dd04 Remove old magic-based property enum
This is now replaced by the pre_assert and string-based version, which
is superior.
2025-02-23 16:03:08 -05:00
ef0f4adb6f Replace manual string parsing/old property-magic system in Entry 2025-02-23 16:00:35 -05:00
fe2cb4e624 Remove NameProperty
This has the same memory layout as StringProperty, and we don't need to
duplicate the work.
2025-02-23 15:54:17 -05:00
21ab9f2cb0 Fix and simplify string property parsing, add test
I figured out what the actual layout of this property is (instead of
guessing, which created some bad results.) And added tests of course!

Also fixed a bug in read_string_with_length() that didn't handle the
case where the string length is zero.
2025-02-23 15:52:21 -05:00
6b7d4c66dd Improve error handling in the map and array custom parsers 2025-02-23 15:26:52 -05:00
f304304d19 Simplify string reading
A lot of them are just u32 length + byte string, and can be moved into
a common parsing function.
2025-02-23 15:25:50 -05:00
a4615b29ce Remove leftover binrw debugging 2025-02-23 15:04:13 -05:00
e5b9e9150e Remove currently unused EnumProperty 2025-02-23 15:03:32 -05:00
7766b3cd5d Further array fixes and a new test
I think I'm wrong about the ItemSlots struct, but let's see.
2025-02-23 15:02:08 -05:00
e92686e179 Clean up code, imports, and other misc tasks 2025-02-23 14:43:10 -05:00