Closed sergeikrasnikov closed 1 year ago
So the problem is that the padding amount is reverse of what it should be?
Doing an excel file with various values, I noticed that the corrected math you suggested results in the correct padded lengths, but when the length is exactly right it ends up adding 4 extra padding bytes, though maybe that is actually required to have at least one terminating null?
I'll do a PR to test if the new math works fine or if there is potentially a problem.
The table of content padding calculation is wrong
In the file PckFile.cpp the lines 137--139
The middle line should be
entry.Path.size() + (PadPathsToMultipleWithNULLS - entry.Path.size() % PadPathsToMultipleWithNULLS)
For reference, see the function
static int _get_pad(int p_alignment, int p_n)
in editor_export_platform.cpp