- Since the string builder stuff takes care of recursive print calls now, the PCD_CALLs don't

need to save it as part of the state when calling functions.

SVN r3828 (trunk)
This commit is contained in:
Randy Heit 2012-08-14 03:00:03 +00:00
parent 7a8ccaad97
commit 166b4dbb75

View file

@ -112,13 +112,12 @@ FRandom pr_acs ("ACS");
struct CallReturn
{
CallReturn(int pc, ScriptFunction *func, FBehavior *module, SDWORD *locals, bool discard, FString &str)
CallReturn(int pc, ScriptFunction *func, FBehavior *module, SDWORD *locals, bool discard)
: ReturnFunction(func),
ReturnModule(module),
ReturnLocals(locals),
ReturnAddress(pc),
bDiscardResult(discard),
StringBuilder(str)
bDiscardResult(discard)
{}
ScriptFunction *ReturnFunction;
@ -126,7 +125,6 @@ struct CallReturn
SDWORD *ReturnLocals;
int ReturnAddress;
int bDiscardResult;
FString StringBuilder;
};
static DLevelScript *P_GetScriptGoing (AActor *who, line_t *where, int num, const ScriptPtr *code, FBehavior *module,
@ -170,8 +168,8 @@ TArray<FString>
ACS_StringsOnTheFly,
ACS_StringBuilderStack;
#define STRINGBUILDER_START(Builder) if (*Builder.GetChars() || ACS_StringBuilderStack.Size()) { ACS_StringBuilderStack.Push(Builder); Builder = ""; }
#define STRINGBUILDER_FINISH(Builder) if (!ACS_StringBuilderStack.Pop(Builder)) Builder = "";
#define STRINGBUILDER_START(Builder) if (Builder.IsNotEmpty() || ACS_StringBuilderStack.Size()) { ACS_StringBuilderStack.Push(Builder); Builder = ""; }
#define STRINGBUILDER_FINISH(Builder) if (!ACS_StringBuilderStack.Pop(Builder)) { Builder = ""; }
//============================================================================
//
@ -4323,7 +4321,7 @@ int DLevelScript::RunScript ()
}
sp += i;
::new(&Stack[sp]) CallReturn(activeBehavior->PC2Ofs(pc), activeFunction,
activeBehavior, mylocals, pcd == PCD_CALLDISCARD, work);
activeBehavior, mylocals, pcd == PCD_CALLDISCARD);
sp += (sizeof(CallReturn) + sizeof(int) - 1) / sizeof(int);
pc = module->Ofs2PC (func->Address);
activeFunction = func;
@ -4362,7 +4360,6 @@ int DLevelScript::RunScript ()
{
Stack[sp++] = value;
}
work = ret->StringBuilder;
ret->~CallReturn();
}
break;
@ -7570,6 +7567,3 @@ void DACSThinker::DumpScriptStatus ()
script = script->next;
}
}
#undef STRINGBUILDER_START
#undef STRINGBUILDER_FINISH