- implemented local vector variables. Currently only the definition plus initial assignment works.

- removed all vector4 handling that had already been added, now that this type can no longer be defined.
This commit is contained in:
Christoph Oelckers 2016-10-28 15:15:30 +02:00
commit 9400f97189
8 changed files with 278 additions and 44 deletions

View file

@ -1387,11 +1387,6 @@ PType *ZCCCompiler::DetermineType(PType *outertype, ZCC_TreeNode *field, FName n
retval = TypeVector3;
break;
case ZCC_Vector4:
// This has almost no use, so we really shouldn't bother.
Error(field, "vector<4> not implemented for %s", name.GetChars());
return TypeError;
case ZCC_State:
retval = TypeState;
break;
@ -2710,6 +2705,15 @@ FxExpression *ZCCCompiler::ConvertNode(ZCC_TreeNode *ast)
return new FxConditional(condition, left, right);
}
case AST_VectorInitializer:
{
auto vecini = static_cast<ZCC_VectorInitializer *>(ast);
auto xx = ConvertNode(vecini->X);
auto yy = ConvertNode(vecini->Y);
auto zz = ConvertNode(vecini->Z);
return new FxVectorInitializer(xx, yy, zz, *ast);
}
case AST_LocalVarStmt:
{
auto loc = static_cast<ZCC_LocalVarStmt *>(ast);