Merge pull request #81280 from ogapo/deterministic_pcks
Fix for non-deterministic behavior in PCKPacker
This commit is contained in:
commit
75de1ca768
@ -205,7 +205,7 @@ Error PCKPacker::flush(bool p_verbose) {
|
|||||||
|
|
||||||
int header_padding = _get_pad(alignment, file->get_position());
|
int header_padding = _get_pad(alignment, file->get_position());
|
||||||
for (int i = 0; i < header_padding; i++) {
|
for (int i = 0; i < header_padding; i++) {
|
||||||
file->store_8(Math::rand() % 256);
|
file->store_8(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t file_base = file->get_position();
|
int64_t file_base = file->get_position();
|
||||||
@ -244,7 +244,7 @@ Error PCKPacker::flush(bool p_verbose) {
|
|||||||
|
|
||||||
int pad = _get_pad(alignment, file->get_position());
|
int pad = _get_pad(alignment, file->get_position());
|
||||||
for (int j = 0; j < pad; j++) {
|
for (int j = 0; j < pad; j++) {
|
||||||
file->store_8(Math::rand() % 256);
|
file->store_8(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
count += 1;
|
count += 1;
|
||||||
|
@ -236,7 +236,7 @@ Error EditorExportPlatform::_save_pack_file(void *p_userdata, const String &p_pa
|
|||||||
|
|
||||||
int pad = _get_pad(PCK_PADDING, pd->f->get_position());
|
int pad = _get_pad(PCK_PADDING, pd->f->get_position());
|
||||||
for (int i = 0; i < pad; i++) {
|
for (int i = 0; i < pad; i++) {
|
||||||
pd->f->store_8(Math::rand() % 256);
|
pd->f->store_8(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store MD5 of original file.
|
// Store MD5 of original file.
|
||||||
@ -1659,7 +1659,7 @@ Error EditorExportPlatform::save_pack(const Ref<EditorExportPreset> &p_preset, b
|
|||||||
|
|
||||||
int header_padding = _get_pad(PCK_PADDING, f->get_position());
|
int header_padding = _get_pad(PCK_PADDING, f->get_position());
|
||||||
for (int i = 0; i < header_padding; i++) {
|
for (int i = 0; i < header_padding; i++) {
|
||||||
f->store_8(Math::rand() % 256);
|
f->store_8(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t file_base = f->get_position();
|
uint64_t file_base = f->get_position();
|
||||||
|
Loading…
Reference in New Issue
Block a user