[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:
ManDude
2021-10-23 20:38:06 +01:00
committed by GitHub
parent 5b7b872ca1
commit 8ca67a5c21
28 changed files with 1012 additions and 1215 deletions
+18
View File
@@ -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);