- converted the rest of Heretic's actors.

- fixed: Boolean constants were not properly handled.
This commit is contained in:
Christoph Oelckers 2016-10-17 12:58:23 +02:00
parent c13916ea18
commit 552f094ec1
13 changed files with 928 additions and 850 deletions

View file

@ -2385,6 +2385,10 @@ FxExpression *ZCCCompiler::ConvertNode(ZCC_TreeNode *ast)
{
return new FxConstant(cnst->IntVal, *ast);
}
else if (cnst->Type->IsA(RUNTIME_CLASS(PBool)))
{
return new FxConstant(!!cnst->IntVal, *ast);
}
else if (cnst->Type->IsA(RUNTIME_CLASS(PFloat)))
{
return new FxConstant(cnst->DoubleVal, *ast);
@ -2396,7 +2400,7 @@ FxExpression *ZCCCompiler::ConvertNode(ZCC_TreeNode *ast)
else
{
// can there be other types?
Error(cnst, "Unknown constant type");
Error(cnst, "Unknown constant type %s", cnst->Type->DescriptiveName());
return new FxConstant(0, *ast);
}
}