mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-10 22:24:33 +00:00
Replaced a ton of ConsoleMethods with the DefineConsoleMethod Macro.
This commit is contained in:
parent
378a933894
commit
acb192e2a5
133 changed files with 1716 additions and 2087 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#include "core/strings/stringFunctions.h"
|
||||
|
||||
#include "console/consoleTypes.h"
|
||||
#include "console/engineAPI.h"
|
||||
|
||||
|
||||
bool gLogToConsole = false;
|
||||
|
|
@ -49,14 +50,13 @@ static const char *packetTypeNames[] =
|
|||
//-----------------------------------------------------------------
|
||||
//-----------------------------------------------------------------
|
||||
//-----------------------------------------------------------------
|
||||
ConsoleFunction(DNetSetLogging, void, 2, 2, "(bool enabled)"
|
||||
DefineConsoleFunction( DNetSetLogging, void, (bool enabled), , "(bool enabled)"
|
||||
"@brief Enables logging of the connection protocols\n\n"
|
||||
"When enabled a lot of network debugging information is sent to the console.\n"
|
||||
"@param enabled True to enable, false to disable\n"
|
||||
"@ingroup Networking")
|
||||
{
|
||||
TORQUE_UNUSED(argc);
|
||||
gLogToConsole = dAtob(argv[1]);
|
||||
gLogToConsole = enabled;
|
||||
}
|
||||
|
||||
ConnectionProtocol::ConnectionProtocol()
|
||||
|
|
|
|||
|
|
@ -484,19 +484,17 @@ static ConsoleDocFragment _FileObjectwriteObject2(
|
|||
"FileObject",
|
||||
"void writeObject( SimObject* object, string prepend);");
|
||||
|
||||
ConsoleMethod( FileObject, writeObject, void, 3, 4, "FileObject.writeObject(SimObject, object prepend)"
|
||||
DefineConsoleMethod( FileObject, writeObject, void, (const char * simName, const char * objName), (""), "FileObject.writeObject(SimObject, object prepend)"
|
||||
"@hide")
|
||||
{
|
||||
SimObject* obj = Sim::findObject( argv[2] );
|
||||
SimObject* obj = Sim::findObject( simName );
|
||||
if( !obj )
|
||||
{
|
||||
Con::printf("FileObject::writeObject - Invalid Object!");
|
||||
return;
|
||||
}
|
||||
|
||||
const char *objName = NULL;
|
||||
if( argc == 4 )
|
||||
objName = (const char*)argv[3];
|
||||
if (!dStrcmp(objName,""))
|
||||
objName = NULL;
|
||||
|
||||
object->writeObject( obj, (const U8*)objName );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,16 +221,18 @@ ResourceBase ResourceManager::nextResource()
|
|||
|
||||
ConsoleFunctionGroupBegin(ResourceManagerFunctions, "Resource management functions.");
|
||||
|
||||
#ifdef TORQUE_DEBUG
|
||||
|
||||
ConsoleFunction(resourceDump, void, 1, 1, "()"
|
||||
"@brief List the currently managed resources\n\n"
|
||||
"Currently used by editors only, internal\n"
|
||||
"@ingroup Editors\n"
|
||||
"@internal")
|
||||
{
|
||||
#ifdef TORQUE_DEBUG
|
||||
ResourceManager::get().dumpToConsole();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
DefineEngineFunction( reloadResource, void, ( const char* path ),,
|
||||
"Force the resource at specified input path to be reloaded\n"
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include "core/frameAllocator.h"
|
||||
#include "core/strings/unicode.h"
|
||||
#include "core/strings/stringFunctions.h"
|
||||
#include "console/engineAPI.h"
|
||||
|
||||
|
||||
#if defined(TORQUE_DEBUG)
|
||||
|
|
@ -47,12 +48,12 @@
|
|||
void dumpAllStrings();
|
||||
};
|
||||
|
||||
ConsoleFunction(sbmDumpStats, void, 1, 1, "")
|
||||
DefineConsoleFunction( sbmDumpStats, void, (), , "()")
|
||||
{
|
||||
StringBufferManager::getManager().dumpStats();
|
||||
}
|
||||
|
||||
ConsoleFunction(sbmDumpStrings, void, 1, 1, "")
|
||||
DefineConsoleFunction( sbmDumpStrings, void, (), , "()")
|
||||
{
|
||||
StringBufferManager::getManager().dumpAllStrings();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ namespace KeyCmp
|
|||
#include "core/util/tVector.h"
|
||||
#include "core/dataChunker.h"
|
||||
#include "console/console.h"
|
||||
#include "console/engineAPI.h"
|
||||
|
||||
#include "math/mMathFn.h"
|
||||
|
||||
|
|
@ -476,15 +477,18 @@ static U32 sgStringMemBytes;
|
|||
/// Tracks the number of Strings which are currently instantiated.
|
||||
static U32 sgStringInstances;
|
||||
|
||||
ConsoleFunction( dumpStringMemStats, void, 1, 1, "()"
|
||||
|
||||
|
||||
#endif
|
||||
DefineConsoleFunction( dumpStringMemStats, void, (), , "()"
|
||||
"@brief Dumps information about String memory usage\n\n"
|
||||
"@ingroup Debugging\n"
|
||||
"@ingroup Strings\n")
|
||||
{
|
||||
#ifdef TORQUE_DEBUG
|
||||
Con::printf( "String Data: %i instances, %i bytes", sgStringInstances, sgStringMemBytes );
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue