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