mirror of
https://github.com/open-goal/jak-project
synced 2026-07-10 07:07:04 -04:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user