mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Fix stack balancing problems by refactoring execution calls
- Con::executef now uses a template - All public execution functions now restore the console stack upon return - Fixed bad parameters on some callbacks - Reverts get*Arg behavior
This commit is contained in:
parent
b1ad72692c
commit
f44a3f27d6
43 changed files with 1781 additions and 358 deletions
|
|
@ -127,6 +127,7 @@ struct StringStack
|
|||
/// Return a temporary buffer we can use to return data.
|
||||
char* getReturnBuffer(U32 size)
|
||||
{
|
||||
AssertFatal(Con::isMainThread(), "Manipulating return buffer from a secondary thread!");
|
||||
validateArgBufferSize(size);
|
||||
return mArgBuffer;
|
||||
}
|
||||
|
|
@ -136,6 +137,7 @@ struct StringStack
|
|||
/// This updates the function offset.
|
||||
char *getArgBuffer(U32 size)
|
||||
{
|
||||
AssertFatal(Con::isMainThread(), "Manipulating console arg buffer from a secondary thread!");
|
||||
validateBufferSize(mStart + mFunctionOffset + size);
|
||||
char *ret = mBuffer + mStart + mFunctionOffset;
|
||||
mFunctionOffset += size;
|
||||
|
|
@ -314,6 +316,8 @@ public:
|
|||
|
||||
void pushVar(ConsoleValue *variable);
|
||||
void pushValue(ConsoleValue &value);
|
||||
ConsoleValue* reserveValues(U32 numValues);
|
||||
bool reserveValues(U32 numValues, ConsoleValueRef *values);
|
||||
ConsoleValue* pop();
|
||||
|
||||
ConsoleValue *pushString(const char *value);
|
||||
|
|
@ -338,4 +342,7 @@ public:
|
|||
ConsoleValueRef mArgv[MaxArgs];
|
||||
};
|
||||
|
||||
extern StringStack STR;
|
||||
extern ConsoleValueStack CSTK;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue