mirror of
https://github.com/open-goal/jak-project
synced 2026-06-16 06:46:07 -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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user