- fixed: A VM function's NumArgs value needs to count stack arguments, not logical ones, meaning that for vectors each element needs to count separately.

- renamed VMFunction::Defaults to DefaultArgs to make searching easier.
- let ZCCCompiler process vector defaults for function parameters.
This commit is contained in:
Christoph Oelckers 2016-10-30 09:05:42 +01:00
commit 9eeb56212b
7 changed files with 54 additions and 17 deletions

View file

@ -466,12 +466,20 @@ public:
class FxVectorValue : public FxExpression
{
FxExpression *xyz[3];
bool isConst; // gets set to true if all element are const
bool isConst; // gets set to true if all element are const (used by function defaults parser)
public:
friend class ZCCCompiler;
FxVectorValue(FxExpression *x, FxExpression *y, FxExpression *z, const FScriptPosition &sc);
~FxVectorValue();
FxExpression *Resolve(FCompileContext&);
bool isConstVector(int dim)
{
if (!isConst) return false;
return dim == 2 ? xyz[2] == nullptr : xyz[2] != nullptr;
}
ExpEmit Emit(VMFunctionBuilder *build);
};