mirror of
https://github.com/open-goal/jak-project
synced 2026-07-10 23:22:17 -04:00
[decomp] add (most) PAL changes to main (#925)
* add (most) PAL changes to `main` * fix examplecam movement * fix up camera code * Use `score` system when decompiling structures * typo * restore asserts
This commit is contained in:
@@ -599,6 +599,24 @@ goos::Object decompile_structure(const TypeSpec& type,
|
||||
continue;
|
||||
}
|
||||
idx++;
|
||||
|
||||
// O(N^2)-1 approach to the score system? but I didn't notice any slowdowns and there are
|
||||
// ultimately not many static allocs
|
||||
bool higher_score_available = false;
|
||||
for (auto& other_field : type_info->fields()) {
|
||||
if (other_field == field)
|
||||
continue;
|
||||
if (other_field.offset() == field.offset() &&
|
||||
other_field.field_score() > field.field_score()) {
|
||||
higher_score_available = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (higher_score_available) {
|
||||
// a higher priority field is available
|
||||
continue;
|
||||
}
|
||||
|
||||
// first, let's see if this overlaps with anything:
|
||||
auto field_start = field.offset();
|
||||
auto field_end = field_start + ts.get_size_in_type(field);
|
||||
|
||||
Reference in New Issue
Block a user