LogicAndTrick / sledge-formats

C# parsers and formats for Half-Life 1 and related engines.
MIT License
71 stars 10 forks source link

Texture lumps are written incorrectly #20

Closed SamVanheer closed 1 year ago

SamVanheer commented 1 year ago

When writing a wad file the texture lumps are written without padding them to a 4 byte boundary like qlumpy does: https://github.com/ValveSoftware/halflife/blob/c7240b965743a53a29491dd49320c88eecf6257b/utils/qlumpy/qlumpy.c#L197-L201

The resulting wad files can't be read properly by Wally because the workaround for an old Wally bug happens to trigger here: https://github.com/Ty-Matthews-VisualStudio/Wally/blob/e8394c574e8efd63da3b56d2ea8f27e13ff3af32/Source/Wally/WADList.cpp#L104-L121

Additionally the padding byte for lump info is written as the value 2 instead of 0 which shows up when doing a binary diff.