[Decomp] Math library: transform and quaternion (#344)

* decompile transform

* types for quaternion

* part of quaternion

* finish quaternion

* fix offline test reference

* wip fix to let issue

* fix
This commit is contained in:
water111
2021-04-02 11:35:14 -04:00
committed by GitHub
parent 7867de8fd7
commit 9969445cf7
44 changed files with 3485 additions and 459 deletions
+14 -1
View File
@@ -1438,7 +1438,7 @@ std::string fixed_operator_to_string(FixedOperatorKind kind) {
case FixedOperatorKind::MULTIPLICATION:
return "*";
case FixedOperatorKind::SQRT:
return "sqrt";
return "sqrtf";
case FixedOperatorKind::ARITH_SHIFT:
return "ash";
case FixedOperatorKind::MOD:
@@ -2302,4 +2302,17 @@ std::optional<SimpleAtom> form_as_atom(const Form* f) {
return {};
}
FormElement* make_cast_using_existing(FormElement* elt, const TypeSpec& type, FormPool& pool) {
auto as_cast = dynamic_cast<CastElement*>(elt);
if (as_cast) {
if (as_cast->type() != type) {
as_cast->set_type(type);
}
return as_cast;
} else {
return pool.alloc_element<CastElement>(type, pool.alloc_single_form(nullptr, elt));
}
}
} // namespace decompiler