Remove all state expression/param stuff
- This all became vestigial code after the relevant information was all moved into FStateTempCall. Now that the MBF code pointer code has been converted, I can be sure it wasn't still used anywhere.
This commit is contained in:
parent
9485752b55
commit
4a1fbdb32a
6 changed files with 1 additions and 187 deletions
|
|
@ -3990,133 +3990,3 @@ ExpEmit FxDamageValue::Emit(VMFunctionBuilder *build)
|
|||
|
||||
return ExpEmit();
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// NOTE: I don't expect any of the following to survive Doomscript ;)
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FStateExpressions StateParams;
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FStateExpressions::Clear()
|
||||
{
|
||||
for(unsigned i=0; i<Size(); i++)
|
||||
{
|
||||
if (expressions[i].expr != NULL && !expressions[i].cloned)
|
||||
{
|
||||
delete expressions[i].expr;
|
||||
}
|
||||
}
|
||||
expressions.Clear();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int FStateExpressions::Add(FxExpression *x, PClassActor *o, bool c)
|
||||
{
|
||||
int idx = expressions.Reserve(1);
|
||||
FStateExpression &exp = expressions[idx];
|
||||
exp.expr = x;
|
||||
exp.owner = o;
|
||||
exp.constant = c;
|
||||
exp.cloned = false;
|
||||
return idx;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int FStateExpressions::Reserve(int num, PClassActor *cls)
|
||||
{
|
||||
int idx = expressions.Reserve(num);
|
||||
FStateExpression *exp = &expressions[idx];
|
||||
for(int i = 0; i < num; i++)
|
||||
{
|
||||
exp[i].expr = NULL;
|
||||
exp[i].owner = cls;
|
||||
exp[i].constant = false;
|
||||
exp[i].cloned = false;
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int FStateExpressions::ResolveAll()
|
||||
{
|
||||
int errorcount = 0;
|
||||
|
||||
FCompileContext ctx;
|
||||
ctx.lax = true;
|
||||
for(unsigned i=0; i<Size(); i++)
|
||||
{
|
||||
if (expressions[i].cloned)
|
||||
{
|
||||
// Now that everything coming before has been resolved we may copy the actual pointer.
|
||||
unsigned ii = unsigned((intptr_t)expressions[i].expr);
|
||||
expressions[i].expr = expressions[ii].expr;
|
||||
}
|
||||
else if (expressions[i].expr != NULL)
|
||||
{
|
||||
ctx.cls = expressions[i].owner;
|
||||
ctx.isconst = expressions[i].constant;
|
||||
expressions[i].expr = expressions[i].expr->Resolve(ctx);
|
||||
if (expressions[i].expr == NULL)
|
||||
{
|
||||
errorcount++;
|
||||
}
|
||||
else if (expressions[i].constant && !expressions[i].expr->isConstant())
|
||||
{
|
||||
expressions[i].expr->ScriptPosition.Message(MSG_ERROR, "Constant expression expected");
|
||||
errorcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(unsigned i=0; i<Size(); i++)
|
||||
{
|
||||
if (expressions[i].expr != NULL)
|
||||
{
|
||||
if (!expressions[i].expr->isresolved)
|
||||
{
|
||||
expressions[i].expr->ScriptPosition.Message(MSG_ERROR, "Expression at index %d not resolved\n", i);
|
||||
errorcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return errorcount;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FxExpression *FStateExpressions::Get(int num)
|
||||
{
|
||||
if (num >= 0 && num < int(Size()))
|
||||
return expressions[num].expr;
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue