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
+12 -7
View File
@@ -1330,14 +1330,19 @@ FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool)
Matcher::any_reg(0), false,
{DerefTokenMatcher::string("frame-group"), DerefTokenMatcher::string("frames"),
DerefTokenMatcher::string("num-frames")});
auto matcher_new_group_max_frames =
env.version == GameVersion::Jak1
? Matcher::deref(Matcher::any(1), false,
{DerefTokenMatcher::string("data"), DerefTokenMatcher::integer(0),
DerefTokenMatcher::string("length")})
: Matcher::deref(
Matcher::any(1), false,
{DerefTokenMatcher::string("frames"), DerefTokenMatcher::string("num-frames")});
auto matcher_max_num = Matcher::cast(
"float", Matcher::op_fixed(FixedOperatorKind::ADDITION,
{form_fg ? Matcher::deref(Matcher::any(1), false,
{DerefTokenMatcher::string("data"),
DerefTokenMatcher::integer(0),
DerefTokenMatcher::string("length")})
: matcher_cur_group_max_frames,
Matcher::integer(-1)}));
"float",
Matcher::op_fixed(FixedOperatorKind::ADDITION,
{form_fg ? matcher_new_group_max_frames : matcher_cur_group_max_frames,
Matcher::integer(-1)}));
// DONE CHECKING EVERYTHING!!! Now write the goddamn macro.
std::vector<Form*> args;