Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-pack support and Buckshot roulette fixes #208

Merged
merged 12 commits into from
Oct 31, 2024
Prev Previous commit
Next Next commit
fix partial export
nikitalita committed Oct 31, 2024
commit 9c4b3464633478114c90a9718a9260ee0b8e911a
4 changes: 1 addition & 3 deletions utility/import_exporter.cpp
Original file line number Diff line number Diff line change
@@ -263,7 +263,6 @@ Error ImportExporter::_export_imports(const String &p_out_dir, const Vector<Stri
Vector<ExportToken> tokens;
Vector<ExportToken> non_multithreaded_tokens;
Vector<String> paths_to_export;
paths_to_export.resize(_files.size());
HashSet<String> files_to_export_set = vector_to_hashset(files_to_export);
for (int i = 0; i < _files.size(); i++) {
Ref<ImportInfo> iinfo = _files[i];
@@ -310,15 +309,14 @@ Error ImportExporter::_export_imports(const String &p_out_dir, const Vector<Stri
} else {
supports_multithreading = false;
}
paths_to_export.write[i] = iinfo->get_path();
paths_to_export.push_back(iinfo->get_path());
if (supports_multithreading) {
tokens.push_back({ iinfo, nullptr, output_dir, supports_multithreading, opt_rewrite_imd_v2, opt_rewrite_imd_v3, opt_write_md5_files });
} else {
non_multithreaded_tokens.push_back({ iinfo, nullptr, output_dir, supports_multithreading, opt_rewrite_imd_v2, opt_rewrite_imd_v3, opt_write_md5_files });
}
}
int64_t num_multithreaded_tokens = tokens.size();
paths_to_export.resize(num_multithreaded_tokens);
// ***** Export resources *****
if (opt_multi_thread && tokens.size() > 0) {
last_completed = -1;
8 changes: 2 additions & 6 deletions utility/pck_dumper.cpp
Original file line number Diff line number Diff line change
@@ -227,8 +227,6 @@ Error PckDumper::_pck_dump_to_dir(
if (opt_multi_thread) {
Vector<ExtractToken> tokens;
Vector<String> paths_to_extract;
tokens.resize(files_to_extract.is_empty() ? files.size() : files_to_extract.size());
paths_to_extract.resize(files_to_extract.is_empty() ? files.size() : files_to_extract.size());
int actual = 0;
HashSet<String> files_to_extract_set;
for (const String &f : files_to_extract) {
@@ -240,11 +238,9 @@ Error PckDumper::_pck_dump_to_dir(
}
actual++;
if (pr) {
paths_to_extract.write[i] = files.get(i)->get_path();
paths_to_extract.push_back(files.get(i)->get_path());
}
tokens.write[i].file = files.get(i);
tokens.write[i].output_dir = dir;
tokens.write[i].err = OK;
tokens.push_back({ files.get(i), dir, OK });
}
tokens.resize(actual);
paths_to_extract.resize(actual);