From 4a1fbdb32a4e109efc4840890c2676d5b76e2912 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 27 Jul 2013 22:34:44 -0500 Subject: [PATCH] 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. --- src/dobjtype.h | 1 - src/thingdef/thingdef.cpp | 3 +- src/thingdef/thingdef.h | 27 ------ src/thingdef/thingdef_expression.cpp | 130 --------------------------- src/thingdef/thingdef_parse.cpp | 12 --- src/thingdef/thingdef_states.cpp | 15 ---- 6 files changed, 1 insertion(+), 187 deletions(-) diff --git a/src/dobjtype.h b/src/dobjtype.h index b04f7fce51..b245611bca 100644 --- a/src/dobjtype.h +++ b/src/dobjtype.h @@ -87,7 +87,6 @@ class PSymbolActionFunction : public PSymbol public: FString Arguments; VMFunction *Function; - int defaultparameterindex; PSymbolActionFunction(FName name) : PSymbol(name) {} PSymbolActionFunction() : PSymbol(NAME_None) {} diff --git a/src/thingdef/thingdef.cpp b/src/thingdef/thingdef.cpp index 36c09d7163..ef0be1d23b 100644 --- a/src/thingdef/thingdef.cpp +++ b/src/thingdef/thingdef.cpp @@ -276,7 +276,7 @@ static void DumpFunction(FILE *dump, VMScriptFunction *sfunc, const char *label, static void FinishThingdef() { - int errorcount = StateParams.ResolveAll(); + int errorcount = 0; unsigned i, j; int codesize = 0; @@ -419,7 +419,6 @@ void LoadActors () cycle_t timer; timer.Reset(); timer.Clock(); - StateParams.Clear(); ActorDamageFuncs.Clear(); GlobalSymbols.ReleaseSymbols(); FScriptPosition::ResetErrorCounter(); diff --git a/src/thingdef/thingdef.h b/src/thingdef/thingdef.h index b65bb4637c..1b253ec89e 100644 --- a/src/thingdef/thingdef.h +++ b/src/thingdef/thingdef.h @@ -127,33 +127,6 @@ struct FStateTempCall int NumStates; }; extern TDeletingArray StateTempCalls; - -struct FStateExpression -{ - FxExpression *expr; - PClassActor *owner; - bool constant; - bool cloned; -}; - -class FStateExpressions -{ - TArray expressions; - -public: - ~FStateExpressions() { Clear(); } - void Clear(); - int Add(FxExpression *x, PClassActor *o, bool c); - int Reserve(int num, PClassActor *cls); -// void Set(int num, FxExpression *x, bool cloned = false); -// void Copy(int dest, int src, int cnt); - int ResolveAll(); - FxExpression *Get(int no); - unsigned int Size() { return expressions.Size(); } -}; - -extern FStateExpressions StateParams; - extern TDeletingArray ActorDamageFuncs; //========================================================================== diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index bd2dfe70e3..5541972dfb 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -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; iResolve(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; iisresolved) - { - 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; -} diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index d07f481a16..f7f310c2b9 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -1010,18 +1010,6 @@ static void ParseActionDef (FScanner &sc, PClassActor *cls) PSymbolActionFunction *sym = new PSymbolActionFunction(funcname); sym->Arguments = args; sym->Function = *(afd->VMPointer); - if (hasdefaults) - { - sym->defaultparameterindex = StateParams.Size(); - for(unsigned int i = 0; i < DefaultParams.Size(); i++) - { - StateParams.Add(DefaultParams[i], cls, true); - } - } - else - { - sym->defaultparameterindex = -1; - } if (error) { FScriptPosition::ErrorCounter++; diff --git a/src/thingdef/thingdef_states.cpp b/src/thingdef/thingdef_states.cpp index 9bd3a562a4..fb3ecf673a 100644 --- a/src/thingdef/thingdef_states.cpp +++ b/src/thingdef/thingdef_states.cpp @@ -331,25 +331,13 @@ do_stop: { if (!sc.CheckString("(")) { -// state.ParameterIndex = afd->defaultparameterindex+1; goto endofstate; } } -// int paramindex = PrepareStateParameters(&state, numparams, bag.Info->Class); -// int paramstart = paramindex; bool varargs = params[numparams - 1] == '+'; int varargcount = 0; - if (varargs) - { -// paramindex++; - } - else if (afd->defaultparameterindex > -1) - { -// StateParams.Copy(paramindex, afd->defaultparameterindex, int(afd->Arguments.Len())); - } - while (*params) { FxExpression *x; @@ -381,7 +369,6 @@ do_stop: // Use the generic parameter parser for everything else x = ParseParameter(sc, bag.Info, *params, false); } -// StateParams.Set(paramindex++, x); tcall->Parameters.Push(new FxParameter(x)); params++; varargcount++; @@ -391,11 +378,9 @@ do_stop: { if (sc.CheckString(")")) { -// StateParams.Set(paramstart, new FxConstant(argcount, sc)); goto endofstate; } params--; - StateParams.Reserve(1, bag.Info); } else if ((islower(*params) || *params=='!') && sc.CheckString(")")) {