mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 23:00:45 -04:00
[files] merge fake duplicate files (#1048)
* merge `orb-cache-top` * hopefully fix random TIE extractor crash * merge `ecovalve-ag` * expand debug gfx buckets * merge `barrel-ag`, `sack-ag`, `sharkey-ag` * merge `warp-gate-switch-ag` * merge everything else * Update extract_tie.cpp * add misty level * oops * properly add it this time
This commit is contained in:
@@ -376,7 +376,7 @@ std::string pad_string(const std::string& in, size_t length) {
|
||||
}
|
||||
} // namespace
|
||||
|
||||
std::string ObjectFileDB::generate_obj_listing() {
|
||||
std::string ObjectFileDB::generate_obj_listing(const std::unordered_set<std::string>& merged_objs) {
|
||||
std::string result = "[";
|
||||
std::set<std::string> all_unique_names;
|
||||
int unique_count = 0;
|
||||
@@ -391,23 +391,25 @@ std::string ObjectFileDB::generate_obj_listing() {
|
||||
dgos.pop_back();
|
||||
dgos.pop_back();
|
||||
dgos += "]";
|
||||
result += "[\"" + pad_string(x.to_unique_name() + "\", ", 50) + "\"" +
|
||||
auto name = x.to_unique_name();
|
||||
result += "[\"" + pad_string(name + "\", ", 50) + "\"" +
|
||||
pad_string(x.name_in_dgo + "\", ", 50) + std::to_string(x.obj_version) + ", " +
|
||||
dgos + ", \"\"],\n";
|
||||
unique_count++;
|
||||
if (all_unique_names.find(x.to_unique_name()) != all_unique_names.end()) {
|
||||
lg::error("Object file {} appears multiple times with the same name.", x.to_unique_name());
|
||||
if (all_unique_names.find(name) != all_unique_names.end() &&
|
||||
merged_objs.find(name) == merged_objs.end()) {
|
||||
lg::error("Object file {} appears multiple times with the same name.", name);
|
||||
}
|
||||
all_unique_names.insert(x.to_unique_name());
|
||||
}
|
||||
// this check is extremely important. It makes sure we don't have any repeat names. This could
|
||||
// be caused by two files with the same name, in the same DGOs, but different data.
|
||||
if (int(all_unique_names.size()) != unique_count) {
|
||||
lg::error("Object files are not named properly, data will be lost!");
|
||||
all_unique_names.insert(name);
|
||||
}
|
||||
}
|
||||
// this check is extremely important. It makes sure we don't have any repeat names. This could
|
||||
// be caused by two files with the same name, in the same DGOs, but different data.
|
||||
if (int(all_unique_names.size()) != unique_count) {
|
||||
lg::error("Object files are not named properly, data will be lost!");
|
||||
}
|
||||
|
||||
if (result.length() >= 2) {
|
||||
if (unique_count > 0) {
|
||||
result.pop_back(); // kill last new line
|
||||
result.pop_back(); // kill last comma
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ class ObjectFileDB {
|
||||
const std::vector<std::string>& str_files,
|
||||
const Config& config);
|
||||
std::string generate_dgo_listing();
|
||||
std::string generate_obj_listing();
|
||||
std::string generate_obj_listing(const std::unordered_set<std::string>& merged_objs);
|
||||
void process_link_data(const Config& config);
|
||||
void process_labels();
|
||||
void find_code(const Config& config);
|
||||
@@ -81,7 +81,7 @@ class ObjectFileDB {
|
||||
void ir2_register_usage_pass(int seg, ObjectFileData& data);
|
||||
void ir2_variable_pass(int seg, ObjectFileData& data);
|
||||
void ir2_cfg_build_pass(int seg, ObjectFileData& data);
|
||||
void ir2_store_current_forms(int seg);
|
||||
// void ir2_store_current_forms(int seg);
|
||||
void ir2_build_expressions(int seg, const Config& config, ObjectFileData& data);
|
||||
void ir2_insert_lets(int seg, ObjectFileData& data);
|
||||
void ir2_rewrite_inline_asm_instructions(int seg, ObjectFileData& data);
|
||||
|
||||
Reference in New Issue
Block a user