decompiler: call-parent-state-handler and suspend-for macros (#3625)

Also fix `hud-draw-pris2` bucket in Jak 3 to make subtitles work and
foreground HUD envmap.
This commit is contained in:
Hat Kid
2024-09-04 19:35:54 +02:00
committed by GitHub
parent d46e9fb8bb
commit bc66d416b4
536 changed files with 4365 additions and 9381 deletions
+23
View File
@@ -211,6 +211,13 @@ Matcher Matcher::while_loop(const Matcher& condition, const Matcher& body) {
return m;
}
Matcher Matcher::until_loop(const Matcher& condition, const Matcher& body) {
Matcher m;
m.m_kind = Kind::UNTIL_LOOP;
m.m_sub_matchers = {condition, body};
return m;
}
Matcher Matcher::any_constant_token(int match_id) {
Matcher m;
m.m_kind = Kind::ANY_CONSTANT_TOKEN;
@@ -671,6 +678,22 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out, const Env* cons
return true;
} break;
case Kind::UNTIL_LOOP: {
auto as_until = dynamic_cast<UntilElement*>(input->try_as_single_active_element());
if (!as_until) {
return false;
}
if (!m_sub_matchers.at(0).do_match(as_until->condition, maps_out, env)) {
return false;
}
if (!m_sub_matchers.at(1).do_match(as_until->body, maps_out, env)) {
return false;
}
return true;
} break;
case Kind::BEGIN: {
if ((int)m_sub_matchers.size() != input->size()) {
return false;