fix T6 vectors

This commit is contained in:
xensik 2022-10-03 12:46:34 +02:00
parent b04538aaa2
commit 6a3f0d6ecc

View File

@ -1772,7 +1772,6 @@ void compiler::emit_expr_object(const ast::expr& expr)
void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr) void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr)
{ {
std::vector<std::string> data; std::vector<std::string> data;
bool isexpr = false;
bool isconst = true; bool isconst = true;
auto flags = 0; auto flags = 0;
@ -1798,7 +1797,6 @@ void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr)
} }
else else
{ {
isexpr = true;
isconst = false; isconst = false;
} }
@ -1824,7 +1822,6 @@ void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr)
} }
else else
{ {
isexpr = true;
isconst = false; isconst = false;
} }
@ -1850,7 +1847,6 @@ void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr)
} }
else else
{ {
isexpr = true;
isconst = false; isconst = false;
} }
@ -1858,17 +1854,14 @@ void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr)
{ {
emit_opcode(opcode::OP_VectorConstant, utils::string::va("%d", flags)); emit_opcode(opcode::OP_VectorConstant, utils::string::va("%d", flags));
} }
else if (isexpr) else
{ {
// OP_GetVector seems to be broken, always use OP_Vector
emit_expr(expr->z); emit_expr(expr->z);
emit_expr(expr->y); emit_expr(expr->y);
emit_expr(expr->x); emit_expr(expr->x);
emit_opcode(opcode::OP_Vector); emit_opcode(opcode::OP_Vector);
} }
else
{
emit_opcode(opcode::OP_GetVector, data);
}
} }
void compiler::emit_expr_animation(const ast::expr_animation::ptr& expr) void compiler::emit_expr_animation(const ast::expr_animation::ptr& expr)