- 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:
parent
06ec6318a9
commit
9eeb56212b
7 changed files with 54 additions and 17 deletions
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue