improve decomp of state handlers and art groups (#3014)

- state handlers that are not inlined lambdas have smarter type
checking, getting rid of 99.9% of the casts emitted (they were not
useful)
- art groups were not being properly linked to their "master" groups.
- `max` in `ja` in Jak 2 was not being detected.

Another huge PR...
This commit is contained in:
ManDude
2023-09-23 14:53:50 +01:00
committed by GitHub
parent f86be3df62
commit ff924f6b00
723 changed files with 8248 additions and 16144 deletions
+3 -6
View File
@@ -3881,7 +3881,7 @@ void FunctionCallElement::update_from_stack(const Env& env,
macro.push_back(rate);
}
if (env.version > GameVersion::Jak1) {
if (env.version != GameVersion::Jak1) {
macro.push_back(pool.form<ConstantTokenElement>(":origin-is-matrix"));
macro.push_back(pool.form<ConstantTokenElement>("#t"));
}
@@ -3918,10 +3918,8 @@ ConstantTokenElement* DerefElement::try_as_art_const(const Env& env, FormPool& p
if (elt_name) {
return pool.alloc_element<ConstantTokenElement>(*elt_name);
} else {
if (env.version != GameVersion::Jak2) {
lg::error("function {}: did not find art element {} in {}", env.func->name(),
mr.maps.ints.at(0), env.art_group());
}
lg::error("function `{}`: did not find art element {} in {}", env.func->name(),
mr.maps.ints.at(0), env.art_group());
}
}
@@ -4841,7 +4839,6 @@ FormElement* try_make_logtest_mouse_macro(Form* in, FormPool& pool) {
t = REL;
}
printf("t is %d\n", t);
if (t != NIL) {
auto logtest_elt = dynamic_cast<GenericElement*>(in->at(0));
if (logtest_elt) {