Merge branch 'master' of github.com:water111/jak-project into w/overlord-stereo-dsync

This commit is contained in:
water
2023-05-19 19:38:20 -04:00
613 changed files with 119949 additions and 45251 deletions
+20
View File
@@ -3876,6 +3876,19 @@ ConstantTokenElement* DerefElement::try_as_art_const(const Env& env, FormPool& p
return nullptr;
}
GenericElement* DerefElement::try_as_curtime(FormPool& pool) {
auto mr = match(Matcher::deref(Matcher::s6(), false,
{DerefTokenMatcher::string("clock"),
DerefTokenMatcher::string("frame-counter")}),
this);
if (mr.matched) {
return pool.alloc_element<GenericElement>(
GenericOperator::make_function(pool.form<ConstantTokenElement>("current-time")));
}
return nullptr;
}
void DerefElement::update_from_stack(const Env& env,
FormPool& pool,
FormStack& stack,
@@ -3911,6 +3924,13 @@ void DerefElement::update_from_stack(const Env& env,
env.dts->ts.try_enum_lookup("game-task-node"), pool, env, m_tokens.at(1).int_constant()));
}
// current-time macro
auto as_curtime = try_as_curtime(pool);
if (as_curtime) {
result->push_back(as_curtime);
return;
}
result->push_back(this);
}