- converted the ACS Stringbuilder macros into inline functions.

This commit is contained in:
Christoph Oelckers 2019-01-05 16:09:59 +01:00
parent c651045ed3
commit 131eef9eb9

View file

@ -714,6 +714,25 @@ protected:
FBehavior *activeBehavior;
int InModuleScriptNumber;
TArray<FString> ACS_StringBuilderStack;
inline void STRINGBUILDER_START(FString &Builder)
{
if (Builder.IsNotEmpty() || ACS_StringBuilderStack.Size())
{
ACS_StringBuilderStack.Push(Builder);
Builder = "";
}
}
inline void STRINGBUILDER_FINISH(FString &Builder)
{
if (!ACS_StringBuilderStack.Pop(Builder))
{
Builder = "";
}
}
void Link();
void Unlink();
void PutLast();
@ -788,10 +807,6 @@ struct FBehavior::ArrayInfo
};
TArray<FBehavior *> FBehavior::StaticModules;
TArray<FString> ACS_StringBuilderStack;
#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 = ""; }
//============================================================================
//
@ -3468,12 +3483,6 @@ void DACSThinker::Tick ()
// GlobalACSStrings.Clear();
if (ACS_StringBuilderStack.Size())
{
int size = ACS_StringBuilderStack.Size();
ACS_StringBuilderStack.Clear();
I_Error("Error: %d garbage entries on ACS string builder stack.", size);
}
ACSTime.Unclock();
}