mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 05:50:31 +00:00
more console cleanups
(cherry picked from commit a66ff6407cdcdf233996f49c74d7a42537314562)
This commit is contained in:
parent
339393aa85
commit
fed381c945
3 changed files with 38 additions and 36 deletions
|
|
@ -116,9 +116,6 @@ U32 _ITER = 0; ///< Stack pointer for iterStack.
|
|||
ConsoleValue stack[MaxStackSize];
|
||||
S32 _STK = 0;
|
||||
|
||||
char curFieldArray[256];
|
||||
char prevFieldArray[256];
|
||||
|
||||
const char* tsconcat(const char* strA, const char* strB, S32& outputLen)
|
||||
{
|
||||
S32 lenA = dStrlen(strA);
|
||||
|
|
|
|||
|
|
@ -1549,22 +1549,23 @@ ConsoleValue evaluatef(const char* string, ...)
|
|||
ConsoleValue _internalExecute(S32 argc, ConsoleValue argv[])
|
||||
{
|
||||
StringTableEntry funcName = StringTable->insert(argv[0].getString());
|
||||
|
||||
const char** argv_str = static_cast<const char**>(malloc((argc - 1) * sizeof(char *)));
|
||||
for (int i = 0; i < argc - 1; i++)
|
||||
if (argc > 1)
|
||||
{
|
||||
argv_str[i] = argv[i + 1].getString();
|
||||
const char** argv_str = static_cast<const char**>(malloc((argc - 1) * sizeof(char*)));
|
||||
for (int i = 0; i < argc - 1; i++)
|
||||
{
|
||||
argv_str[i] = argv[i + 1].getString();
|
||||
}
|
||||
bool result;
|
||||
const char* methodRes = CInterface::CallFunction(NULL, funcName, argv_str, argc - 1, &result);
|
||||
free(argv_str);
|
||||
if (result)
|
||||
{
|
||||
ConsoleValue ret;
|
||||
ret.setString(methodRes);
|
||||
return std::move(ret);
|
||||
}
|
||||
}
|
||||
bool result;
|
||||
const char* methodRes = CInterface::CallFunction(NULL, funcName, argv_str, argc - 1, &result);
|
||||
free(argv_str);
|
||||
if (result)
|
||||
{
|
||||
ConsoleValue ret;
|
||||
ret.setString(methodRes);
|
||||
return std::move(ret);
|
||||
}
|
||||
|
||||
Namespace::Entry *ent;
|
||||
|
||||
ent = Namespace::global()->lookup(funcName);
|
||||
|
|
@ -1636,22 +1637,24 @@ static ConsoleValue _internalExecute(SimObject *object, S32 argc, ConsoleValue a
|
|||
}
|
||||
|
||||
StringTableEntry funcName = StringTable->insert(argv[0].getString());
|
||||
|
||||
const char** argv_str = static_cast<const char**>(malloc((argc - 2) * sizeof(char *)));
|
||||
for (int i = 0; i < argc - 2; i++)
|
||||
if (argc > 2)
|
||||
{
|
||||
argv_str[i] = argv[i + 2].getString();
|
||||
}
|
||||
bool result;
|
||||
const char* methodRes = CInterface::CallMethod(object, funcName, argv_str, argc - 2, &result);
|
||||
const char** argv_str = static_cast<const char**>(malloc((argc - 2) * sizeof(char*)));
|
||||
for (int i = 0; i < argc - 2; i++)
|
||||
{
|
||||
argv_str[i] = argv[i + 2].getString();
|
||||
}
|
||||
bool result;
|
||||
const char* methodRes = CInterface::CallMethod(object, funcName, argv_str, argc - 2, &result);
|
||||
|
||||
free(argv_str);
|
||||
free(argv_str);
|
||||
|
||||
if (result)
|
||||
{
|
||||
ConsoleValue val;
|
||||
val.setString(methodRes);
|
||||
return val;
|
||||
if (result)
|
||||
{
|
||||
ConsoleValue val;
|
||||
val.setString(methodRes);
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
if(object->getNamespace())
|
||||
|
|
|
|||
|
|
@ -644,18 +644,20 @@ ImplementEnumType(_TamlFormatMode,
|
|||
// Fetch field count.
|
||||
const U32 fieldCount = fieldList.size();
|
||||
|
||||
ConsoleObject* defaultConObject;
|
||||
SimObject* defaultObject;
|
||||
ConsoleObject* defaultConObject = NULL;
|
||||
SimObject* defaultObject = NULL;
|
||||
if (!getWriteDefaults())
|
||||
{
|
||||
// Create a default object of the same type
|
||||
defaultConObject = ConsoleObject::create(pSimObject->getClassName());
|
||||
if (!defaultConObject)
|
||||
return;
|
||||
defaultObject = dynamic_cast<SimObject*>(defaultConObject);
|
||||
|
||||
// ***Really*** shouldn't happen
|
||||
if (!defaultObject)
|
||||
return;
|
||||
}
|
||||
// ***Really*** shouldn't happen
|
||||
if (!defaultConObject || !defaultObject)
|
||||
return;
|
||||
|
||||
// Iterate fields.
|
||||
U8 arrayDepth = 0;
|
||||
|
|
@ -754,7 +756,7 @@ ImplementEnumType(_TamlFormatMode,
|
|||
}
|
||||
|
||||
// Save field/value.
|
||||
if (arrayDepth > 0 || pField->elementCount > 1)
|
||||
if (currentArrayNode && (arrayDepth > 0 || pField->elementCount > 1))
|
||||
currentArrayNode->getChildren()[elementIndex]->addField(fieldName, pFieldValue);
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue