From 5bde18143f8b5cdd70a07fb3a08bcf614ee61338 Mon Sep 17 00:00:00 2001 From: Lukas Joergensen Date: Tue, 17 Apr 2018 16:33:56 +0200 Subject: [PATCH 1/7] Eliminate DefineConsoleFunction --- Engine/source/T3D/aiClient.cpp | 2 +- Engine/source/T3D/entity.cpp | 2 +- Engine/source/T3D/gameBase/gameProcess.cpp | 2 +- Engine/source/T3D/gameFunctions.cpp | 4 +- Engine/source/T3D/physics/physicsPlugin.cpp | 26 +-- Engine/source/app/game.cpp | 22 +-- Engine/source/app/net/serverQuery.cpp | 20 +- Engine/source/app/version.cpp | 14 +- .../source/assets/assetQuery_ScriptBinding.h | 4 +- Engine/source/cinterface/cinterface.cpp | 2 +- Engine/source/console/console.cpp | 6 +- Engine/source/console/consoleDoc.cpp | 4 +- Engine/source/console/consoleFunctions.cpp | 182 +++++++++--------- Engine/source/console/consoleXMLExport.cpp | 2 +- Engine/source/console/engineAPI.h | 18 -- Engine/source/console/sim.cpp | 24 +-- Engine/source/console/simDatablock.cpp | 4 +- Engine/source/console/telnetConsole.cpp | 2 +- Engine/source/console/telnetDebugger.cpp | 6 +- Engine/source/core/dnet.cpp | 2 +- Engine/source/core/stringBuffer.cpp | 4 +- Engine/source/core/util/str.cpp | 2 +- .../environment/VolumetricFogRTManager.cpp | 2 +- Engine/source/gfx/gfxDevice.cpp | 2 +- Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp | 2 +- Engine/source/i18n/i18n.cpp | 4 +- .../advanced/advancedLightManager.cpp | 2 +- Engine/source/lighting/shadowManager.cpp | 2 +- Engine/source/materials/materialManager.cpp | 10 +- Engine/source/math/mConsoleFunctions.cpp | 70 +++---- Engine/source/math/mRotation.cpp | 20 +- Engine/source/math/mathTypes.cpp | 44 ++--- Engine/source/navigation/navMesh.cpp | 10 +- Engine/source/platform/platformFileIO.cpp | 8 +- Engine/source/platform/platformMemory.cpp | 4 +- Engine/source/platform/platformRedBook.cpp | 20 +- Engine/source/platform/platformTimer.cpp | 4 +- Engine/source/platformWin32/cardProfile.cpp | 2 +- Engine/source/platformWin32/winConsole.cpp | 2 +- .../source/platformWin32/winDirectInput.cpp | 20 +- Engine/source/platformWin32/winExec.cpp | 2 +- Engine/source/platformWin32/winInput.cpp | 6 +- Engine/source/platformWin32/winWindow.cpp | 2 +- Engine/source/scene/pathManager.cpp | 4 +- Engine/source/scene/sceneManager.cpp | 4 +- Engine/source/sfx/sfxSystem.cpp | 6 +- Engine/source/sim/netInterface.cpp | 2 +- Engine/source/terrain/terrData.cpp | 6 +- Engine/source/ts/collada/colladaImport.cpp | 2 +- Engine/source/ts/collada/colladaLights.cpp | 2 +- Engine/source/ts/loader/tsShapeLoader.cpp | 4 +- Engine/source/ts/tsLastDetail.cpp | 2 +- Engine/source/util/fpsTracker.cpp | 2 +- Engine/source/util/messaging/dispatcher.cpp | 14 +- Engine/source/util/sampler.cpp | 6 +- 55 files changed, 314 insertions(+), 332 deletions(-) diff --git a/Engine/source/T3D/aiClient.cpp b/Engine/source/T3D/aiClient.cpp index 0fab8f428..1f4be793b 100644 --- a/Engine/source/T3D/aiClient.cpp +++ b/Engine/source/T3D/aiClient.cpp @@ -526,7 +526,7 @@ DefineConsoleMethod( AIClient, getLocation, Point3F, (),, "ai.getLocation();" ) /** * Adds an AI Player to the game */ -DefineConsoleFunction( aiAddPlayer, S32, (const char * name, const char * ns), (""), "'playerName'[, 'AIClassType'] );") +DefineEngineFunction( aiAddPlayer, S32, (const char * name, const char * ns), (""), "'playerName'[, 'AIClassType'] );") { // Create the player AIClient *aiPlayer = new AIClient(); diff --git a/Engine/source/T3D/entity.cpp b/Engine/source/T3D/entity.cpp index 62c0b031f..fe0303652 100644 --- a/Engine/source/T3D/entity.cpp +++ b/Engine/source/T3D/entity.cpp @@ -2005,7 +2005,7 @@ DefineConsoleMethod(Entity, notify, void, (String signalFunction, String argA, S object->notifyComponents(signalFunction, argA, argB, argC, argD, argE); } -DefineConsoleFunction(findEntitiesByTag, const char*, (SimGroup* searchingGroup, String tags), (nullAsType(), ""), +DefineEngineFunction(findEntitiesByTag, const char*, (SimGroup* searchingGroup, String tags), (nullAsType(), ""), "Finds all entities that have the provided tags.\n" "@param searchingGroup The SimGroup to search inside. If null, we'll search the entire dictionary(this can be slow!).\n" "@param tags Word delimited list of tags to search for. If multiple tags are included, the list is eclusively parsed, requiring all tags provided to be found on an entity for a match.\n" diff --git a/Engine/source/T3D/gameBase/gameProcess.cpp b/Engine/source/T3D/gameBase/gameProcess.cpp index 2df8a850e..6aa5c0e63 100644 --- a/Engine/source/T3D/gameBase/gameProcess.cpp +++ b/Engine/source/T3D/gameBase/gameProcess.cpp @@ -34,7 +34,7 @@ ClientProcessList* ClientProcessList::smClientProcessList = NULL; ServerProcessList* ServerProcessList::smServerProcessList = NULL; static U32 gNetOrderNextId = 0; -DefineConsoleFunction( dumpProcessList, void, ( ), , +DefineEngineFunction( dumpProcessList, void, ( ), , "Dumps all ProcessObjects in ServerProcessList and ClientProcessList to the console." ) { Con::printf( "client process list:" ); diff --git a/Engine/source/T3D/gameFunctions.cpp b/Engine/source/T3D/gameFunctions.cpp index 23d048f7c..c49c75cb3 100644 --- a/Engine/source/T3D/gameFunctions.cpp +++ b/Engine/source/T3D/gameFunctions.cpp @@ -114,7 +114,7 @@ static U32 sgServerQueryIndex = 0; //SERVER FUNCTIONS ONLY ConsoleFunctionGroupBegin( Containers, "Spatial query functions. Server side only!"); -DefineConsoleFunction( containerFindFirst, const char*, (U32 typeMask, Point3F origin, Point3F size), , "(int mask, Point3F point, float x, float y, float z)" +DefineEngineFunction( containerFindFirst, const char*, (U32 typeMask, Point3F origin, Point3F size), , "(int mask, Point3F point, float x, float y, float z)" "@brief Find objects matching the bitmask type within a box centered at point, with extents x, y, z.\n\n" "@returns The first object found, or an empty string if nothing was found. Thereafter, you can get more " "results using containerFindNext()." @@ -146,7 +146,7 @@ DefineConsoleFunction( containerFindFirst, const char*, (U32 typeMask, Point3F o return buff; } -DefineConsoleFunction( containerFindNext, const char*, (), , "()" +DefineEngineFunction( containerFindNext, const char*, (), , "()" "@brief Get more results from a previous call to containerFindFirst().\n\n" "@note You must call containerFindFirst() to begin the search.\n" "@returns The next object found, or an empty string if nothing else was found.\n" diff --git a/Engine/source/T3D/physics/physicsPlugin.cpp b/Engine/source/T3D/physics/physicsPlugin.cpp index b2f06b55e..fec6f2186 100644 --- a/Engine/source/T3D/physics/physicsPlugin.cpp +++ b/Engine/source/T3D/physics/physicsPlugin.cpp @@ -124,31 +124,31 @@ void PhysicsPlugin::_debugDraw( SceneManager *graph, const SceneRenderState *sta world->onDebugDraw( state ); } -DefineConsoleFunction( physicsPluginPresent, bool, (), , "physicsPluginPresent()" +DefineEngineFunction( physicsPluginPresent, bool, (), , "physicsPluginPresent()" "@brief Returns true if a physics plugin exists and is initialized.\n\n" "@ingroup Physics" ) { return PHYSICSMGR != NULL; } -DefineConsoleFunction( physicsInit, bool, (const char * library), ("default"), "physicsInit( [string library] )") +DefineEngineFunction( physicsInit, bool, (const char * library), ("default"), "physicsInit( [string library] )") { return PhysicsPlugin::activate( library ); } -DefineConsoleFunction( physicsDestroy, void, (), , "physicsDestroy()") +DefineEngineFunction( physicsDestroy, void, (), , "physicsDestroy()") { if ( PHYSICSMGR ) PHYSICSMGR->destroyPlugin(); } -DefineConsoleFunction( physicsInitWorld, bool, (const char * worldName), , "physicsInitWorld( String worldName )") +DefineEngineFunction( physicsInitWorld, bool, (const char * worldName), , "physicsInitWorld( String worldName )") { bool res = PHYSICSMGR && PHYSICSMGR->createWorld( String( worldName ) ); return res; } -DefineConsoleFunction( physicsDestroyWorld, void, (const char * worldName), , "physicsDestroyWorld( String worldName )") +DefineEngineFunction( physicsDestroyWorld, void, (const char * worldName), , "physicsDestroyWorld( String worldName )") { if ( PHYSICSMGR ) PHYSICSMGR->destroyWorld( worldName ); @@ -157,19 +157,19 @@ DefineConsoleFunction( physicsDestroyWorld, void, (const char * worldName), , "p // Control/query of the stop/started state // of the currently running simulation. -DefineConsoleFunction( physicsStartSimulation, void, (const char * worldName), , "physicsStartSimulation( String worldName )") +DefineEngineFunction( physicsStartSimulation, void, (const char * worldName), , "physicsStartSimulation( String worldName )") { if ( PHYSICSMGR ) PHYSICSMGR->enableSimulation( String( worldName ), true ); } -DefineConsoleFunction( physicsStopSimulation, void, (const char * worldName), , "physicsStopSimulation( String worldName )") +DefineEngineFunction( physicsStopSimulation, void, (const char * worldName), , "physicsStopSimulation( String worldName )") { if ( PHYSICSMGR ) PHYSICSMGR->enableSimulation( String( worldName ), false ); } -DefineConsoleFunction( physicsSimulationEnabled, bool, (), , "physicsStopSimulation( String worldName )") +DefineEngineFunction( physicsSimulationEnabled, bool, (), , "physicsStopSimulation( String worldName )") { return PHYSICSMGR && PHYSICSMGR->isSimulationEnabled(); } @@ -177,14 +177,14 @@ DefineConsoleFunction( physicsSimulationEnabled, bool, (), , "physicsStopSimulat // Used for slowing down time on the // physics simulation, and for pausing/restarting // the simulation. -DefineConsoleFunction( physicsSetTimeScale, void, (F32 scale), , "physicsSetTimeScale( F32 scale )") +DefineEngineFunction( physicsSetTimeScale, void, (F32 scale), , "physicsSetTimeScale( F32 scale )") { if ( PHYSICSMGR ) PHYSICSMGR->setTimeScale( scale ); } // Get the currently set time scale. -DefineConsoleFunction( physicsGetTimeScale, F32, (), , "physicsGetTimeScale()") +DefineEngineFunction( physicsGetTimeScale, F32, (), , "physicsGetTimeScale()") { return PHYSICSMGR && PHYSICSMGR->getTimeScale(); } @@ -193,7 +193,7 @@ DefineConsoleFunction( physicsGetTimeScale, F32, (), , "physicsGetTimeScale()") // physics simulation that they should store // their current state for later restoration, // such as when the editor is closed. -DefineConsoleFunction( physicsStoreState, void, (), , "physicsStoreState()") +DefineEngineFunction( physicsStoreState, void, (), , "physicsStoreState()") { PhysicsPlugin::getPhysicsResetSignal().trigger( PhysicsResetEvent_Store ); } @@ -201,13 +201,13 @@ DefineConsoleFunction( physicsStoreState, void, (), , "physicsStoreState()") // Used to send a signal to objects in the // physics simulation that they should restore // their saved state, such as when the editor is opened. -DefineConsoleFunction( physicsRestoreState, void, (), , "physicsRestoreState()") +DefineEngineFunction( physicsRestoreState, void, (), , "physicsRestoreState()") { if ( PHYSICSMGR ) PHYSICSMGR->reset(); } -DefineConsoleFunction( physicsDebugDraw, void, (bool enable), , "physicsDebugDraw( bool enable )") +DefineEngineFunction( physicsDebugDraw, void, (bool enable), , "physicsDebugDraw( bool enable )") { if ( PHYSICSMGR ) PHYSICSMGR->enableDebugDraw( enable ); diff --git a/Engine/source/app/game.cpp b/Engine/source/app/game.cpp index 05f63e84c..d7a3377f6 100644 --- a/Engine/source/app/game.cpp +++ b/Engine/source/app/game.cpp @@ -67,7 +67,7 @@ bool gEditingMission = false; ConsoleFunctionGroupBegin( InputManagement, "Functions that let you deal with input from scripts" ); -DefineConsoleFunction( deactivateDirectInput, void, (), , +DefineEngineFunction( deactivateDirectInput, void, (), , "()" "@brief Disables DirectInput.\n\n" "Also deactivates any connected joysticks.\n\n" @@ -77,7 +77,7 @@ DefineConsoleFunction( deactivateDirectInput, void, (), , Input::deactivate(); } -DefineConsoleFunction( activateDirectInput, void, (), , +DefineEngineFunction( activateDirectInput, void, (), , "()" "@brief Activates DirectInput.\n\n" "Also activates any connected joysticks." @@ -91,7 +91,7 @@ ConsoleFunctionGroupEnd( InputManagement ); //-------------------------------------------------------------------------- static const U32 MaxPlayerNameLength = 16; -DefineConsoleFunction( strToPlayerName, const char*, (const char* ptr ), , "strToPlayerName(string);" ) +DefineEngineFunction( strToPlayerName, const char*, (const char* ptr ), , "strToPlayerName(string);" ) { // Strip leading spaces and underscores: @@ -147,7 +147,7 @@ DefineConsoleFunction( strToPlayerName, const char*, (const char* ptr ), , "strT ConsoleFunctionGroupBegin( Platform , "General platform functions."); -DefineConsoleFunction( lockMouse, void, (bool isLocked ), , "(bool isLocked)" +DefineEngineFunction( lockMouse, void, (bool isLocked ), , "(bool isLocked)" "@brief Lock or unlock the mouse to the window.\n\n" "When true, prevents the mouse from leaving the bounds of the game window.\n\n" "@ingroup Input") @@ -156,7 +156,7 @@ DefineConsoleFunction( lockMouse, void, (bool isLocked ), , "(bool isLocked)" } -DefineConsoleFunction( setNetPort, bool, (int port, bool bind), (true), "(int port, bool bind=true)" +DefineEngineFunction( setNetPort, bool, (int port, bool bind), (true), "(int port, bool bind=true)" "@brief Set the network port for the game to use.\n\n" "@param port The port to use.\n" @@ -171,28 +171,28 @@ DefineConsoleFunction( setNetPort, bool, (int port, bool bind), (true), "(int po return Net::openPort((S32)port, bind); } -DefineConsoleFunction(isAddressTypeAvailable, bool, (int addressType), , "(protocol id)" +DefineEngineFunction(isAddressTypeAvailable, bool, (int addressType), , "(protocol id)" "@brief Determines if a specified address type can be reached.\n\n" "@ingroup Networking") { return Net::isAddressTypeAvailable((NetAddress::Type)addressType); } -DefineConsoleFunction( closeNetPort, void, (), , "()" +DefineEngineFunction( closeNetPort, void, (), , "()" "@brief Closes the current network port\n\n" "@ingroup Networking") { Net::closePort(); } -DefineConsoleFunction( saveJournal, void, (const char * filename), , "(string filename)" +DefineEngineFunction( saveJournal, void, (const char * filename), , "(string filename)" "Save the journal to the specified file.\n\n" "@ingroup Platform") { Journal::Record(filename); } -DefineConsoleFunction( playJournal, void, (const char * filename), , "(string filename)" +DefineEngineFunction( playJournal, void, (const char * filename), , "(string filename)" "@brief Begin playback of a journal from a specified field.\n\n" "@param filename Name and path of file journal file\n" "@ingroup Platform") @@ -202,7 +202,7 @@ DefineConsoleFunction( playJournal, void, (const char * filename), , "(string fi Journal::Play(filename); } -DefineConsoleFunction( getSimTime, S32, (), , "()" +DefineEngineFunction( getSimTime, S32, (), , "()" "Return the current sim time in milliseconds.\n\n" "@brief Sim time is time since the game started.\n\n" "@ingroup Platform") @@ -210,7 +210,7 @@ DefineConsoleFunction( getSimTime, S32, (), , "()" return Sim::getCurrentTime(); } -DefineConsoleFunction( getRealTime, S32, (), , "()" +DefineEngineFunction( getRealTime, S32, (), , "()" "@brief Return the current real time in milliseconds.\n\n" "Real time is platform defined; typically time since the computer booted.\n\n" "@ingroup Platform") diff --git a/Engine/source/app/net/serverQuery.cpp b/Engine/source/app/net/serverQuery.cpp index 05d31e531..ef3f9daa9 100644 --- a/Engine/source/app/net/serverQuery.cpp +++ b/Engine/source/app/net/serverQuery.cpp @@ -429,7 +429,7 @@ void queryLanServers(U32 port, U8 flags, const char* gameType, const char* missi //----------------------------------------------------------------------------- -DefineConsoleFunction( queryAllServers +DefineEngineFunction( queryAllServers , void, ( U32 lanPort , U32 flags , const char * gameType @@ -455,7 +455,7 @@ DefineConsoleFunction( queryAllServers } -DefineConsoleFunction( queryLanServers +DefineEngineFunction( queryLanServers , void, ( U32 lanPort , U32 flags , const char * gameType @@ -560,7 +560,7 @@ void queryMasterServer(U8 flags, const char* gameType, const char* missionType, processMasterServerQuery( gPingSession ); } -DefineConsoleFunction( queryMasterServer +DefineEngineFunction( queryMasterServer , void, ( U32 flags , const char * gameType , const char * missionType @@ -582,7 +582,7 @@ DefineConsoleFunction( queryMasterServer //----------------------------------------------------------------------------- -DefineConsoleFunction( querySingleServer +DefineEngineFunction( querySingleServer , void, ( const char* addrText, U8 flags ) , (0), "querySingleServer(address, flags);" ) { @@ -668,7 +668,7 @@ void cancelServerQuery() } } -DefineConsoleFunction( cancelServerQuery, void, (), , "cancelServerQuery();" ) +DefineEngineFunction( cancelServerQuery, void, (), , "cancelServerQuery();" ) { cancelServerQuery(); } @@ -696,14 +696,14 @@ void stopServerQuery() } } -DefineConsoleFunction( stopServerQuery, void, (), , "stopServerQuery();" ) +DefineEngineFunction( stopServerQuery, void, (), , "stopServerQuery();" ) { stopServerQuery(); } //----------------------------------------------------------------------------- -DefineConsoleFunction( startHeartbeat, void, (), , "startHeartbeat();" ) +DefineEngineFunction( startHeartbeat, void, (), , "startHeartbeat();" ) { if (validateAuthenticatedServer()) { gHeartbeatSeq++; @@ -711,19 +711,19 @@ DefineConsoleFunction( startHeartbeat, void, (), , "startHeartbeat();" ) } } -DefineConsoleFunction( stopHeartbeat, void, (), , "stopHeartbeat();" ) +DefineEngineFunction( stopHeartbeat, void, (), , "stopHeartbeat();" ) { gHeartbeatSeq++; } //----------------------------------------------------------------------------- -DefineConsoleFunction( getServerCount, int, (), , "getServerCount();" ) +DefineEngineFunction( getServerCount, int, (), , "getServerCount();" ) { return gServerList.size(); } -DefineConsoleFunction( setServerInfo, bool, (U32 index), , "setServerInfo(index);" ) +DefineEngineFunction( setServerInfo, bool, (U32 index), , "setServerInfo(index);" ) { if (index < gServerList.size()) { ServerInfo& info = gServerList[index]; diff --git a/Engine/source/app/version.cpp b/Engine/source/app/version.cpp index bced8730a..7a26adb3d 100644 --- a/Engine/source/app/version.cpp +++ b/Engine/source/app/version.cpp @@ -92,44 +92,44 @@ const char* getCompileTimeString() ConsoleFunctionGroupBegin( CompileInformation, "Functions to get version information about the current executable." ); -DefineConsoleFunction( getVersionNumber, S32, (), , "Get the version of the engine build, as a string.\n\n" +DefineEngineFunction( getVersionNumber, S32, (), , "Get the version of the engine build, as a string.\n\n" "@ingroup Debugging") { return getVersionNumber(); } -DefineConsoleFunction( getAppVersionNumber, S32, (), , "Get the version of the application build, as a string.\n\n" +DefineEngineFunction( getAppVersionNumber, S32, (), , "Get the version of the application build, as a string.\n\n" "@ingroup Debugging") { return getAppVersionNumber(); } -DefineConsoleFunction( getVersionString, const char*, (), , "Get the version of the engine build, as a human readable string.\n\n" +DefineEngineFunction( getVersionString, const char*, (), , "Get the version of the engine build, as a human readable string.\n\n" "@ingroup Debugging") { return getVersionString(); } -DefineConsoleFunction( getAppVersionString, const char*, (), , "Get the version of the aplication build, as a human readable string.\n\n" +DefineEngineFunction( getAppVersionString, const char*, (), , "Get the version of the aplication build, as a human readable string.\n\n" "@ingroup Debugging") { return getAppVersionString(); } -DefineConsoleFunction( getEngineName, const char*, (), , "Get the name of the engine product that this is running from, as a string.\n\n" +DefineEngineFunction( getEngineName, const char*, (), , "Get the name of the engine product that this is running from, as a string.\n\n" "@ingroup Debugging") { return getEngineProductString(); } -DefineConsoleFunction( getCompileTimeString, const char*, (), , "Get the time of compilation.\n\n" +DefineEngineFunction( getCompileTimeString, const char*, (), , "Get the time of compilation.\n\n" "@ingroup Debugging") { return getCompileTimeString(); } -DefineConsoleFunction( getBuildString, const char*, (), , "Get the type of build, \"Debug\" or \"Release\".\n\n" +DefineEngineFunction( getBuildString, const char*, (), , "Get the type of build, \"Debug\" or \"Release\".\n\n" "@ingroup Debugging") { #ifdef TORQUE_DEBUG diff --git a/Engine/source/assets/assetQuery_ScriptBinding.h b/Engine/source/assets/assetQuery_ScriptBinding.h index 3324054e1..1656d2eb3 100644 --- a/Engine/source/assets/assetQuery_ScriptBinding.h +++ b/Engine/source/assets/assetQuery_ScriptBinding.h @@ -26,7 +26,7 @@ #include "console/engineAPI.h" -DefineConsoleMethod(AssetQuery, clear, void, (),,"Clears all asset Id results." +DefineEngineMethod(AssetQuery, clear, void, (),,"Clears all asset Id results." "Clears all asset Id results.\n" "@return () No return value.\n") { @@ -36,7 +36,7 @@ DefineConsoleMethod(AssetQuery, clear, void, (),,"Clears all asset Id results." //----------------------------------------------------------------------------- -DefineConsoleMethod(AssetQuery, set, bool, (S32 queryId), , +DefineEngineMethod(AssetQuery, set, bool, (S32 queryId), , "Sets the asset query to a copy of the specified asset query.\n" "@param assetQuery The asset query to copy.\n" "@return Whether the operation succeeded or not.\n") diff --git a/Engine/source/cinterface/cinterface.cpp b/Engine/source/cinterface/cinterface.cpp index aa0fae035..0820b3cf8 100644 --- a/Engine/source/cinterface/cinterface.cpp +++ b/Engine/source/cinterface/cinterface.cpp @@ -436,7 +436,7 @@ extern "C" { // By default, it is marked as secure by the web plugins and then can be called from // Javascript on the web page to ensure that function calls across the language // boundry are working with arguments and return values -DefineConsoleFunction( testJavaScriptBridge, const char *, (const char* arg1, const char* arg2, const char* arg3), , "testBridge(arg1, arg2, arg3)") +DefineEngineFunction( testJavaScriptBridge, const char *, (const char* arg1, const char* arg2, const char* arg3), , "testBridge(arg1, arg2, arg3)") { S32 failed = 0; if (dStrcmp(arg1,"one")) diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index dc7dde340..55880f30f 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -277,7 +277,7 @@ bool useTimestamp = false; ConsoleFunctionGroupBegin( Clipboard, "Miscellaneous functions to control the clipboard and clear the console."); -DefineConsoleFunction( cls, void, (), , "()" +DefineEngineFunction( cls, void, (), , "()" "@brief Clears the console output.\n\n" "@ingroup Console") { @@ -287,14 +287,14 @@ DefineConsoleFunction( cls, void, (), , "()" consoleLog.setSize(0); }; -DefineConsoleFunction( getClipboard, const char*, (), , "()" +DefineEngineFunction( getClipboard, const char*, (), , "()" "@brief Get text from the clipboard.\n\n" "@internal") { return Platform::getClipboard(); }; -DefineConsoleFunction( setClipboard, bool, (const char* text), , "(string text)" +DefineEngineFunction( setClipboard, bool, (const char* text), , "(string text)" "@brief Set the system clipboard.\n\n" "@internal") { diff --git a/Engine/source/console/consoleDoc.cpp b/Engine/source/console/consoleDoc.cpp index f4b74402b..59ea543a1 100644 --- a/Engine/source/console/consoleDoc.cpp +++ b/Engine/source/console/consoleDoc.cpp @@ -41,7 +41,7 @@ ConsoleFunctionGroupBegin(ConsoleDoc, "Console self-documentation functions. These output psuedo C++ suitable for feeeding through Doxygen or another auto documentation tool."); -DefineConsoleFunction( dumpConsoleClasses, void, (bool dumpScript, bool dumpEngine), ( true, true ), +DefineEngineFunction( dumpConsoleClasses, void, (bool dumpScript, bool dumpEngine), ( true, true ), "@brief Dumps all declared console classes to the console.\n\n" "@param dumpScript Optional parameter specifying whether or not classes defined in script should be dumped.\n" "@param dumpEngine Optional parameter specifying whether or not classes defined in the engine should be dumped.\n" @@ -50,7 +50,7 @@ DefineConsoleFunction( dumpConsoleClasses, void, (bool dumpScript, bool dumpEngi Namespace::dumpClasses( dumpScript, dumpEngine ); } -DefineConsoleFunction(dumpConsoleFunctions, void, ( bool dumpScript, bool dumpEngine ), ( true, true ), +DefineEngineFunction(dumpConsoleFunctions, void, ( bool dumpScript, bool dumpEngine ), ( true, true ), "@brief Dumps all declared console functions to the console.\n" "@param dumpScript Optional parameter specifying whether or not functions defined in script should be dumped.\n" "@param dumpEngine Optional parameter specitying whether or not functions defined in the engine should be dumped.\n" diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index d32b30d31..258f7911f 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -184,7 +184,7 @@ bool isValidPort(U16 port) //----------------------------------------------------------------------------- -DefineConsoleFunction( strasc, int, ( const char* chr ),, +DefineEngineFunction( strasc, int, ( const char* chr ),, "Return the integer character code value corresponding to the first character in the given string.\n" "@param chr a (one-character) string.\n" "@return the UTF32 code value for the first character in the given string.\n" @@ -195,7 +195,7 @@ DefineConsoleFunction( strasc, int, ( const char* chr ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strformat, const char*, ( const char* format, const char* value ),, +DefineEngineFunction( strformat, const char*, ( const char* format, const char* value ),, "Format the given value as a string using printf-style formatting.\n" "@param format A printf-style format string.\n" "@param value The value argument matching the given format string.\n\n" @@ -252,7 +252,7 @@ DefineConsoleFunction( strformat, const char*, ( const char* format, const char* //----------------------------------------------------------------------------- -DefineConsoleFunction( strcmp, S32, ( const char* str1, const char* str2 ),, +DefineEngineFunction( strcmp, S32, ( const char* str1, const char* str2 ),, "Compares two strings using case-sensitive comparison.\n" "@param str1 The first string.\n" "@param str2 The second string.\n" @@ -271,7 +271,7 @@ DefineConsoleFunction( strcmp, S32, ( const char* str1, const char* str2 ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( stricmp, S32, ( const char* str1, const char* str2 ),, +DefineEngineFunction( stricmp, S32, ( const char* str1, const char* str2 ),, "Compares two strings using case-insensitive comparison.\n" "@param str1 The first string.\n" "@param str2 The second string.\n" @@ -290,7 +290,7 @@ DefineConsoleFunction( stricmp, S32, ( const char* str1, const char* str2 ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strnatcmp, S32, ( const char* str1, const char* str2 ),, +DefineEngineFunction( strnatcmp, S32, ( const char* str1, const char* str2 ),, "Compares two strings using \"natural order\" case-sensitive comparison.\n" "Natural order means that rather than solely comparing single character code values, strings are ordered in a " "natural way. For example, the string \"hello10\" is considered greater than the string \"hello2\" even though " @@ -325,7 +325,7 @@ DefineConsoleFunction( strnatcmp, S32, ( const char* str1, const char* str2 ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strinatcmp, S32, ( const char* str1, const char* str2 ),, +DefineEngineFunction( strinatcmp, S32, ( const char* str1, const char* str2 ),, "Compares two strings using \"natural order\" case-insensitive comparison.\n" "Natural order means that rather than solely comparing single character code values, strings are ordered in a " "natural way. For example, the string \"hello10\" is considered greater than the string \"hello2\" even though " @@ -360,7 +360,7 @@ DefineConsoleFunction( strinatcmp, S32, ( const char* str1, const char* str2 ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strlen, S32, ( const char* str ),, +DefineEngineFunction( strlen, S32, ( const char* str ),, "Get the length of the given string in bytes.\n" "@note This does not return a true character count for strings with multi-byte characters!\n" "@param str A string.\n" @@ -371,7 +371,7 @@ DefineConsoleFunction( strlen, S32, ( const char* str ),, } //----------------------------------------------------------------------------- -DefineConsoleFunction( strlenskip, S32, ( const char* str, const char* first, const char* last ),, +DefineEngineFunction( strlenskip, S32, ( const char* str, const char* first, const char* last ),, "Calculate the length of a string in characters, skipping everything between and including first and last.\n" "@param str A string.\n" "@param first First character to look for to skip block of text.\n" @@ -406,7 +406,7 @@ DefineConsoleFunction( strlenskip, S32, ( const char* str, const char* first, co //----------------------------------------------------------------------------- -DefineConsoleFunction( strstr, S32, ( const char* string, const char* substring ),, +DefineEngineFunction( strstr, S32, ( const char* string, const char* substring ),, "Find the start of @a substring in the given @a string searching from left to right.\n" "@param string The string to search.\n" "@param substring The string to search for.\n" @@ -425,7 +425,7 @@ DefineConsoleFunction( strstr, S32, ( const char* string, const char* substring //----------------------------------------------------------------------------- -DefineConsoleFunction( strpos, S32, ( const char* haystack, const char* needle, S32 offset ), ( 0 ), +DefineEngineFunction( strpos, S32, ( const char* haystack, const char* needle, S32 offset ), ( 0 ), "Find the start of @a needle in @a haystack searching from left to right beginning at the given offset.\n" "@param haystack The string to search.\n" "@param needle The string to search for.\n" @@ -450,7 +450,7 @@ DefineConsoleFunction( strpos, S32, ( const char* haystack, const char* needle, //----------------------------------------------------------------------------- -DefineConsoleFunction( strposr, S32, ( const char* haystack, const char* needle, S32 offset ), ( 0 ), +DefineEngineFunction( strposr, S32, ( const char* haystack, const char* needle, S32 offset ), ( 0 ), "Find the start of @a needle in @a haystack searching from right to left beginning at the given offset.\n" "@param haystack The string to search.\n" "@param needle The string to search for.\n" @@ -477,7 +477,7 @@ DefineConsoleFunction( strposr, S32, ( const char* haystack, const char* needle, //----------------------------------------------------------------------------- -DefineConsoleFunction( ltrim, const char*, ( const char* str ),, +DefineEngineFunction( ltrim, const char*, ( const char* str ),, "Remove leading whitespace from the string.\n" "@param str A string.\n" "@return A string that is the same as @a str but with any leading (i.e. leftmost) whitespace removed.\n\n" @@ -496,7 +496,7 @@ DefineConsoleFunction( ltrim, const char*, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( rtrim, const char*, ( const char* str ),, +DefineEngineFunction( rtrim, const char*, ( const char* str ),, "Remove trailing whitespace from the string.\n" "@param str A string.\n" "@return A string that is the same as @a str but with any trailing (i.e. rightmost) whitespace removed.\n\n" @@ -523,7 +523,7 @@ DefineConsoleFunction( rtrim, const char*, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( trim, const char*, ( const char* str ),, +DefineEngineFunction( trim, const char*, ( const char* str ),, "Remove leading and trailing whitespace from the string.\n" "@param str A string.\n" "@return A string that is the same as @a str but with any leading (i.e. leftmost) and trailing (i.e. rightmost) whitespace removed.\n\n" @@ -551,7 +551,7 @@ DefineConsoleFunction( trim, const char*, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( stripChars, const char*, ( const char* str, const char* chars ),, +DefineEngineFunction( stripChars, const char*, ( const char* str, const char* chars ),, "Remove all occurrences of characters contained in @a chars from @a str.\n" "@param str The string to filter characters out from.\n" "@param chars A string of characters to filter out from @a str.\n" @@ -575,7 +575,7 @@ DefineConsoleFunction( stripChars, const char*, ( const char* str, const char* c //----------------------------------------------------------------------------- -DefineConsoleFunction( strlwr, const char*, ( const char* str ),, +DefineEngineFunction( strlwr, const char*, ( const char* str ),, "Return an all lower-case version of the given string.\n" "@param str A string.\n" "@return A version of @a str with all characters converted to lower-case.\n\n" @@ -593,7 +593,7 @@ DefineConsoleFunction( strlwr, const char*, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strupr, const char*, ( const char* str ),, +DefineEngineFunction( strupr, const char*, ( const char* str ),, "Return an all upper-case version of the given string.\n" "@param str A string.\n" "@return A version of @a str with all characters converted to upper-case.\n\n" @@ -611,7 +611,7 @@ DefineConsoleFunction( strupr, const char*, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strchr, const char*, ( const char* str, const char* chr ),, +DefineEngineFunction( strchr, const char*, ( const char* str, const char* chr ),, "Find the first occurrence of the given character in @a str.\n" "@param str The string to search.\n" "@param chr The character to search for. Only the first character from the string is taken.\n" @@ -625,7 +625,7 @@ DefineConsoleFunction( strchr, const char*, ( const char* str, const char* chr ) //----------------------------------------------------------------------------- -DefineConsoleFunction( strrchr, const char*, ( const char* str, const char* chr ),, +DefineEngineFunction( strrchr, const char*, ( const char* str, const char* chr ),, "Find the last occurrence of the given character in @a str." "@param str The string to search.\n" "@param chr The character to search for. Only the first character from the string is taken.\n" @@ -639,7 +639,7 @@ DefineConsoleFunction( strrchr, const char*, ( const char* str, const char* chr //----------------------------------------------------------------------------- -DefineConsoleFunction( strreplace, const char*, ( const char* source, const char* from, const char* to ),, +DefineEngineFunction( strreplace, const char*, ( const char* source, const char* from, const char* to ),, "Replace all occurrences of @a from in @a source with @a to.\n" "@param source The string in which to replace the occurrences of @a from.\n" "@param from The string to replace in @a source.\n" @@ -690,7 +690,7 @@ DefineConsoleFunction( strreplace, const char*, ( const char* source, const char //----------------------------------------------------------------------------- -DefineConsoleFunction( strrepeat, const char*, ( const char* str, S32 numTimes, const char* delimiter ), ( "" ), +DefineEngineFunction( strrepeat, const char*, ( const char* str, S32 numTimes, const char* delimiter ), ( "" ), "Return a string that repeats @a str @a numTimes number of times delimiting each occurrence with @a delimiter.\n" "@param str The string to repeat multiple times.\n" "@param numTimes The number of times to repeat @a str in the result string.\n" @@ -717,7 +717,7 @@ DefineConsoleFunction( strrepeat, const char*, ( const char* str, S32 numTimes, //----------------------------------------------------------------------------- -DefineConsoleFunction( getSubStr, const char*, ( const char* str, S32 start, S32 numChars ), ( -1 ), +DefineEngineFunction( getSubStr, const char*, ( const char* str, S32 start, S32 numChars ), ( -1 ), "@brief Return a substring of @a str starting at @a start and continuing either through to the end of @a str " "(if @a numChars is -1) or for @a numChars characters (except if this would exceed the actual source " "string length).\n" @@ -758,7 +758,7 @@ DefineConsoleFunction( getSubStr, const char*, ( const char* str, S32 start, S32 //----------------------------------------------------------------------------- -DefineConsoleFunction( strIsMatchExpr, bool, ( const char* pattern, const char* str, bool caseSensitive ), ( false ), +DefineEngineFunction( strIsMatchExpr, bool, ( const char* pattern, const char* str, bool caseSensitive ), ( false ), "Match a pattern against a string.\n" "@param pattern The wildcard pattern to match against. The pattern can include characters, '*' to match " "any number of characters and '?' to match a single character.\n" @@ -777,7 +777,7 @@ DefineConsoleFunction( strIsMatchExpr, bool, ( const char* pattern, const char* //----------------------------------------------------------------------------- -DefineConsoleFunction( strIsMatchMultipleExpr, bool, ( const char* patterns, const char* str, bool caseSensitive ), ( false ), +DefineEngineFunction( strIsMatchMultipleExpr, bool, ( const char* patterns, const char* str, bool caseSensitive ), ( false ), "Match a multiple patterns against a single string.\n" "@param patterns A tab-separated list of patterns. Each pattern can include charaters, '*' to match " "any number of characters and '?' to match a single character. Each of the patterns is tried in turn.\n" @@ -796,7 +796,7 @@ DefineConsoleFunction( strIsMatchMultipleExpr, bool, ( const char* patterns, con //----------------------------------------------------------------------------- -DefineConsoleFunction( getTrailingNumber, S32, ( const char* str ),, +DefineEngineFunction( getTrailingNumber, S32, ( const char* str ),, "Get the numeric suffix of the given input string.\n" "@param str The string from which to read out the numeric suffix.\n" "@return The numeric value of the number suffix of @a str or -1 if @a str has no such suffix.\n\n" @@ -813,7 +813,7 @@ DefineConsoleFunction( getTrailingNumber, S32, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( stripTrailingNumber, String, ( const char* str ),, +DefineEngineFunction( stripTrailingNumber, String, ( const char* str ),, "Strip a numeric suffix from the given string.\n" "@param str The string from which to strip its numeric suffix.\n" "@return The string @a str without its number suffix or the original string @a str if it has no such suffix.\n\n" @@ -829,7 +829,7 @@ DefineConsoleFunction( stripTrailingNumber, String, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( getFirstNumber, String, ( const char* str ),, +DefineEngineFunction( getFirstNumber, String, ( const char* str ),, "Get the first occuring number from @a str.\n" "@param str The string from which to read out the first number.\n" "@return String representation of the number or "" if no number.\n\n") @@ -841,7 +841,7 @@ DefineConsoleFunction( getFirstNumber, String, ( const char* str ),, //---------------------------------------------------------------- -DefineConsoleFunction( isspace, bool, ( const char* str, S32 index ),, +DefineEngineFunction( isspace, bool, ( const char* str, S32 index ),, "Test whether the character at the given position is a whitespace character.\n" "Characters such as tab, space, or newline are considered whitespace.\n" "@param str The string to test.\n" @@ -858,7 +858,7 @@ DefineConsoleFunction( isspace, bool, ( const char* str, S32 index ),, //---------------------------------------------------------------- -DefineConsoleFunction( isalnum, bool, ( const char* str, S32 index ),, +DefineEngineFunction( isalnum, bool, ( const char* str, S32 index ),, "Test whether the character at the given position is an alpha-numeric character.\n" "Alpha-numeric characters are characters that are either alphabetic (a-z, A-Z) or numbers (0-9).\n" "@param str The string to test.\n" @@ -875,7 +875,7 @@ DefineConsoleFunction( isalnum, bool, ( const char* str, S32 index ),, //---------------------------------------------------------------- -DefineConsoleFunction( startsWith, bool, ( const char* str, const char* prefix, bool caseSensitive ), ( false ), +DefineEngineFunction( startsWith, bool, ( const char* str, const char* prefix, bool caseSensitive ), ( false ), "Test whether the given string begins with the given prefix.\n" "@param str The string to test.\n" "@param prefix The potential prefix of @a str.\n" @@ -924,7 +924,7 @@ DefineConsoleFunction( startsWith, bool, ( const char* str, const char* prefix, //---------------------------------------------------------------- -DefineConsoleFunction( endsWith, bool, ( const char* str, const char* suffix, bool caseSensitive ), ( false ), +DefineEngineFunction( endsWith, bool, ( const char* str, const char* suffix, bool caseSensitive ), ( false ), "@brief Test whether the given string ends with the given suffix.\n\n" "@param str The string to test.\n" "@param suffix The potential suffix of @a str.\n" @@ -978,7 +978,7 @@ DefineConsoleFunction( endsWith, bool, ( const char* str, const char* suffix, bo //---------------------------------------------------------------- -DefineConsoleFunction( strchrpos, S32, ( const char* str, const char* chr, S32 start ), ( 0 ), +DefineEngineFunction( strchrpos, S32, ( const char* str, const char* chr, S32 start ), ( 0 ), "Find the first occurrence of the given character in the given string.\n" "@param str The string to search.\n" "@param chr The character to look for. Only the first character of this string will be searched for.\n" @@ -998,7 +998,7 @@ DefineConsoleFunction( strchrpos, S32, ( const char* str, const char* chr, S32 s //---------------------------------------------------------------- -DefineConsoleFunction( strrchrpos, S32, ( const char* str, const char* chr, S32 start ), ( 0 ), +DefineEngineFunction( strrchrpos, S32, ( const char* str, const char* chr, S32 start ), ( 0 ), "Find the last occurrence of the given character in the given string.\n" "@param str The string to search.\n" "@param chr The character to look for. Only the first character of this string will be searched for.\n" @@ -1025,7 +1025,7 @@ DefineConsoleFunction( strrchrpos, S32, ( const char* str, const char* chr, S32 //---------------------------------------------------------------- -DefineConsoleFunction(ColorFloatToInt, ColorI, (LinearColorF color), , +DefineEngineFunction(ColorFloatToInt, ColorI, (LinearColorF color), , "Convert from a float color to an integer color (0.0 - 1.0 to 0 to 255).\n" "@param color Float color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha.\n" "@return Converted color value (0 - 255)\n\n" @@ -1037,7 +1037,7 @@ DefineConsoleFunction(ColorFloatToInt, ColorI, (LinearColorF color), , return color.toColorI(); } -DefineConsoleFunction(ColorIntToFloat, LinearColorF, (ColorI color), , +DefineEngineFunction(ColorIntToFloat, LinearColorF, (ColorI color), , "Convert from a integer color to an float color (0 to 255 to 0.0 - 1.0).\n" "@param color Integer color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha.\n" "@return Converted color value (0.0 - 1.0)\n\n" @@ -1049,7 +1049,7 @@ DefineConsoleFunction(ColorIntToFloat, LinearColorF, (ColorI color), , return LinearColorF(color); } -DefineConsoleFunction(ColorRGBToHEX, const char*, (ColorI color), , +DefineEngineFunction(ColorRGBToHEX, const char*, (ColorI color), , "Convert from a integer RGB (red, green, blue) color to hex color value (0 to 255 to 00 - FF).\n" "@param color Integer color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha. It excepts an alpha, but keep in mind this will not be converted.\n" "@return Hex color value (#000000 - #FFFFFF), alpha isn't handled/converted so it is only the RGB value\n\n" @@ -1061,7 +1061,7 @@ DefineConsoleFunction(ColorRGBToHEX, const char*, (ColorI color), , return Con::getReturnBuffer(color.getHex()); } -DefineConsoleFunction(ColorRGBToHSB, const char*, (ColorI color), , +DefineEngineFunction(ColorRGBToHSB, const char*, (ColorI color), , "Convert from a integer RGB (red, green, blue) color to HSB (hue, saturation, brightness). HSB is also know as HSL or HSV as well, with the last letter standing for lightness or value.\n" "@param color Integer color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha. It excepts an alpha, but keep in mind this will not be converted.\n" "@return HSB color value, alpha isn't handled/converted so it is only the RGB value\n\n" @@ -1075,7 +1075,7 @@ DefineConsoleFunction(ColorRGBToHSB, const char*, (ColorI color), , return Con::getReturnBuffer(s); } -DefineConsoleFunction(ColorHEXToRGB, ColorI, (const char* hex), , +DefineEngineFunction(ColorHEXToRGB, ColorI, (const char* hex), , "Convert from a hex color value to an integer RGB (red, green, blue) color (00 - FF to 0 to 255).\n" "@param hex Hex color value (#000000 - #FFFFFF) to be converted to an RGB (red, green, blue) value.\n" "@return Integer color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha. Alpha isn't handled/converted so only pay attention to the RGB value\n\n" @@ -1089,7 +1089,7 @@ DefineConsoleFunction(ColorHEXToRGB, ColorI, (const char* hex), , return color; } -DefineConsoleFunction(ColorHSBToRGB, ColorI, (Point3I hsb), , +DefineEngineFunction(ColorHSBToRGB, ColorI, (Point3I hsb), , "Convert from a HSB (hue, saturation, brightness) to an integer RGB (red, green, blue) color. HSB is also know as HSL or HSV as well, with the last letter standing for lightness or value.\n" "@param hsb HSB (hue, saturation, brightness) value to be converted.\n" "@return Integer color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha. Alpha isn't handled/converted so only pay attention to the RGB value\n\n" @@ -1105,7 +1105,7 @@ DefineConsoleFunction(ColorHSBToRGB, ColorI, (Point3I hsb), , //---------------------------------------------------------------- -DefineConsoleFunction( strToggleCaseToWords, const char*, ( const char* str ),, +DefineEngineFunction( strToggleCaseToWords, const char*, ( const char* str ),, "Parse a Toggle Case word into separate words.\n" "@param str The string to parse.\n" "@return new string space separated.\n\n" @@ -1130,7 +1130,7 @@ DefineConsoleFunction( strToggleCaseToWords, const char*, ( const char* str ),, //---------------------------------------------------------------- // Warning: isInt and isFloat are very 'strict' and might need to be adjusted to allow other values. //seanmc -DefineConsoleFunction( isInt, bool, ( const char* str),, +DefineEngineFunction( isInt, bool, ( const char* str),, "Returns true if the string is an integer.\n" "@param str The string to test.\n" "@return true if @a str is an integer and false if not\n\n" @@ -1144,7 +1144,7 @@ DefineConsoleFunction( isInt, bool, ( const char* str),, //---------------------------------------------------------------- -DefineConsoleFunction( isFloat, bool, ( const char* str, bool sciOk), (false), +DefineEngineFunction( isFloat, bool, ( const char* str, bool sciOk), (false), "Returns true if the string is a float.\n" "@param str The string to test.\n" "@param sciOk Test for correct scientific notation and accept it (ex. 1.2e+14)" @@ -1159,7 +1159,7 @@ DefineConsoleFunction( isFloat, bool, ( const char* str, bool sciOk), (false), //---------------------------------------------------------------- -DefineConsoleFunction( isValidPort, bool, ( const char* str),, +DefineEngineFunction( isValidPort, bool, ( const char* str),, "Returns true if the string is a valid port number.\n" "@param str The string to test.\n" "@return true if @a str is a port and false if not\n\n" @@ -1179,7 +1179,7 @@ DefineConsoleFunction( isValidPort, bool, ( const char* str),, //---------------------------------------------------------------- -DefineConsoleFunction( isValidIP, bool, ( const char* str),, +DefineEngineFunction( isValidIP, bool, ( const char* str),, "Returns true if the string is a valid ip address, excepts localhost.\n" "@param str The string to test.\n" "@return true if @a str is a valid ip address and false if not\n\n" @@ -1214,7 +1214,7 @@ ConsoleFunction(addCaseSensitiveStrings,void,2,0,"[string1, string2, ...]" //----------------------------------------------------------------------------- -DefineConsoleFunction( getWord, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( getWord, const char*, ( const char* text, S32 index ),, "Extract the word at the given @a index in the whitespace-separated list in @a text.\n" "Words in @a text must be separated by newlines, spaces, and/or tabs.\n" "@param text A whitespace-separated list of words.\n" @@ -1235,7 +1235,7 @@ DefineConsoleFunction( getWord, const char*, ( const char* text, S32 index ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( getWords, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), +DefineEngineFunction( getWords, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), "Extract a range of words from the given @a startIndex onwards thru @a endIndex.\n" "Words in @a text must be separated by newlines, spaces, and/or tabs.\n" "@param text A whitespace-separated list of words.\n" @@ -1262,7 +1262,7 @@ DefineConsoleFunction( getWords, const char*, ( const char* text, S32 startIndex //----------------------------------------------------------------------------- -DefineConsoleFunction( setWord, const char*, ( const char* text, S32 index, const char* replacement ),, +DefineEngineFunction( setWord, const char*, ( const char* text, S32 index, const char* replacement ),, "Replace the word in @a text at the given @a index with @a replacement.\n" "Words in @a text must be separated by newlines, spaces, and/or tabs.\n" "@param text A whitespace-separated list of words.\n" @@ -1284,7 +1284,7 @@ DefineConsoleFunction( setWord, const char*, ( const char* text, S32 index, cons //----------------------------------------------------------------------------- -DefineConsoleFunction( removeWord, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( removeWord, const char*, ( const char* text, S32 index ),, "Remove the word in @a text at the given @a index.\n" "Words in @a text must be separated by newlines, spaces, and/or tabs.\n" "@param text A whitespace-separated list of words.\n" @@ -1304,7 +1304,7 @@ DefineConsoleFunction( removeWord, const char*, ( const char* text, S32 index ), //----------------------------------------------------------------------------- -DefineConsoleFunction( getWordCount, S32, ( const char* text ),, +DefineEngineFunction( getWordCount, S32, ( const char* text ),, "Return the number of whitespace-separated words in @a text.\n" "Words in @a text must be separated by newlines, spaces, and/or tabs.\n" "@param text A whitespace-separated list of words.\n" @@ -1365,7 +1365,7 @@ DefineEngineFunction( weekdayNumToStr, String, ( S32 num, bool abbreviate ), (fa //----------------------------------------------------------------------------- -DefineConsoleFunction( getField, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( getField, const char*, ( const char* text, S32 index ),, "Extract the field at the given @a index in the newline and/or tab separated list in @a text.\n" "Fields in @a text must be separated by newlines and/or tabs.\n" "@param text A list of fields separated by newlines and/or tabs.\n" @@ -1385,7 +1385,7 @@ DefineConsoleFunction( getField, const char*, ( const char* text, S32 index ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( getFields, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), +DefineEngineFunction( getFields, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), "Extract a range of fields from the given @a startIndex onwards thru @a endIndex.\n" "Fields in @a text must be separated by newlines and/or tabs.\n" "@param text A list of fields separated by newlines and/or tabs.\n" @@ -1411,7 +1411,7 @@ DefineConsoleFunction( getFields, const char*, ( const char* text, S32 startInde //----------------------------------------------------------------------------- -DefineConsoleFunction( setField, const char*, ( const char* text, S32 index, const char* replacement ),, +DefineEngineFunction( setField, const char*, ( const char* text, S32 index, const char* replacement ),, "Replace the field in @a text at the given @a index with @a replacement.\n" "Fields in @a text must be separated by newlines and/or tabs.\n" "@param text A list of fields separated by newlines and/or tabs.\n" @@ -1432,7 +1432,7 @@ DefineConsoleFunction( setField, const char*, ( const char* text, S32 index, con //----------------------------------------------------------------------------- -DefineConsoleFunction( removeField, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( removeField, const char*, ( const char* text, S32 index ),, "Remove the field in @a text at the given @a index.\n" "Fields in @a text must be separated by newlines and/or tabs.\n" "@param text A list of fields separated by newlines and/or tabs.\n" @@ -1451,7 +1451,7 @@ DefineConsoleFunction( removeField, const char*, ( const char* text, S32 index ) //----------------------------------------------------------------------------- -DefineConsoleFunction( getFieldCount, S32, ( const char* text ),, +DefineEngineFunction( getFieldCount, S32, ( const char* text ),, "Return the number of newline and/or tab separated fields in @a text.\n" "@param text A list of fields separated by newlines and/or tabs.\n" "@return The number of newline and/or tab sepearated elements in @a text.\n\n" @@ -1467,7 +1467,7 @@ DefineConsoleFunction( getFieldCount, S32, ( const char* text ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( getRecord, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( getRecord, const char*, ( const char* text, S32 index ),, "Extract the record at the given @a index in the newline-separated list in @a text.\n" "Records in @a text must be separated by newlines.\n" "@param text A list of records separated by newlines.\n" @@ -1487,7 +1487,7 @@ DefineConsoleFunction( getRecord, const char*, ( const char* text, S32 index ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( getRecords, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), +DefineEngineFunction( getRecords, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), "Extract a range of records from the given @a startIndex onwards thru @a endIndex.\n" "Records in @a text must be separated by newlines.\n" "@param text A list of records separated by newlines.\n" @@ -1513,7 +1513,7 @@ DefineConsoleFunction( getRecords, const char*, ( const char* text, S32 startInd //----------------------------------------------------------------------------- -DefineConsoleFunction( setRecord, const char*, ( const char* text, S32 index, const char* replacement ),, +DefineEngineFunction( setRecord, const char*, ( const char* text, S32 index, const char* replacement ),, "Replace the record in @a text at the given @a index with @a replacement.\n" "Records in @a text must be separated by newlines.\n" "@param text A list of records separated by newlines.\n" @@ -1534,7 +1534,7 @@ DefineConsoleFunction( setRecord, const char*, ( const char* text, S32 index, co //----------------------------------------------------------------------------- -DefineConsoleFunction( removeRecord, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( removeRecord, const char*, ( const char* text, S32 index ),, "Remove the record in @a text at the given @a index.\n" "Records in @a text must be separated by newlines.\n" "@param text A list of records separated by newlines.\n" @@ -1553,7 +1553,7 @@ DefineConsoleFunction( removeRecord, const char*, ( const char* text, S32 index //----------------------------------------------------------------------------- -DefineConsoleFunction( getRecordCount, S32, ( const char* text ),, +DefineEngineFunction( getRecordCount, S32, ( const char* text ),, "Return the number of newline-separated records in @a text.\n" "@param text A list of records separated by newlines.\n" "@return The number of newline-sepearated elements in @a text.\n\n" @@ -1569,7 +1569,7 @@ DefineConsoleFunction( getRecordCount, S32, ( const char* text ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( firstWord, const char*, ( const char* text ),, +DefineEngineFunction( firstWord, const char*, ( const char* text ),, "Return the first word in @a text.\n" "@param text A list of words separated by newlines, spaces, and/or tabs.\n" "@return The word at index 0 in @a text or \"\" if @a text is empty.\n\n" @@ -1585,7 +1585,7 @@ DefineConsoleFunction( firstWord, const char*, ( const char* text ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( restWords, const char*, ( const char* text ),, +DefineEngineFunction( restWords, const char*, ( const char* text ),, "Return all but the first word in @a text.\n" "@param text A list of words separated by newlines, spaces, and/or tabs.\n" "@return @a text with the first word removed.\n\n" @@ -1619,7 +1619,7 @@ static bool isInSet(char c, const char *set) return false; } -DefineConsoleFunction( nextToken, const char*, ( const char* str1, const char* token, const char* delim), , "( string str, string token, string delimiters ) " +DefineEngineFunction( nextToken, const char*, ( const char* str1, const char* token, const char* delim), , "( string str, string token, string delimiters ) " "Tokenize a string using a set of delimiting characters.\n" "This function first skips all leading charaters in @a str that are contained in @a delimiters. " "From that position, it then scans for the next character in @a str that is contained in @a delimiters and stores all characters " @@ -1688,7 +1688,7 @@ DefineConsoleFunction( nextToken, const char*, ( const char* str1, const char* t //----------------------------------------------------------------------------- -DefineConsoleFunction( getToken, const char*, ( const char* text, const char* delimiters, S32 index ),, +DefineEngineFunction( getToken, const char*, ( const char* text, const char* delimiters, S32 index ),, "Extract the substring at the given @a index in the @a delimiters separated list in @a text.\n" "@param text A @a delimiters list of substrings.\n" "@param delimiters Character or characters that separate the list of substrings in @a text.\n" @@ -1709,7 +1709,7 @@ DefineConsoleFunction( getToken, const char*, ( const char* text, const char* de //----------------------------------------------------------------------------- -DefineConsoleFunction( getTokens, const char*, ( const char* text, const char* delimiters, S32 startIndex, S32 endIndex ), ( -1 ), +DefineEngineFunction( getTokens, const char*, ( const char* text, const char* delimiters, S32 startIndex, S32 endIndex ), ( -1 ), "Extract a range of substrings separated by @a delimiters at the given @a startIndex onwards thru @a endIndex.\n" "@param text A @a delimiters list of substrings.\n" "@param delimiters Character or characters that separate the list of substrings in @a text.\n" @@ -1736,7 +1736,7 @@ DefineConsoleFunction( getTokens, const char*, ( const char* text, const char* d //----------------------------------------------------------------------------- -DefineConsoleFunction( setToken, const char*, ( const char* text, const char* delimiters, S32 index, const char* replacement ),, +DefineEngineFunction( setToken, const char*, ( const char* text, const char* delimiters, S32 index, const char* replacement ),, "Replace the substring in @a text separated by @a delimiters at the given @a index with @a replacement.\n" "@param text A @a delimiters list of substrings.\n" "@param delimiters Character or characters that separate the list of substrings in @a text.\n" @@ -1758,7 +1758,7 @@ DefineConsoleFunction( setToken, const char*, ( const char* text, const char* de //----------------------------------------------------------------------------- -DefineConsoleFunction( removeToken, const char*, ( const char* text, const char* delimiters, S32 index ),, +DefineEngineFunction( removeToken, const char*, ( const char* text, const char* delimiters, S32 index ),, "Remove the substring in @a text separated by @a delimiters at the given @a index.\n" "@param text A @a delimiters list of substrings.\n" "@param delimiters Character or characters that separate the list of substrings in @a text.\n" @@ -1778,7 +1778,7 @@ DefineConsoleFunction( removeToken, const char*, ( const char* text, const char* //----------------------------------------------------------------------------- -DefineConsoleFunction( getTokenCount, S32, ( const char* text, const char* delimiters),, +DefineEngineFunction( getTokenCount, S32, ( const char* text, const char* delimiters),, "Return the number of @a delimiters substrings in @a text.\n" "@param text A @a delimiters list of substrings.\n" "@param delimiters Character or characters that separate the list of substrings in @a text.\n" @@ -1837,7 +1837,7 @@ DefineEngineFunction( detag, const char*, ( const char* str ),, return str; } -DefineConsoleFunction( getTag, const char*, ( const char* textTagString ), , "( string textTagString ) " +DefineEngineFunction( getTag, const char*, ( const char* textTagString ), , "( string textTagString ) " "@brief Extracts the tag from a tagged string\n\n" "Should only be used within the context of a function that receives a tagged " @@ -1968,7 +1968,7 @@ DefineEngineFunction( debugv, void, ( const char* variableName ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( expandEscape, const char*, ( const char* text ),, +DefineEngineFunction( expandEscape, const char*, ( const char* text ),, "@brief Replace all characters in @a text that need to be escaped for the string to be a valid string literal with their " "respective escape sequences.\n\n" "All characters in @a text that cannot appear in a string literal will be replaced by an escape sequence (\\\\n, \\\\t, etc).\n\n" @@ -1990,7 +1990,7 @@ DefineConsoleFunction( expandEscape, const char*, ( const char* text ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( collapseEscape, const char*, ( const char* text ),, +DefineEngineFunction( collapseEscape, const char*, ( const char* text ),, "Replace all escape sequences in @a text with their respective character codes.\n\n" "This function replaces all escape sequences (\\\\n, \\\\t, etc) in the given string " "with the respective characters they represent.\n\n" @@ -2046,7 +2046,7 @@ DefineEngineFunction( setLogMode, void, ( S32 mode ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( quit, void, ( ),, +DefineEngineFunction( quit, void, ( ),, "Shut down the engine and exit its process.\n" "This function cleanly uninitializes the engine and then exits back to the system with a process " "exit status indicating a clean exit.\n\n" @@ -2059,7 +2059,7 @@ DefineConsoleFunction( quit, void, ( ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( realQuit, void, (), , "") +DefineEngineFunction( realQuit, void, (), , "") { Platform::postQuitMessage(0); } @@ -2067,7 +2067,7 @@ DefineConsoleFunction( realQuit, void, (), , "") //----------------------------------------------------------------------------- -DefineConsoleFunction( quitWithErrorMessage, void, ( const char* message, S32 status ), (0), +DefineEngineFunction( quitWithErrorMessage, void, ( const char* message, S32 status ), (0), "Display an error message box showing the given @a message and then shut down the engine and exit its process.\n" "This function cleanly uninitialized the engine and then exits back to the system with a process " "exit status indicating an error.\n\n" @@ -2088,7 +2088,7 @@ DefineConsoleFunction( quitWithErrorMessage, void, ( const char* message, S32 st //----------------------------------------------------------------------------- -DefineConsoleFunction( quitWithStatus, void, ( S32 status ), (0), +DefineEngineFunction( quitWithStatus, void, ( S32 status ), (0), "Shut down the engine and exit its process.\n" "This function cleanly uninitializes the engine and then exits back to the system with a given " "return status code.\n\n" @@ -2259,7 +2259,7 @@ ConsoleFunction( call, const char *, 2, 0, "( string functionName, string args.. static U32 execDepth = 0; static U32 journalDepth = 1; -DefineConsoleFunction( getDSOPath, const char*, ( const char* scriptFileName ),, +DefineEngineFunction( getDSOPath, const char*, ( const char* scriptFileName ),, "Get the absolute path to the file in which the compiled code for the given script file will be stored.\n" "@param scriptFileName %Path to the .cs script file.\n" "@return The absolute path to the .dso file for the given script file.\n\n" @@ -2373,12 +2373,12 @@ DefineEngineFunction( exec, bool, ( const char* fileName, bool noCalls, bool jou return Con::executeFile(fileName, noCalls, journalScript); } -DefineConsoleFunction( eval, const char*, ( const char* consoleString ), , "eval(consoleString)" ) +DefineEngineFunction( eval, const char*, ( const char* consoleString ), , "eval(consoleString)" ) { return Con::evaluate(consoleString, false, NULL); } -DefineConsoleFunction( getVariable, const char*, ( const char* varName ), , "(string varName)\n" +DefineEngineFunction( getVariable, const char*, ( const char* varName ), , "(string varName)\n" "@brief Returns the value of the named variable or an empty string if not found.\n\n" "@varName Name of the variable to search for\n" "@return Value contained by varName, \"\" if the variable does not exist\n" @@ -2387,7 +2387,7 @@ DefineConsoleFunction( getVariable, const char*, ( const char* varName ), , "(st return Con::getVariable(varName); } -DefineConsoleFunction( setVariable, void, ( const char* varName, const char* value ), , "(string varName, string value)\n" +DefineEngineFunction( setVariable, void, ( const char* varName, const char* value ), , "(string varName, string value)\n" "@brief Sets the value of the named variable.\n\n" "@param varName Name of the variable to locate\n" "@param value New value of the variable\n" @@ -2397,7 +2397,7 @@ DefineConsoleFunction( setVariable, void, ( const char* varName, const char* val return Con::setVariable(varName, value); } -DefineConsoleFunction( isFunction, bool, ( const char* funcName ), , "(string funcName)" +DefineEngineFunction( isFunction, bool, ( const char* funcName ), , "(string funcName)" "@brief Determines if a function exists or not\n\n" "@param funcName String containing name of the function\n" "@return True if the function exists, false if not\n" @@ -2406,7 +2406,7 @@ DefineConsoleFunction( isFunction, bool, ( const char* funcName ), , "(string fu return Con::isFunction(funcName); } -DefineConsoleFunction( getFunctionPackage, const char*, ( const char* funcName ), , "(string funcName)" +DefineEngineFunction( getFunctionPackage, const char*, ( const char* funcName ), , "(string funcName)" "@brief Provides the name of the package the function belongs to\n\n" "@param funcName String containing name of the function\n" "@return The name of the function's package\n" @@ -2419,7 +2419,7 @@ DefineConsoleFunction( getFunctionPackage, const char*, ( const char* funcName ) return nse->mPackage; } -DefineConsoleFunction( isMethod, bool, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" +DefineEngineFunction( isMethod, bool, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" "@brief Determines if a class/namespace method exists\n\n" "@param namespace Class or namespace, such as Player\n" "@param method Name of the function to search for\n" @@ -2434,7 +2434,7 @@ DefineConsoleFunction( isMethod, bool, ( const char* nameSpace, const char* meth return true; } -DefineConsoleFunction( getMethodPackage, const char*, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" +DefineEngineFunction( getMethodPackage, const char*, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" "@brief Provides the name of the package the method belongs to\n\n" "@param namespace Class or namespace, such as Player\n" "@param method Name of the funciton to search for\n" @@ -2452,7 +2452,7 @@ DefineConsoleFunction( getMethodPackage, const char*, ( const char* nameSpace, c return nse->mPackage; } -DefineConsoleFunction( isDefined, bool, ( const char* varName, const char* varValue ), ("") , "(string varName)" +DefineEngineFunction( isDefined, bool, ( const char* varName, const char* varValue ), ("") , "(string varName)" "@brief Determines if a variable exists and contains a value\n" "@param varName Name of the variable to search for\n" "@return True if the variable was defined in script, false if not\n" @@ -2590,14 +2590,14 @@ DefineConsoleFunction( isDefined, bool, ( const char* varName, const char* varVa //----------------------------------------------------------------------------- -DefineConsoleFunction( isCurrentScriptToolScript, bool, (), , "()" +DefineEngineFunction( isCurrentScriptToolScript, bool, (), , "()" "Returns true if the calling script is a tools script.\n" "@hide") { return Con::isCurrentScriptToolScript(); } -DefineConsoleFunction( getModNameFromPath, const char *, ( const char* path ), , "(string path)" +DefineEngineFunction( getModNameFromPath, const char *, ( const char* path ), , "(string path)" "@brief Attempts to extract a mod directory from path. Returns empty string on failure.\n\n" "@param File path of mod folder\n" "@note This is no longer relevant in Torque 3D (which does not use mod folders), should be deprecated\n" @@ -2609,7 +2609,7 @@ DefineConsoleFunction( getModNameFromPath, const char *, ( const char* path ), , //----------------------------------------------------------------------------- -DefineConsoleFunction( pushInstantGroup, void, ( String group ),("") , "([group])" +DefineEngineFunction( pushInstantGroup, void, ( String group ),("") , "([group])" "@brief Pushes the current $instantGroup on a stack " "and sets it to the given value (or clears it).\n\n" "@note Currently only used for editors\n" @@ -2622,7 +2622,7 @@ DefineConsoleFunction( pushInstantGroup, void, ( String group ),("") , "([group] Con::pushInstantGroup(); } -DefineConsoleFunction( popInstantGroup, void, (), , "()" +DefineEngineFunction( popInstantGroup, void, (), , "()" "@brief Pop and restore the last setting of $instantGroup off the stack.\n\n" "@note Currently only used for editors\n\n" "@ingroup Editors\n" @@ -2633,7 +2633,7 @@ DefineConsoleFunction( popInstantGroup, void, (), , "()" //----------------------------------------------------------------------------- -DefineConsoleFunction( getPrefsPath, const char *, ( const char* relativeFileName ), (""), "([relativeFileName])" +DefineEngineFunction( getPrefsPath, const char *, ( const char* relativeFileName ), (""), "([relativeFileName])" "@note Appears to be useless in Torque 3D, should be deprecated\n" "@internal") { @@ -2670,7 +2670,7 @@ ConsoleFunction( execPrefs, bool, 2, 4, "( string relativeFileName, bool noCalls //----------------------------------------------------------------------------- -DefineConsoleFunction( export, void, ( const char* pattern, const char* filename, bool append ), ( "", false ), +DefineEngineFunction( export, void, ( const char* pattern, const char* filename, bool append ), ( "", false ), "Write out the definitions of all global variables matching the given name @a pattern.\n" "If @a fileName is not \"\", the variable definitions are written to the specified file. Otherwise the " "definitions will be printed to the console.\n\n" @@ -2723,7 +2723,7 @@ DefineEngineFunction( deleteVariables, void, ( const char* pattern ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( trace, void, ( bool enable ), ( true ), +DefineEngineFunction( trace, void, ( bool enable ), ( true ), "Enable or disable tracing in the script code VM.\n\n" "When enabled, the script code runtime will trace the invocation and returns " "from all functions that are called and log them to the console. This is helpful in " @@ -2739,7 +2739,7 @@ DefineConsoleFunction( trace, void, ( bool enable ), ( true ), #if defined(TORQUE_DEBUG) || !defined(TORQUE_SHIPPING) -DefineConsoleFunction( debug, void, (),, +DefineEngineFunction( debug, void, (),, "Drops the engine into the native C++ debugger.\n\n" "This function triggers a debug break and drops the process into the IDE's debugger. If the process is not " "running with a debugger attached it will generate a runtime error on most platforms.\n\n" diff --git a/Engine/source/console/consoleXMLExport.cpp b/Engine/source/console/consoleXMLExport.cpp index 79e302595..e3431acdf 100644 --- a/Engine/source/console/consoleXMLExport.cpp +++ b/Engine/source/console/consoleXMLExport.cpp @@ -314,7 +314,7 @@ namespace Con { }; // namespace Con -DefineConsoleFunction( consoleExportXML, const char*, (), ,"Exports console definition XML representation" ) +DefineEngineFunction( consoleExportXML, const char*, (), ,"Exports console definition XML representation" ) { Con::XMLExport xmlExport; String xml; diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index 049cce54d..2eef409b6 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -860,24 +860,6 @@ public: // while being only visible in the console interop. When we drop the console system, // these macros can be removed and all definitions that make use of them can be removed // as well. -#define DefineConsoleFunction( name, returnType, args, defaultArgs, usage ) \ - static inline returnType _fn ## name ## impl args; \ - static _EngineFunctionDefaultArguments< void args > _fn ## name ## DefaultArgs defaultArgs; \ - static _EngineConsoleThunkType< returnType >::ReturnType _ ## name ## caster( SimObject*, S32 argc, ConsoleValueRef *argv ) \ - { \ - return _EngineConsoleThunkType< returnType >::ReturnType( _EngineConsoleThunk< 1, returnType args >::thunk( \ - argc, argv, &_fn ## name ## impl, _fn ## name ## DefaultArgs \ - ) ); \ - } \ - static ConsoleFunctionHeader _ ## name ## header \ - ( #returnType, #args, #defaultArgs ); \ - static ConsoleConstructor \ - _ ## name ## obj( NULL, #name, _EngineConsoleThunkType< returnType >::CallbackType( _ ## name ## caster ), usage, \ - _EngineConsoleThunk< 1, returnType args >::NUM_ARGS - _EngineConsoleThunkCountArgs() defaultArgs, \ - _EngineConsoleThunk< 1, returnType args >::NUM_ARGS, \ - false, &_ ## name ## header \ - ); \ - static inline returnType _fn ## name ## impl args #define DefineConsoleMethod( className, name, returnType, args, defaultArgs, usage ) \ struct _ ## className ## name ## frame \ diff --git a/Engine/source/console/sim.cpp b/Engine/source/console/sim.cpp index cb01e8019..6bb194db3 100644 --- a/Engine/source/console/sim.cpp +++ b/Engine/source/console/sim.cpp @@ -86,7 +86,7 @@ namespace Sim ConsoleFunctionGroupBegin ( SimFunctions, "Functions relating to Sim."); -DefineConsoleFunction( nameToID, S32, (const char * objectName), ,"nameToID(object)") +DefineEngineFunction( nameToID, S32, (const char * objectName), ,"nameToID(object)") { SimObject *obj = Sim::findObject(objectName); if(obj) @@ -95,7 +95,7 @@ DefineConsoleFunction( nameToID, S32, (const char * objectName), ,"nameToID(obje return -1; } -DefineConsoleFunction( isObject, bool, (const char * objectName), ,"isObject(object)") +DefineEngineFunction( isObject, bool, (const char * objectName), ,"isObject(object)") { if (!dStrcmp(objectName, "0") || !dStrcmp(objectName, "")) return false; @@ -133,7 +133,7 @@ ConsoleDocFragment _spawnObject1( "bool spawnObject(class [, dataBlock, name, properties, script]);" ); -DefineConsoleFunction( spawnObject, S32, ( const char * spawnClass +DefineEngineFunction( spawnObject, S32, ( const char * spawnClass , const char * spawnDataBlock , const char * spawnName , const char * spawnProperties @@ -149,33 +149,33 @@ DefineConsoleFunction( spawnObject, S32, ( const char * spawnClass return -1; } -DefineConsoleFunction( cancel, void, (S32 eventId), ,"cancel(eventId)") +DefineEngineFunction( cancel, void, (S32 eventId), ,"cancel(eventId)") { Sim::cancelEvent(eventId); } -DefineConsoleFunction( cancelAll, void, (const char * objectId), ,"cancelAll(objectId): cancel pending events on the specified object. Events will be automatically cancelled if object is deleted.") +DefineEngineFunction( cancelAll, void, (const char * objectId), ,"cancelAll(objectId): cancel pending events on the specified object. Events will be automatically cancelled if object is deleted.") { Sim::cancelPendingEvents(Sim::findObject(objectId)); } -DefineConsoleFunction( isEventPending, bool, (S32 scheduleId), ,"isEventPending(%scheduleId);") +DefineEngineFunction( isEventPending, bool, (S32 scheduleId), ,"isEventPending(%scheduleId);") { return Sim::isEventPending(scheduleId); } -DefineConsoleFunction( getEventTimeLeft, S32, (S32 scheduleId), ,"getEventTimeLeft(scheduleId) Get the time left in ms until this event will trigger.") +DefineEngineFunction( getEventTimeLeft, S32, (S32 scheduleId), ,"getEventTimeLeft(scheduleId) Get the time left in ms until this event will trigger.") { return Sim::getEventTimeLeft(scheduleId); } -DefineConsoleFunction( getScheduleDuration, S32, (S32 scheduleId), ,"getScheduleDuration(%scheduleId);" ) +DefineEngineFunction( getScheduleDuration, S32, (S32 scheduleId), ,"getScheduleDuration(%scheduleId);" ) { S32 ret = Sim::getScheduleDuration(scheduleId); return ret; } -DefineConsoleFunction( getTimeSinceStart, S32, (S32 scheduleId), ,"getTimeSinceStart(%scheduleId);" ) +DefineEngineFunction( getTimeSinceStart, S32, (S32 scheduleId), ,"getTimeSinceStart(%scheduleId);" ) { S32 ret = Sim::getTimeSinceStart(scheduleId); return ret; @@ -202,7 +202,7 @@ ConsoleFunction(schedule, S32, 4, 0, "schedule(time, refobject|0, command, isConnected(); } -DefineConsoleFunction( dbgDisconnect, void, (), , "()" +DefineEngineFunction( dbgDisconnect, void, (), , "()" "Forcibly disconnects any attached script debugging client.\n" "@internal Primarily used for Torsion and other debugging tools") { diff --git a/Engine/source/core/dnet.cpp b/Engine/source/core/dnet.cpp index a5fe53f6c..e7d1b6ae0 100644 --- a/Engine/source/core/dnet.cpp +++ b/Engine/source/core/dnet.cpp @@ -50,7 +50,7 @@ static const char *packetTypeNames[] = //----------------------------------------------------------------- //----------------------------------------------------------------- //----------------------------------------------------------------- -DefineConsoleFunction( DNetSetLogging, void, (bool enabled), , "(bool enabled)" +DefineEngineFunction( 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" diff --git a/Engine/source/core/stringBuffer.cpp b/Engine/source/core/stringBuffer.cpp index 3d15a6183..a55446885 100644 --- a/Engine/source/core/stringBuffer.cpp +++ b/Engine/source/core/stringBuffer.cpp @@ -48,12 +48,12 @@ void dumpAllStrings(); }; - DefineConsoleFunction( sbmDumpStats, void, (), , "()") + DefineEngineFunction( sbmDumpStats, void, (), , "()") { StringBufferManager::getManager().dumpStats(); } - DefineConsoleFunction( sbmDumpStrings, void, (), , "()") + DefineEngineFunction( sbmDumpStrings, void, (), , "()") { StringBufferManager::getManager().dumpAllStrings(); } diff --git a/Engine/source/core/util/str.cpp b/Engine/source/core/util/str.cpp index 63580e2b4..1a15b8b85 100644 --- a/Engine/source/core/util/str.cpp +++ b/Engine/source/core/util/str.cpp @@ -480,7 +480,7 @@ static U32 sgStringInstances; #endif -DefineConsoleFunction( dumpStringMemStats, void, (), , "()" +DefineEngineFunction( dumpStringMemStats, void, (), , "()" "@brief Dumps information about String memory usage\n\n" "@ingroup Debugging\n" "@ingroup Strings\n") diff --git a/Engine/source/environment/VolumetricFogRTManager.cpp b/Engine/source/environment/VolumetricFogRTManager.cpp index 7b7b00d50..9eca811f9 100644 --- a/Engine/source/environment/VolumetricFogRTManager.cpp +++ b/Engine/source/environment/VolumetricFogRTManager.cpp @@ -283,7 +283,7 @@ VolumetricFogRTManager* VolumetricFogRTManager::get() return gVolumetricFogRTManager; } -DefineConsoleFunction(SetFogVolumeQuality, S32, (U32 new_quality), , +DefineEngineFunction(SetFogVolumeQuality, S32, (U32 new_quality), , "@brief Resizes the rendertargets of the Volumetric Fog object.\n" "@params new_quality new quality for the rendertargets 1 = full size, 2 = halfsize, 3 = 1/3, 4 = 1/4 ...") { diff --git a/Engine/source/gfx/gfxDevice.cpp b/Engine/source/gfx/gfxDevice.cpp index 28add7718..806cf4baf 100644 --- a/Engine/source/gfx/gfxDevice.cpp +++ b/Engine/source/gfx/gfxDevice.cpp @@ -1333,7 +1333,7 @@ DefineEngineFunction( getBestHDRFormat, GFXFormat, (),, return format; } -DefineConsoleFunction(ResetGFX, void, (), , "forces the gbuffer to be reinitialized in cases of improper/lack of buffer clears.") +DefineEngineFunction(ResetGFX, void, (), , "forces the gbuffer to be reinitialized in cases of improper/lack of buffer clears.") { GFX->beginReset(); } \ No newline at end of file diff --git a/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp b/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp index 254141b71..02155a4f1 100644 --- a/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp +++ b/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp @@ -86,7 +86,7 @@ protected: GFXProfiler gfxProfiler; -DefineConsoleFunction(printGFXGLTimers, void,(), ,"") +DefineEngineFunction(printGFXGLTimers, void,(), ,"") { gfxProfiler.printTimes(); } diff --git a/Engine/source/i18n/i18n.cpp b/Engine/source/i18n/i18n.cpp index 359c76fa4..1de738abd 100644 --- a/Engine/source/i18n/i18n.cpp +++ b/Engine/source/i18n/i18n.cpp @@ -58,7 +58,7 @@ const UTF8 *getCoreString(S32 id) //----------------------------------------------------------------------------- -DefineConsoleFunction( getCoreLangTable, S32, (), , "()" +DefineEngineFunction( getCoreLangTable, S32, (), , "()" "@brief Gets the primary LangTable used by the game\n\n" "@return ID of the core LangTable\n" "@ingroup Localization") @@ -69,7 +69,7 @@ DefineConsoleFunction( getCoreLangTable, S32, (), , "()" return 0; } -DefineConsoleFunction( setCoreLangTable, void, (const char * lgTable), , "(string LangTable)" +DefineEngineFunction( setCoreLangTable, void, (const char * lgTable), , "(string LangTable)" "@brief Sets the primary LangTable used by the game\n\n" "@param LangTable ID of the core LangTable\n" "@ingroup Localization") diff --git a/Engine/source/lighting/advanced/advancedLightManager.cpp b/Engine/source/lighting/advanced/advancedLightManager.cpp index 3c851cf81..6d251ec58 100644 --- a/Engine/source/lighting/advanced/advancedLightManager.cpp +++ b/Engine/source/lighting/advanced/advancedLightManager.cpp @@ -705,7 +705,7 @@ LightShadowMap* AdvancedLightManager::findShadowMapForObject( SimObject *object return sceneLight->getLight()->getExtended()->getShadowMap(); } -DefineConsoleFunction( setShadowVizLight, const char*, (const char* name), (""), "") +DefineEngineFunction( setShadowVizLight, const char*, (const char* name), (""), "") { static const String DebugTargetName( "AL_ShadowVizTexture" ); diff --git a/Engine/source/lighting/shadowManager.cpp b/Engine/source/lighting/shadowManager.cpp index 68a234c70..288ff54c9 100644 --- a/Engine/source/lighting/shadowManager.cpp +++ b/Engine/source/lighting/shadowManager.cpp @@ -54,7 +54,7 @@ SceneManager* ShadowManager::getSceneManager() //------------------------------------------------------------------------------ // Runtime switching of shadow systems. Requires correct world to be pushed at console. -DefineConsoleFunction( setShadowManager, bool, (const char* sShadowSystemName), (""), "string sShadowSystemName") +DefineEngineFunction( setShadowManager, bool, (const char* sShadowSystemName), (""), "string sShadowSystemName") { /* // Make sure this new one exists diff --git a/Engine/source/materials/materialManager.cpp b/Engine/source/materials/materialManager.cpp index 4b28988b7..0f8519bb5 100644 --- a/Engine/source/materials/materialManager.cpp +++ b/Engine/source/materials/materialManager.cpp @@ -454,14 +454,14 @@ bool MaterialManager::_handleGFXEvent( GFXDevice::GFXDeviceEventType event_ ) return true; } -DefineConsoleFunction( reInitMaterials, void, (),, +DefineEngineFunction( reInitMaterials, void, (),, "@brief Flushes all procedural shaders and re-initializes all active material instances.\n\n" "@ingroup Materials") { MATMGR->flushAndReInitInstances(); } -DefineConsoleFunction( addMaterialMapping, void, (const char * texName, const char * matName), , "(string texName, string matName)\n" +DefineEngineFunction( addMaterialMapping, void, (const char * texName, const char * matName), , "(string texName, string matName)\n" "@brief Maps the given texture to the given material.\n\n" "Generates a console warning before overwriting.\n\n" "Material maps are used by terrain and interiors for triggering " @@ -472,7 +472,7 @@ DefineConsoleFunction( addMaterialMapping, void, (const char * texName, const ch MATMGR->mapMaterial(texName, matName); } -DefineConsoleFunction( getMaterialMapping, const char*, (const char * texName), , "(string texName)\n" +DefineEngineFunction( getMaterialMapping, const char*, (const char * texName), , "(string texName)\n" "@brief Returns the name of the material mapped to this texture.\n\n" "If no materials are found, an empty string is returned.\n\n" "@param texName Name of the texture\n\n" @@ -481,14 +481,14 @@ DefineConsoleFunction( getMaterialMapping, const char*, (const char * texName), return MATMGR->getMapEntry(texName).c_str(); } -DefineConsoleFunction( dumpMaterialInstances, void, (), , +DefineEngineFunction( dumpMaterialInstances, void, (), , "@brief Dumps a formatted list of currently allocated material instances to the console.\n\n" "@ingroup Materials") { MATMGR->dumpMaterialInstances(); } -DefineConsoleFunction( getMapEntry, const char*, (const char * texName), , +DefineEngineFunction( getMapEntry, const char*, (const char * texName), , "@hide") { return MATMGR->getMapEntry( String(texName) ); diff --git a/Engine/source/math/mConsoleFunctions.cpp b/Engine/source/math/mConsoleFunctions.cpp index c9a1f4622..0b5541f2f 100644 --- a/Engine/source/math/mConsoleFunctions.cpp +++ b/Engine/source/math/mConsoleFunctions.cpp @@ -31,7 +31,7 @@ #include "console/engineAPI.h" -DefineConsoleFunction( mSolveQuadratic, const char*, ( F32 a, F32 b, F32 c ),, +DefineEngineFunction( mSolveQuadratic, const char*, ( F32 a, F32 b, F32 c ),, "Solve a quadratic equation (2nd degree polynomial) of form a*x^2 + b*x + c = 0.\n" "@param a First Coefficient." "@param b Second Coefficient." @@ -49,7 +49,7 @@ DefineConsoleFunction( mSolveQuadratic, const char*, ( F32 a, F32 b, F32 c ),, return retBuffer; } -DefineConsoleFunction( mSolveCubic, const char*, ( F32 a, F32 b, F32 c, F32 d ),, +DefineEngineFunction( mSolveCubic, const char*, ( F32 a, F32 b, F32 c, F32 d ),, "Solve a cubic equation (3rd degree polynomial) of form a*x^3 + b*x^2 + c*x + d = 0.\n" "@param a First Coefficient." "@param b Second Coefficient." @@ -68,7 +68,7 @@ DefineConsoleFunction( mSolveCubic, const char*, ( F32 a, F32 b, F32 c, F32 d ), return retBuffer; } -DefineConsoleFunction( mSolveQuartic, const char*, ( F32 a, F32 b, F32 c, F32 d, F32 e ),, +DefineEngineFunction( mSolveQuartic, const char*, ( F32 a, F32 b, F32 c, F32 d, F32 e ),, "Solve a quartic equation (4th degree polynomial) of form a*x^4 + b*x^3 + c*x^2 + d*x + e = 0.\n" "@param a First Coefficient." "@param b Second Coefficient." @@ -87,7 +87,7 @@ DefineConsoleFunction( mSolveQuartic, const char*, ( F32 a, F32 b, F32 c, F32 d, return retBuffer; } -DefineConsoleFunction( mFloor, S32, ( F32 v ),, +DefineEngineFunction( mFloor, S32, ( F32 v ),, "Round v down to the nearest integer.\n" "@param v Number to convert to integer." "@returns Number converted to integer." @@ -96,7 +96,7 @@ DefineConsoleFunction( mFloor, S32, ( F32 v ),, return (S32)mFloor( v ); } -DefineConsoleFunction( mRound, S32, ( F32 v ),, +DefineEngineFunction( mRound, S32, ( F32 v ),, "Round v to the nth decimal place or the nearest whole number by default." "@param v Value to roundn" "@return The rounded value as a S32." @@ -105,7 +105,7 @@ DefineConsoleFunction( mRound, S32, ( F32 v ),, return mRound(v); } -DefineConsoleFunction( mRoundColour, F32, ( F32 v, S32 n ), (0), +DefineEngineFunction( mRoundColour, F32, ( F32 v, S32 n ), (0), "Round v to the nth decimal place or the nearest whole number by default." "@param v Value to roundn" "@param n Number of decimal places to round to, 0 by defaultn" @@ -118,7 +118,7 @@ DefineConsoleFunction( mRoundColour, F32, ( F32 v, S32 n ), (0), return mRound(v, n); } -DefineConsoleFunction( mCeil, S32, ( F32 v ),, +DefineEngineFunction( mCeil, S32, ( F32 v ),, "Round v up to the nearest integer.\n" "@param v Number to convert to integer." "@returns Number converted to integer." @@ -127,7 +127,7 @@ DefineConsoleFunction( mCeil, S32, ( F32 v ),, return (S32)mCeil( v ); } -DefineConsoleFunction( mFloatLength, const char*, ( F32 v, U32 precision ),, +DefineEngineFunction( mFloatLength, const char*, ( F32 v, U32 precision ),, "Formats the specified number to the given number of decimal places.\n" "@param v Number to format." "@param precision Number of decimal places to format to (1-9)." @@ -148,7 +148,7 @@ DefineConsoleFunction( mFloatLength, const char*, ( F32 v, U32 precision ),, //------------------------------------------------------------------------------ -DefineConsoleFunction( mAbs, F32, ( F32 v ),, +DefineEngineFunction( mAbs, F32, ( F32 v ),, "Calculate absolute value of specified value.\n" "@param v Input Value." "@returns Absolute value of specified value." @@ -157,7 +157,7 @@ DefineConsoleFunction( mAbs, F32, ( F32 v ),, return mFabs( v ); } -DefineConsoleFunction( mFMod, F32, ( F32 v, F32 d ),, +DefineEngineFunction( mFMod, F32, ( F32 v, F32 d ),, "Calculate the remainder of v/d.\n" "@param v Input Value." "@param d Divisor Value." @@ -167,7 +167,7 @@ DefineConsoleFunction( mFMod, F32, ( F32 v, F32 d ),, return mFmod( v, d ); } -DefineConsoleFunction( mSqrt, F32, ( F32 v ),, +DefineEngineFunction( mSqrt, F32, ( F32 v ),, "Calculate the square-root of v.\n" "@param v Input Value." "@returns The square-root of the input value." @@ -176,7 +176,7 @@ DefineConsoleFunction( mSqrt, F32, ( F32 v ),, return mSqrt (v ); } -DefineConsoleFunction( mPow, F32, ( F32 v, F32 p ),, +DefineEngineFunction( mPow, F32, ( F32 v, F32 p ),, "Calculate b raised to the p-th power.\n" "@param v Input Value." "@param p Power to raise value by." @@ -186,7 +186,7 @@ DefineConsoleFunction( mPow, F32, ( F32 v, F32 p ),, return mPow( v, p ); } -DefineConsoleFunction( mLog, F32, ( F32 v ),, +DefineEngineFunction( mLog, F32, ( F32 v ),, "Calculate the natural logarithm of v.\n" "@param v Input Value." "@returns The natural logarithm of the input value." @@ -195,7 +195,7 @@ DefineConsoleFunction( mLog, F32, ( F32 v ),, return mLog( v ); } -DefineConsoleFunction( mSin, F32, ( F32 v ),, +DefineEngineFunction( mSin, F32, ( F32 v ),, "Calculate the sine of v.\n" "@param v Input Value (in radians)." "@returns The sine of the input value." @@ -204,7 +204,7 @@ DefineConsoleFunction( mSin, F32, ( F32 v ),, return mSin( v ); } -DefineConsoleFunction( mCos, F32, ( F32 v ),, +DefineEngineFunction( mCos, F32, ( F32 v ),, "Calculate the cosine of v.\n" "@param v Input Value (in radians)." "@returns The cosine of the input value." @@ -213,7 +213,7 @@ DefineConsoleFunction( mCos, F32, ( F32 v ),, return mCos( v ); } -DefineConsoleFunction( mTan, F32, ( F32 v ),, +DefineEngineFunction( mTan, F32, ( F32 v ),, "Calculate the tangent of v.\n" "@param v Input Value (in radians)." "@returns The tangent of the input value." @@ -222,7 +222,7 @@ DefineConsoleFunction( mTan, F32, ( F32 v ),, return mTan( v ); } -DefineConsoleFunction( mAsin, F32, ( F32 v ),, +DefineEngineFunction( mAsin, F32, ( F32 v ),, "Calculate the arc-sine of v.\n" "@param v Input Value (in radians)." "@returns The arc-sine of the input value." @@ -231,7 +231,7 @@ DefineConsoleFunction( mAsin, F32, ( F32 v ),, return mAsin( v ); } -DefineConsoleFunction( mAcos, F32, ( F32 v ),, +DefineEngineFunction( mAcos, F32, ( F32 v ),, "Calculate the arc-cosine of v.\n" "@param v Input Value (in radians)." "@returns The arc-cosine of the input value." @@ -240,7 +240,7 @@ DefineConsoleFunction( mAcos, F32, ( F32 v ),, return mAcos( v ); } -DefineConsoleFunction( mAtan, F32, ( F32 rise, F32 run ),, +DefineEngineFunction( mAtan, F32, ( F32 rise, F32 run ),, "Calculate the arc-tangent (slope) of a line defined by rise and run.\n" "@param rise of line." "@param run of line." @@ -250,7 +250,7 @@ DefineConsoleFunction( mAtan, F32, ( F32 rise, F32 run ),, return mAtan2( rise, run ); } -DefineConsoleFunction( mRadToDeg, F32, ( F32 radians ),, +DefineEngineFunction( mRadToDeg, F32, ( F32 radians ),, "Convert specified radians into degrees.\n" "@param radians Input Value (in radians)." "@returns The specified radians value converted to degrees." @@ -259,7 +259,7 @@ DefineConsoleFunction( mRadToDeg, F32, ( F32 radians ),, return mRadToDeg( radians ); } -DefineConsoleFunction( mDegToRad, F32, ( F32 degrees ),, +DefineEngineFunction( mDegToRad, F32, ( F32 degrees ),, "Convert specified degrees into radians.\n" "@param degrees Input Value (in degrees)." "@returns The specified degrees value converted to radians." @@ -268,7 +268,7 @@ DefineConsoleFunction( mDegToRad, F32, ( F32 degrees ),, return mDegToRad( degrees ); } -DefineConsoleFunction( mClamp, F32, ( F32 v, F32 min, F32 max ),, +DefineEngineFunction( mClamp, F32, ( F32 v, F32 min, F32 max ),, "Clamp the specified value between two bounds.\n" "@param v Input value." "@param min Minimum Bound." @@ -279,7 +279,7 @@ DefineConsoleFunction( mClamp, F32, ( F32 v, F32 min, F32 max ),, return mClampF( v, min, max ); } -DefineConsoleFunction( mSaturate, F32, ( F32 v ),, +DefineEngineFunction( mSaturate, F32, ( F32 v ),, "Clamp the specified value between 0 and 1 (inclusive).\n" "@param v Input value." "@returns The specified value clamped between 0 and 1 (inclusive)." @@ -288,7 +288,7 @@ DefineConsoleFunction( mSaturate, F32, ( F32 v ),, return mClampF( v, 0.0f, 1.0f ); } -DefineConsoleFunction(mWrapF, F32, (F32 v, F32 min, F32 max), , +DefineEngineFunction(mWrapF, F32, (F32 v, F32 min, F32 max), , "Wrap the specified value between two bounds.\n" "@param v Input value." "@param min Minimum Bound." @@ -299,7 +299,7 @@ DefineConsoleFunction(mWrapF, F32, (F32 v, F32 min, F32 max), , return mWrapF(v, min, max); } -DefineConsoleFunction(mWrap, S32, (S32 v, S32 min, S32 max), , +DefineEngineFunction(mWrap, S32, (S32 v, S32 min, S32 max), , "Wrap the specified value between two bounds.\n" "@param v Input value." "@param min Minimum Bound." @@ -311,7 +311,7 @@ DefineConsoleFunction(mWrap, S32, (S32 v, S32 min, S32 max), , } -DefineConsoleFunction( getMax, F32, ( F32 v1, F32 v2 ),, +DefineEngineFunction( getMax, F32, ( F32 v1, F32 v2 ),, "Calculate the greater of two specified numbers.\n" "@param v1 Input value." "@param v2 Input value." @@ -321,7 +321,7 @@ DefineConsoleFunction( getMax, F32, ( F32 v1, F32 v2 ),, return getMax( v1, v2 ); } -DefineConsoleFunction( getMin, F32, ( F32 v1, F32 v2 ),, +DefineEngineFunction( getMin, F32, ( F32 v1, F32 v2 ),, "Calculate the lesser of two specified numbers.\n" "@param v1 Input value." "@param v2 Input value." @@ -331,7 +331,7 @@ DefineConsoleFunction( getMin, F32, ( F32 v1, F32 v2 ),, return getMin( v1, v2 ); } -DefineConsoleFunction( mLerp, F32, ( F32 v1, F32 v2, F32 time ),, +DefineEngineFunction( mLerp, F32, ( F32 v1, F32 v2, F32 time ),, "Calculate linearly interpolated value between two specified numbers using specified normalized time.\n" "@param v1 Interpolate From Input value." "@param v2 Interpolate To Input value." @@ -342,7 +342,7 @@ DefineConsoleFunction( mLerp, F32, ( F32 v1, F32 v2, F32 time ),, return mLerp( v1, v2, time ); } -DefineConsoleFunction( mPi, F32, (),, +DefineEngineFunction( mPi, F32, (),, "Return the value of PI (half-circle in radians).\n" "@returns The value of PI." "@ingroup Math" ) @@ -350,7 +350,7 @@ DefineConsoleFunction( mPi, F32, (),, return M_PI_F; } -DefineConsoleFunction( m2Pi, F32, (),, +DefineEngineFunction( m2Pi, F32, (),, "Return the value of 2*PI (full-circle in radians).\n" "@returns The value of 2*PI." "@ingroup Math" ) @@ -358,7 +358,7 @@ DefineConsoleFunction( m2Pi, F32, (),, return M_2PI_F; } -DefineConsoleFunction( mIsPow2, bool, ( S32 v ),, +DefineEngineFunction( mIsPow2, bool, ( S32 v ),, "Returns whether the value is an exact power of two.\n" "@param v Input value." "@returns Whether the specified value is an exact power of two." @@ -367,7 +367,7 @@ DefineConsoleFunction( mIsPow2, bool, ( S32 v ),, return isPow2( v ); } -DefineConsoleFunction( mRandomDir, Point3F, (Point3F axis, F32 angleMin, F32 angleMax),, +DefineEngineFunction( mRandomDir, Point3F, (Point3F axis, F32 angleMin, F32 angleMax),, "Returns a randomized direction based on a starting axis and the min/max angles.\n" "@param axis Main axis to deviate the direction from." "@param angleMin minimum amount of deviation from the axis." @@ -378,7 +378,7 @@ DefineConsoleFunction( mRandomDir, Point3F, (Point3F axis, F32 angleMin, F32 ang return MathUtils::randomDir(axis, angleMin, angleMax); } -DefineConsoleFunction( mRandomPointInSphere, Point3F, (F32 radius), , +DefineEngineFunction( mRandomPointInSphere, Point3F, (F32 radius), , "Returns a randomized point inside a sphere of a given radius.\n" "@param radius The radius of the sphere to find a point in." "@returns Randomized point inside a sphere." @@ -387,7 +387,7 @@ DefineConsoleFunction( mRandomPointInSphere, Point3F, (F32 radius), , return MathUtils::randomPointInSphere(radius); } -DefineConsoleFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB), , +DefineEngineFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB), , "Returns angle between two vectors.\n" "@param vecA First input vector." "@param vecB Second input vector." @@ -397,7 +397,7 @@ DefineConsoleFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB return MathUtils::getAngleBetweenVectors(vecA, vecB); } -DefineConsoleFunction(mGetSignedAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB, VectorF norm), (VectorF::Zero, VectorF::Zero, VectorF::Zero), +DefineEngineFunction(mGetSignedAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB, VectorF norm), (VectorF::Zero, VectorF::Zero, VectorF::Zero), "Returns signed angle between two vectors, using a normal for orientation.\n" "@param vecA First input vector." "@param vecB Second input vector." diff --git a/Engine/source/math/mRotation.cpp b/Engine/source/math/mRotation.cpp index 6d9bc3b35..43b696d4a 100644 --- a/Engine/source/math/mRotation.cpp +++ b/Engine/source/math/mRotation.cpp @@ -325,7 +325,7 @@ TEST(Maths, RotationF_Calculations) }; #endif -DefineConsoleFunction(AddRotation, RotationF, (RotationF a, RotationF b), , +DefineEngineFunction(AddRotation, RotationF, (RotationF a, RotationF b), , "Adds two rotations together.\n" "@param a Rotation one." "@param b Rotation two." @@ -335,7 +335,7 @@ DefineConsoleFunction(AddRotation, RotationF, (RotationF a, RotationF b), , return a + b; } -DefineConsoleFunction(SubtractRotation, RotationF, (RotationF a, RotationF b), , +DefineEngineFunction(SubtractRotation, RotationF, (RotationF a, RotationF b), , "Subtracts two rotations.\n" "@param a Rotation one." "@param b Rotation two." @@ -345,7 +345,7 @@ DefineConsoleFunction(SubtractRotation, RotationF, (RotationF a, RotationF b), , return a - b; } -DefineConsoleFunction(InterpolateRotation, RotationF, (RotationF a, RotationF b, F32 factor), , +DefineEngineFunction(InterpolateRotation, RotationF, (RotationF a, RotationF b, F32 factor), , "Interpolates between two rotations.\n" "@param a Rotation one." "@param b Rotation two." @@ -358,7 +358,7 @@ DefineConsoleFunction(InterpolateRotation, RotationF, (RotationF a, RotationF b, return result; } -DefineConsoleFunction(RotationLookAt, RotationF, (Point3F origin, Point3F target, Point3F up), +DefineEngineFunction(RotationLookAt, RotationF, (Point3F origin, Point3F target, Point3F up), (Point3F(0, 0, 0), Point3F(0, 0, 0), Point3F(0, 0, 1)), "Provides a rotation orientation to look at a target from a given position.\n" "@param origin Position of the object doing the looking." @@ -372,7 +372,7 @@ DefineConsoleFunction(RotationLookAt, RotationF, (Point3F origin, Point3F target return result; } -DefineConsoleFunction(setRotationRightVector, RotationF, (RotationF rot, VectorF rightVec), , +DefineEngineFunction(setRotationRightVector, RotationF, (RotationF rot, VectorF rightVec), , "Sets the right vector of the rotation.\n" "@param Starting rotation." "@param New up vector." @@ -383,7 +383,7 @@ DefineConsoleFunction(setRotationRightVector, RotationF, (RotationF rot, VectorF return rot; } -DefineConsoleFunction(setRotationUpVector, RotationF, (RotationF rot, VectorF upVec), , +DefineEngineFunction(setRotationUpVector, RotationF, (RotationF rot, VectorF upVec), , "Sets the up vector of the rotation.\n" "@param Starting rotation." "@param New up vector." @@ -394,14 +394,14 @@ DefineConsoleFunction(setRotationUpVector, RotationF, (RotationF rot, VectorF up return rot; } -DefineConsoleFunction(getRotationForwardVector, VectorF, (RotationF rot), , +DefineEngineFunction(getRotationForwardVector, VectorF, (RotationF rot), , "Get the forward vector of a rotation.\n" "@ingroup Math") { return rot.asMatrixF().getForwardVector(); } -DefineConsoleFunction(getRotationRightVector, VectorF, (RotationF rot), , +DefineEngineFunction(getRotationRightVector, VectorF, (RotationF rot), , "Gets the right vector of a rotation.\n" "@param Our rotation." "@ingroup Math") @@ -409,7 +409,7 @@ DefineConsoleFunction(getRotationRightVector, VectorF, (RotationF rot), , return rot.asMatrixF().getRightVector(); } -DefineConsoleFunction(getRotationUpVector, VectorF, (RotationF rot), , +DefineEngineFunction(getRotationUpVector, VectorF, (RotationF rot), , "Gets the up vector of a rotation.\n" "@param Our rotation." "@ingroup Math") @@ -417,7 +417,7 @@ DefineConsoleFunction(getRotationUpVector, VectorF, (RotationF rot), , return rot.asMatrixF().getUpVector(); } -DefineConsoleFunction(getRotationDirection, Point3F, (RotationF rot),, +DefineEngineFunction(getRotationDirection, Point3F, (RotationF rot),, "Gets the direction from the rotation's angles.\n" "@param Our rotation." "@ingroup Math") diff --git a/Engine/source/math/mathTypes.cpp b/Engine/source/math/mathTypes.cpp index 1d1011d0f..30b550abc 100644 --- a/Engine/source/math/mathTypes.cpp +++ b/Engine/source/math/mathTypes.cpp @@ -631,7 +631,7 @@ ConsoleSetType(TypeRotationF) //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorAdd, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorAdd, VectorF, ( VectorF a, VectorF b ),, "Add two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -659,7 +659,7 @@ DefineConsoleFunction( VectorAdd, VectorF, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorSub, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorSub, VectorF, ( VectorF a, VectorF b ),, "Subtract two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -689,7 +689,7 @@ DefineConsoleFunction( VectorSub, VectorF, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorScale, VectorF, ( VectorF a, F32 scalar ),, +DefineEngineFunction( VectorScale, VectorF, ( VectorF a, F32 scalar ),, "Scales a vector by a scalar.\n" "@param a The vector to scale.\n" "@param scalar The scale factor.\n" @@ -716,7 +716,7 @@ DefineConsoleFunction( VectorScale, VectorF, ( VectorF a, F32 scalar ),, { return a * scalar; } -DefineConsoleFunction( VectorMul, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorMul, VectorF, ( VectorF a, VectorF b ),, "Multiplies two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -744,7 +744,7 @@ DefineConsoleFunction( VectorMul, VectorF, ( VectorF a, VectorF b ),, return a * b; } -DefineConsoleFunction( VectorDiv, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorDiv, VectorF, ( VectorF a, VectorF b ),, "Divide two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -779,7 +779,7 @@ DefineConsoleFunction( VectorDiv, VectorF, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorNormalize, VectorF, ( VectorF v ),, +DefineEngineFunction( VectorNormalize, VectorF, ( VectorF v ),, "Brings a vector into its unit form, i.e. such that it has the magnitute 1.\n" "@param v The vector to normalize.\n" "@return The vector @a v scaled to length 1.\n\n" @@ -811,7 +811,7 @@ DefineConsoleFunction( VectorNormalize, VectorF, ( VectorF v ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorDot, F32, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorDot, F32, ( VectorF a, VectorF b ),, "Compute the dot product of two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -841,7 +841,7 @@ DefineConsoleFunction( VectorDot, F32, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorCross, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorCross, VectorF, ( VectorF a, VectorF b ),, "Calculcate the cross product of two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -873,7 +873,7 @@ DefineConsoleFunction( VectorCross, VectorF, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorDist, F32, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorDist, F32, ( VectorF a, VectorF b ),, "Compute the distance between two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -906,7 +906,7 @@ DefineConsoleFunction( VectorDist, F32, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorMidPoint, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorMidPoint, VectorF, ( VectorF a, VectorF b ),, "Gets the midpoint between the two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -934,7 +934,7 @@ DefineConsoleFunction( VectorMidPoint, VectorF, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorLen, F32, ( VectorF v ),, +DefineEngineFunction( VectorLen, F32, ( VectorF v ),, "Calculate the magnitude of the given vector.\n" "@param v A vector.\n" "@return The length of vector @a v.\n\n" @@ -963,7 +963,7 @@ DefineConsoleFunction( VectorLen, F32, ( VectorF v ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorOrthoBasis, MatrixF, ( AngAxisF aa ),, +DefineEngineFunction( VectorOrthoBasis, MatrixF, ( AngAxisF aa ),, "Create an orthogonal basis from the given vector.\n" "@param aaf The vector to create the orthogonal basis from.\n" "@return A matrix representing the orthogonal basis.\n" @@ -977,7 +977,7 @@ DefineConsoleFunction( VectorOrthoBasis, MatrixF, ( AngAxisF aa ),, //----------------------------------------------------------------------------- //ConsoleFunction(VectorRot, const char*, 3, 3, "(Vector3F, float) rotate a vector in 2d") -DefineConsoleFunction( VectorRot, const char*, (Point3F v, F32 angle), , "(Vector3F, float) rotate a vector in 2d") +DefineEngineFunction( VectorRot, const char*, (Point3F v, F32 angle), , "(Vector3F, float) rotate a vector in 2d") { //VectorF v(0,0,0); //dSscanf(argv[1],"%g %g %g",&v.x,&v.y,&v.z); @@ -996,7 +996,7 @@ DefineConsoleFunction( VectorRot, const char*, (Point3F v, F32 angle), , "(Vecto return returnBuffer; } -DefineConsoleFunction( VectorLerp, VectorF, ( VectorF a, VectorF b, F32 t ),, +DefineEngineFunction( VectorLerp, VectorF, ( VectorF a, VectorF b, F32 t ),, "Linearly interpolate between two vectors by @a t.\n" "@param a Vector to start interpolation from.\n" "@param b Vector to interpolate to.\n" @@ -1032,7 +1032,7 @@ DefineConsoleFunction( VectorLerp, VectorF, ( VectorF a, VectorF b, F32 t ),, return c; } -DefineConsoleFunction(VectorReflect, VectorF, (VectorF vec, VectorF normal), , +DefineEngineFunction(VectorReflect, VectorF, (VectorF vec, VectorF normal), , "Compute the reflection of a vector based on a normal.\n" "@param a The vector.\n" "@param b The normal.\n" @@ -1046,7 +1046,7 @@ DefineConsoleFunction(VectorReflect, VectorF, (VectorF vec, VectorF normal), , //----------------------------------------------------------------------------- -DefineConsoleFunction( MatrixCreate, TransformF, ( VectorF position, AngAxisF orientation ),, +DefineEngineFunction( MatrixCreate, TransformF, ( VectorF position, AngAxisF orientation ),, "Create a transform from the given translation and orientation.\n" "@param position The translation vector for the transform.\n" "@param orientation The axis and rotation that orients the transform.\n" @@ -1059,7 +1059,7 @@ DefineConsoleFunction( MatrixCreate, TransformF, ( VectorF position, AngAxisF or //----------------------------------------------------------------------------- -DefineConsoleFunction( MatrixCreateFromEuler, TransformF, ( Point3F angles ),, +DefineEngineFunction( MatrixCreateFromEuler, TransformF, ( Point3F angles ),, "@Create a matrix from the given rotations.\n\n" "@param Vector3F X, Y, and Z rotation in *radians*.\n" "@return A transform based on the given orientation.\n" @@ -1074,7 +1074,7 @@ DefineConsoleFunction( MatrixCreateFromEuler, TransformF, ( Point3F angles ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( MatrixMultiply, TransformF, ( TransformF left, TransformF right ),, +DefineEngineFunction( MatrixMultiply, TransformF, ( TransformF left, TransformF right ),, "@brief Multiply the two matrices.\n\n" "@param left First transform.\n" "@param right Right transform.\n" @@ -1091,7 +1091,7 @@ DefineConsoleFunction( MatrixMultiply, TransformF, ( TransformF left, TransformF //----------------------------------------------------------------------------- -DefineConsoleFunction( MatrixMulVector, VectorF, ( TransformF transform, VectorF vector ),, +DefineEngineFunction( MatrixMulVector, VectorF, ( TransformF transform, VectorF vector ),, "@brief Multiply the vector by the transform assuming that w=0.\n\n" "This function will multiply the given vector by the given transform such that translation will " "not affect the vector.\n\n" @@ -1107,7 +1107,7 @@ DefineConsoleFunction( MatrixMulVector, VectorF, ( TransformF transform, VectorF //----------------------------------------------------------------------------- -DefineConsoleFunction( MatrixMulPoint, Point3F, ( TransformF transform, Point3F point ),, +DefineEngineFunction( MatrixMulPoint, Point3F, ( TransformF transform, Point3F point ),, "@brief Multiply the given point by the given transform assuming that w=1.\n\n" "This function will multiply the given vector such that translation with take effect.\n" "@param transform A transform.\n" @@ -1124,7 +1124,7 @@ ConsoleFunctionGroupEnd(MatrixMath); //------------------------------------------------------------------------------ -DefineConsoleFunction( getBoxCenter, Point3F, ( Box3F box ),, +DefineEngineFunction( getBoxCenter, Point3F, ( Box3F box ),, "Get the center point of an axis-aligned box.\n\n" "@param b A Box3F, in string format using \"minExtentX minExtentY minExtentZ maxExtentX maxExtentY maxExtentZ\"\n" "@return Center of the box.\n" @@ -1176,7 +1176,7 @@ F32 mRandF() return gRandGen.randF(); } -DefineConsoleFunction(getRandom, F32, (S32 a, S32 b), (S32_MAX, S32_MAX), +DefineEngineFunction(getRandom, F32, (S32 a, S32 b), (S32_MAX, S32_MAX), "( int a, int b ) " "@brief Returns a random number based on parameters passed in..\n\n" "If no parameters are passed in, getRandom() will return a float between 0.0 and 1.0. If one " diff --git a/Engine/source/navigation/navMesh.cpp b/Engine/source/navigation/navMesh.cpp index c9bbb1fa4..f4adf9992 100644 --- a/Engine/source/navigation/navMesh.cpp +++ b/Engine/source/navigation/navMesh.cpp @@ -95,13 +95,13 @@ EventManager *NavMesh::getEventManager() return smEventManager; } -DefineConsoleFunction(getNavMeshEventManager, S32, (),, +DefineEngineFunction(getNavMeshEventManager, S32, (),, "@brief Get the EventManager object for all NavMesh updates.") { return NavMesh::getEventManager()->getId(); } -DefineConsoleFunction(NavMeshUpdateAll, void, (S32 objid, bool remove), (0, false), +DefineEngineFunction(NavMeshUpdateAll, void, (S32 objid, bool remove), (0, false), "@brief Update all NavMesh tiles that intersect the given object's world box.") { SceneObject *obj; @@ -123,7 +123,7 @@ DefineConsoleFunction(NavMeshUpdateAll, void, (S32 objid, bool remove), (0, fals obj->enableCollision(); } -DefineConsoleFunction(NavMeshUpdateAroundObject, void, (S32 objid, bool remove), (0, false), +DefineEngineFunction(NavMeshUpdateAroundObject, void, (S32 objid, bool remove), (0, false), "@brief Update all NavMesh tiles that intersect the given object's world box.") { SceneObject *obj; @@ -146,7 +146,7 @@ DefineConsoleFunction(NavMeshUpdateAroundObject, void, (S32 objid, bool remove), } -DefineConsoleFunction(NavMeshIgnore, void, (S32 objid, bool _ignore), (0, true), +DefineEngineFunction(NavMeshIgnore, void, (S32 objid, bool _ignore), (0, true), "@brief Flag this object as not generating a navmesh result.") { SceneObject *obj; @@ -156,7 +156,7 @@ DefineConsoleFunction(NavMeshIgnore, void, (S32 objid, bool _ignore), (0, true), obj->mPathfindingIgnore = _ignore; } -DefineConsoleFunction(NavMeshUpdateOne, void, (S32 meshid, S32 objid, bool remove), (0, 0, false), +DefineEngineFunction(NavMeshUpdateOne, void, (S32 meshid, S32 objid, bool remove), (0, 0, false), "@brief Update all tiles in a given NavMesh that intersect the given object's world box.") { NavMesh *mesh; diff --git a/Engine/source/platform/platformFileIO.cpp b/Engine/source/platform/platformFileIO.cpp index a9ace740b..788ed4f62 100644 --- a/Engine/source/platform/platformFileIO.cpp +++ b/Engine/source/platform/platformFileIO.cpp @@ -38,7 +38,7 @@ StringTableEntry Platform::getTemporaryDirectory() return path; } -DefineConsoleFunction( getTemporaryDirectory, const char *, (), , +DefineEngineFunction( getTemporaryDirectory, const char *, (), , "@brief Returns the OS temporary directory, \"C:/Users/Mich/AppData/Local/Temp\" for example\n\n" "@note This can be useful to adhering to OS standards and practices, " "but not really used in Torque 3D right now.\n" @@ -66,7 +66,7 @@ StringTableEntry Platform::getTemporaryFileName() return StringTable->insert(buf); } -DefineConsoleFunction( getTemporaryFileName, const char *, (), , +DefineEngineFunction( getTemporaryFileName, const char *, (), , "@brief Creates a name and extension for a potential temporary file\n\n" "This does not create the actual file. It simply creates a random name " "for a file that does not exist.\n\n" @@ -611,12 +611,12 @@ StringTableEntry Platform::getPrefsPath(const char *file /* = NULL */) //----------------------------------------------------------------------------- -DefineConsoleFunction( getUserDataDirectory, const char *, (), , "getUserDataDirectory()") +DefineEngineFunction( getUserDataDirectory, const char *, (), , "getUserDataDirectory()") { return Platform::getUserDataDirectory(); } -DefineConsoleFunction( getUserHomeDirectory, const char *, (), , "getUserHomeDirectory()") +DefineEngineFunction( getUserHomeDirectory, const char *, (), , "getUserHomeDirectory()") { return Platform::getUserHomeDirectory(); } diff --git a/Engine/source/platform/platformMemory.cpp b/Engine/source/platform/platformMemory.cpp index 5f7aa926d..f10113308 100644 --- a/Engine/source/platform/platformMemory.cpp +++ b/Engine/source/platform/platformMemory.cpp @@ -885,7 +885,7 @@ void logDumpTraverse(MemDumpLog *sizes, TreeNode *header, U32 depth) } #ifdef TORQUE_DEBUG -DefineConsoleFunction( validateMemory, void, ( ),, +DefineEngineFunction( validateMemory, void, ( ),, "@brief Used to validate memory space for the game.\n\n" "@ingroup Debugging" ) { @@ -893,7 +893,7 @@ DefineConsoleFunction( validateMemory, void, ( ),, } #endif -DefineConsoleFunction( freeMemoryDump, void, ( ),, +DefineEngineFunction( freeMemoryDump, void, ( ),, "@brief Dumps some useful statistics regarding free memory.\n\n" "Dumps an analysis of \'free chunks\' of memory. " "Does not print how much memory is free.\n\n" diff --git a/Engine/source/platform/platformRedBook.cpp b/Engine/source/platform/platformRedBook.cpp index 82b1bae2d..acbc0bc7a 100644 --- a/Engine/source/platform/platformRedBook.cpp +++ b/Engine/source/platform/platformRedBook.cpp @@ -211,7 +211,7 @@ bool RedBook::setVolume(F32 volume) ConsoleFunctionGroupBegin( Redbook, "Control functions for Redbook audio (ie, CD audio)."); -DefineConsoleFunction( redbookOpen, bool, (const char * device), (""), "(string device=NULL)" +DefineEngineFunction( redbookOpen, bool, (const char * device), (""), "(string device=NULL)" "@brief Deprecated\n\n" "@internal") { @@ -221,28 +221,28 @@ DefineConsoleFunction( redbookOpen, bool, (const char * device), (""), "(string return(RedBook::open(device)); } -DefineConsoleFunction( redbookClose, bool, (), , "Close the current Redbook device." +DefineEngineFunction( redbookClose, bool, (), , "Close the current Redbook device." "@brief Deprecated\n\n" "@internal") { return(RedBook::close()); } -DefineConsoleFunction( redbookPlay, bool, (S32 track), , "(int track) Play the selected track." +DefineEngineFunction( redbookPlay, bool, (S32 track), , "(int track) Play the selected track." "@brief Deprecated\n\n" "@internal") { return(RedBook::play(track)); } -DefineConsoleFunction( redbookStop, bool, (), , "Stop playing." +DefineEngineFunction( redbookStop, bool, (), , "Stop playing." "@brief Deprecated\n\n" "@internal") { return(RedBook::stop()); } -DefineConsoleFunction( redbookGetTrackCount, S32, (), , "Return the number of tracks." +DefineEngineFunction( redbookGetTrackCount, S32, (), , "Return the number of tracks." "@brief Deprecated\n\n" "@internal") { @@ -252,7 +252,7 @@ DefineConsoleFunction( redbookGetTrackCount, S32, (), , "Return the number of tr return(trackCount); } -DefineConsoleFunction( redbookGetVolume, F32, (), , "Get the volume." +DefineEngineFunction( redbookGetVolume, F32, (), , "Get the volume." "@brief Deprecated\n\n" "@internal") { @@ -263,28 +263,28 @@ DefineConsoleFunction( redbookGetVolume, F32, (), , "Get the volume." return(vol); } -DefineConsoleFunction( redbookSetVolume, bool, (F32 volume), , "(float volume) Set playback volume." +DefineEngineFunction( redbookSetVolume, bool, (F32 volume), , "(float volume) Set playback volume." "@brief Deprecated\n\n" "@internal") { return(RedBook::setVolume(volume)); } -DefineConsoleFunction( redbookGetDeviceCount, S32, (), , "get the number of redbook devices." +DefineEngineFunction( redbookGetDeviceCount, S32, (), , "get the number of redbook devices." "@brief Deprecated\n\n" "@internal") { return(RedBook::getDeviceCount()); } -DefineConsoleFunction( redbookGetDeviceName, const char *, (S32 index), , "(int index) Get name of specified Redbook device." +DefineEngineFunction( redbookGetDeviceName, const char *, (S32 index), , "(int index) Get name of specified Redbook device." "@brief Deprecated\n\n" "@internal") { return(RedBook::getDeviceName(index)); } -DefineConsoleFunction( redbookGetLastError, const char *, (), , "Get a string explaining the last redbook error." +DefineEngineFunction( redbookGetLastError, const char *, (), , "Get a string explaining the last redbook error." "@brief Deprecated\n\n" "@internal") { diff --git a/Engine/source/platform/platformTimer.cpp b/Engine/source/platform/platformTimer.cpp index 1da010c5a..e3be91fe9 100644 --- a/Engine/source/platform/platformTimer.cpp +++ b/Engine/source/platform/platformTimer.cpp @@ -160,12 +160,12 @@ S32 ScriptTimerMan::stopTimer( S32 id ) ScriptTimerMan gScriptTimerMan; -DefineConsoleFunction( startPrecisionTimer, S32, (), , "startPrecisionTimer() - Create and start a high resolution platform timer. Returns the timer id." ) +DefineEngineFunction( startPrecisionTimer, S32, (), , "startPrecisionTimer() - Create and start a high resolution platform timer. Returns the timer id." ) { return gScriptTimerMan.startTimer(); } -DefineConsoleFunction( stopPrecisionTimer, S32, ( S32 id), , "stopPrecisionTimer( S32 id ) - Stop and destroy timer with the passed id. Returns the elapsed milliseconds." ) +DefineEngineFunction( stopPrecisionTimer, S32, ( S32 id), , "stopPrecisionTimer( S32 id ) - Stop and destroy timer with the passed id. Returns the elapsed milliseconds." ) { return gScriptTimerMan.stopTimer( id ); } \ No newline at end of file diff --git a/Engine/source/platformWin32/cardProfile.cpp b/Engine/source/platformWin32/cardProfile.cpp index a4658f98c..dbfad0fe6 100644 --- a/Engine/source/platformWin32/cardProfile.cpp +++ b/Engine/source/platformWin32/cardProfile.cpp @@ -74,7 +74,7 @@ void initDisplayDeviceInfo() Con::setVariable( "$PCI_DEV", dev ); } -DefineConsoleFunction( initDisplayDeviceInfo, void, (), , "()" +DefineEngineFunction( initDisplayDeviceInfo, void, (), , "()" "@brief Initializes variables that track device and vendor information/IDs\n\n" "@ingroup Rendering") { diff --git a/Engine/source/platformWin32/winConsole.cpp b/Engine/source/platformWin32/winConsole.cpp index cc92c2c15..66c9bb3c0 100644 --- a/Engine/source/platformWin32/winConsole.cpp +++ b/Engine/source/platformWin32/winConsole.cpp @@ -38,7 +38,7 @@ namespace Con extern bool alwaysUseDebugOutput; } -DefineConsoleFunction( enableWinConsole, void, (bool flag), , "enableWinConsole(bool);") +DefineEngineFunction( enableWinConsole, void, (bool flag), , "enableWinConsole(bool);") { WindowsConsole->enable(flag); } diff --git a/Engine/source/platformWin32/winDirectInput.cpp b/Engine/source/platformWin32/winDirectInput.cpp index 2fd8084ef..fd016496f 100644 --- a/Engine/source/platformWin32/winDirectInput.cpp +++ b/Engine/source/platformWin32/winDirectInput.cpp @@ -769,7 +769,7 @@ void DInputManager::processXInput( void ) mXInputStateReset = false; } } -DefineConsoleFunction( enableJoystick, bool, (), , "()" +DefineEngineFunction( enableJoystick, bool, (), , "()" "@brief Enables use of the joystick.\n\n" "@note DirectInput must be enabled and active to use this function.\n\n" "@ingroup Input") @@ -778,7 +778,7 @@ DefineConsoleFunction( enableJoystick, bool, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( disableJoystick, void, (), , "()" +DefineEngineFunction( disableJoystick, void, (), , "()" "@brief Disables use of the joystick.\n\n" "@note DirectInput must be enabled and active to use this function.\n\n" "@ingroup Input") @@ -787,7 +787,7 @@ DefineConsoleFunction( disableJoystick, void, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( isJoystickEnabled, bool, (), , "()" +DefineEngineFunction( isJoystickEnabled, bool, (), , "()" "@brief Queries input manager to see if a joystick is enabled\n\n" "@return 1 if a joystick exists and is enabled, 0 if it's not.\n" "@ingroup Input") @@ -796,7 +796,7 @@ DefineConsoleFunction( isJoystickEnabled, bool, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( enableXInput, bool, (), , "()" +DefineEngineFunction( enableXInput, bool, (), , "()" "@brief Enables XInput for Xbox 360 controllers.\n\n" "@note XInput is enabled by default. Disable to use an Xbox 360 " "Controller as a joystick device.\n\n" @@ -811,7 +811,7 @@ DefineConsoleFunction( enableXInput, bool, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( disableXInput, void, (), , "()" +DefineEngineFunction( disableXInput, void, (), , "()" "@brief Disables XInput for Xbox 360 controllers.\n\n" "@ingroup Input") { @@ -819,7 +819,7 @@ DefineConsoleFunction( disableXInput, void, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( resetXInput, void, (), , "()" +DefineEngineFunction( resetXInput, void, (), , "()" "@brief Rebuilds the XInput section of the InputManager\n\n" "Requests a full refresh of events for all controllers. Useful when called at the beginning " "of game code after actionMaps are set up to hook up all appropriate events.\n\n" @@ -836,7 +836,7 @@ DefineConsoleFunction( resetXInput, void, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( isXInputConnected, bool, (S32 controllerID), , "( int controllerID )" +DefineEngineFunction( isXInputConnected, bool, (S32 controllerID), , "( int controllerID )" "@brief Checks to see if an Xbox 360 controller is connected\n\n" "@param controllerID Zero-based index of the controller to check.\n" "@return 1 if the controller is connected, 0 if it isn't, and 205 if XInput " @@ -849,7 +849,7 @@ DefineConsoleFunction( isXInputConnected, bool, (S32 controllerID), , "( int con } //------------------------------------------------------------------------------ -DefineConsoleFunction( getXInputState, int, (S32 controllerID, const char * properties, bool current), (false), "( int controllerID, string property, bool currentD )" +DefineEngineFunction( getXInputState, int, (S32 controllerID, const char * properties, bool current), (false), "( int controllerID, string property, bool currentD )" "@brief Queries the current state of a connected Xbox 360 controller.\n\n" "XInput Properties:\n\n" " - XI_THUMBLX, XI_THUMBLY - X and Y axes of the left thumbstick. \n" @@ -905,7 +905,7 @@ DefineConsoleFunction( getXInputState, int, (S32 controllerID, const char * prop } //------------------------------------------------------------------------------ -DefineConsoleFunction( echoInputState, void, (), , "()" +DefineEngineFunction( echoInputState, void, (), , "()" "@brief Prints information to the console stating if DirectInput and a Joystick are enabled and active.\n\n" "@ingroup Input") { @@ -921,7 +921,7 @@ DefineConsoleFunction( echoInputState, void, (), , "()" Con::printf( "DirectInput is not enabled." ); } -DefineConsoleFunction( rumble, void, (const char * device, F32 xRumble, F32 yRumble), , "(string device, float xRumble, float yRumble)" +DefineEngineFunction( rumble, void, (const char * device, F32 xRumble, F32 yRumble), , "(string device, float xRumble, float yRumble)" "@brief Activates the vibration motors in the specified controller.\n\n" "The controller will constantly at it's xRumble and yRumble intensities until " "changed or told to stop." diff --git a/Engine/source/platformWin32/winExec.cpp b/Engine/source/platformWin32/winExec.cpp index 6ec218929..3b9ad52b9 100644 --- a/Engine/source/platformWin32/winExec.cpp +++ b/Engine/source/platformWin32/winExec.cpp @@ -136,7 +136,7 @@ void ExecuteThread::run(void *arg /* = 0 */) // Console Functions //----------------------------------------------------------------------------- -DefineConsoleFunction( shellExecute, bool, (const char * executable, const char * args, const char * directory), ("", ""), "(string executable, string args, string directory)" +DefineEngineFunction( shellExecute, bool, (const char * executable, const char * args, const char * directory), ("", ""), "(string executable, string args, string directory)" "@brief Launches an outside executable or batch file\n\n" "@param executable Name of the executable or batch file\n" "@param args Optional list of arguments, in string format, to pass to the executable\n" diff --git a/Engine/source/platformWin32/winInput.cpp b/Engine/source/platformWin32/winInput.cpp index 2424eabdb..77eb38511 100644 --- a/Engine/source/platformWin32/winInput.cpp +++ b/Engine/source/platformWin32/winInput.cpp @@ -157,13 +157,13 @@ void Input::init() } //------------------------------------------------------------------------------ -DefineConsoleFunction( isJoystickDetected, bool, (), , "isJoystickDetected()") +DefineEngineFunction( isJoystickDetected, bool, (), , "isJoystickDetected()") { return( DInputDevice::joystickDetected() ); } //------------------------------------------------------------------------------ -DefineConsoleFunction( getJoystickAxes, const char*, (U32 deviceID), , "getJoystickAxes( instance )") +DefineEngineFunction( getJoystickAxes, const char*, (U32 deviceID), , "getJoystickAxes( instance )") { DInputManager* mgr = dynamic_cast( Input::getManager() ); if ( mgr ) @@ -505,7 +505,7 @@ void Input::log( const char* format, ... ) va_end( argptr ); } -DefineConsoleFunction( inputLog, void, (const char * log), , "inputLog( string )") +DefineEngineFunction( inputLog, void, (const char * log), , "inputLog( string )") { Input::log( "%s\n", log ); } diff --git a/Engine/source/platformWin32/winWindow.cpp b/Engine/source/platformWin32/winWindow.cpp index 63fb5ea54..0ce0f7cba 100644 --- a/Engine/source/platformWin32/winWindow.cpp +++ b/Engine/source/platformWin32/winWindow.cpp @@ -643,7 +643,7 @@ bool Platform::setLoginPassword( const char* password ) // as commentary on Koreans as a nationality. Thank you for your // attention. //-------------------------------------- -DefineConsoleFunction( isKoreanBuild, bool, ( ), , "isKoreanBuild()") +DefineEngineFunction( isKoreanBuild, bool, ( ), , "isKoreanBuild()") { HKEY regKey; bool result = false; diff --git a/Engine/source/scene/pathManager.cpp b/Engine/source/scene/pathManager.cpp index 2f1c423c3..7d9c88140 100644 --- a/Engine/source/scene/pathManager.cpp +++ b/Engine/source/scene/pathManager.cpp @@ -207,12 +207,12 @@ void PathManager::clearPaths() #endif } -DefineConsoleFunction( clearServerPaths, void, ( ), , "") +DefineEngineFunction( clearServerPaths, void, ( ), , "") { gServerPathManager->clearPaths(); } -DefineConsoleFunction( clearClientPaths, void, ( ), , "") +DefineEngineFunction( clearClientPaths, void, ( ), , "") { gClientPathManager->clearPaths(); } diff --git a/Engine/source/scene/sceneManager.cpp b/Engine/source/scene/sceneManager.cpp index aeca87092..706bc0da5 100644 --- a/Engine/source/scene/sceneManager.cpp +++ b/Engine/source/scene/sceneManager.cpp @@ -720,7 +720,7 @@ RenderPassManager* SceneManager::getDefaultRenderPass() const //----------------------------------------------------------------------------- -DefineConsoleFunction( sceneDumpZoneStates, void, ( bool updateFirst ), ( true ), +DefineEngineFunction( sceneDumpZoneStates, void, ( bool updateFirst ), ( true ), "Dump the current zoning states of all zone spaces in the scene to the console.\n\n" "@param updateFirst If true, zoning states are brought up to date first; if false, the zoning states " "are dumped as is.\n\n" @@ -745,7 +745,7 @@ DefineConsoleFunction( sceneDumpZoneStates, void, ( bool updateFirst ), ( true ) //----------------------------------------------------------------------------- -DefineConsoleFunction( sceneGetZoneOwner, SceneObject*, ( U32 zoneId ),, +DefineEngineFunction( sceneGetZoneOwner, SceneObject*, ( U32 zoneId ),, "Return the SceneObject that contains the given zone.\n\n" "@param zoneId ID of zone.\n" "@return A SceneObject or NULL if the given @a zoneId is invalid.\n\n" diff --git a/Engine/source/sfx/sfxSystem.cpp b/Engine/source/sfx/sfxSystem.cpp index b02d4fc67..0377aff90 100644 --- a/Engine/source/sfx/sfxSystem.cpp +++ b/Engine/source/sfx/sfxSystem.cpp @@ -1442,7 +1442,7 @@ static ConsoleDocFragment _sfxCreateSource4( NULL, "SFXSound sfxCreateSource( SFXDescription description, string filename, float x, float y, float z );" ); -DefineConsoleFunction( sfxCreateSource, S32, ( const char * sfxType, const char * arg0, const char * arg1, const char * arg2, const char * arg3 ), ("", "", "", ""), +DefineEngineFunction( sfxCreateSource, S32, ( const char * sfxType, const char * arg0, const char * arg1, const char * arg2, const char * arg3 ), ("", "", "", ""), "( SFXTrack track | ( SFXDescription description, string filename ) [, float x, float y, float z ] ) " "Creates a new paused sound source using a profile or a description " "and filename. The return value is the source which must be " @@ -1547,7 +1547,7 @@ static ConsoleDocFragment _sfxPlay3( NULL, "void sfxPlay( SFXTrack track, float x, float y, float z );" ); -DefineConsoleFunction( sfxPlay, S32, ( const char * trackName, const char * pointOrX, const char * y, const char * z ), ( "", "", ""), +DefineEngineFunction( sfxPlay, S32, ( const char * trackName, const char * pointOrX, const char * y, const char * z ), ( "", "", ""), "Start playing the given source or create a new source for the given track and play it.\n" "@hide" ) { @@ -1657,7 +1657,7 @@ static ConsoleDocFragment _sPlayOnce4( "SFXSource sfxPlayOnce( SFXDescription description, string filename, float x, float y, float z, float fadeInTime=-1 );" ); -DefineConsoleFunction( sfxPlayOnce, S32, ( const char * sfxType, const char * arg0, const char * arg1, const char * arg2, const char * arg3, const char* arg4 ), ("", "", "", "", "-1.0f"), +DefineEngineFunction( sfxPlayOnce, S32, ( const char * sfxType, const char * arg0, const char * arg1, const char * arg2, const char * arg3, const char* arg4 ), ("", "", "", "", "-1.0f"), "SFXSource sfxPlayOnce( ( SFXTrack track | SFXDescription description, string filename ) [, float x, float y, float z, float fadeInTime=-1 ] ) " "Create a new play-once source for the given profile or description+filename and start playback of the source.\n" "@hide" ) diff --git a/Engine/source/sim/netInterface.cpp b/Engine/source/sim/netInterface.cpp index 6d312df8a..fd2c51bc4 100644 --- a/Engine/source/sim/netInterface.cpp +++ b/Engine/source/sim/netInterface.cpp @@ -638,7 +638,7 @@ void NetInterface::computeNetMD5(const NetAddress *address, U32 connectSequence, ConsoleFunctionGroupBegin(NetInterface, "Global control functions for the netInterfaces."); -DefineConsoleFunction( allowConnections, void, ( bool allow ), , "allowConnections(bool allow)" +DefineEngineFunction( allowConnections, void, ( bool allow ), , "allowConnections(bool allow)" "@brief Sets whether or not the global NetInterface allows connections from remote hosts.\n\n" "@param allow Set to true to allow remote connections.\n" diff --git a/Engine/source/terrain/terrData.cpp b/Engine/source/terrain/terrData.cpp index 37f523356..78e991b63 100644 --- a/Engine/source/terrain/terrData.cpp +++ b/Engine/source/terrain/terrData.cpp @@ -147,7 +147,7 @@ ConsoleDocFragment _getTerrainUnderWorldPoint2( "bool getTerrainUnderWorldPoint( F32 x, F32 y, F32 z);" ); -DefineConsoleFunction( getTerrainUnderWorldPoint, S32, (const char* ptOrX, const char* y, const char* z), ("", ""), +DefineEngineFunction( getTerrainUnderWorldPoint, S32, (const char* ptOrX, const char* y, const char* z), ("", ""), "(Point3F x/y/z) Gets the terrain block that is located under the given world point.\n" "@param x/y/z The world coordinates (floating point values) you wish to query at. " "These can be formatted as either a string (\"x y z\") or separately as (x, y, z)\n" @@ -1338,7 +1338,7 @@ ConsoleDocFragment _getTerrainHeight2( "bool getTerrainHeight( F32 x, F32 y);" ); -DefineConsoleFunction( getTerrainHeight, F32, (const char* ptOrX, const char* y), (""), "(Point2 pos) - gets the terrain height at the specified position." +DefineEngineFunction( getTerrainHeight, F32, (const char* ptOrX, const char* y), (""), "(Point2 pos) - gets the terrain height at the specified position." "@param pos The world space point, minus the z (height) value\n Can be formatted as either (\"x y\") or (x,y)\n" "@return Returns the terrain height at the given point as an F32 value.\n" "@hide") @@ -1383,7 +1383,7 @@ ConsoleDocFragment _getTerrainHeightBelowPosition2( "bool getTerrainHeightBelowPosition( F32 x, F32 y);" ); -DefineConsoleFunction( getTerrainHeightBelowPosition, F32, (const char* ptOrX, const char* y, const char* z), ("", ""), +DefineEngineFunction( getTerrainHeightBelowPosition, F32, (const char* ptOrX, const char* y, const char* z), ("", ""), "(Point3F pos) - gets the terrain height at the specified position." "@param pos The world space point. Can be formatted as either (\"x y z\") or (x,y,z)\n" "@note This function is useful if you simply want to grab the terrain height underneath an object.\n" diff --git a/Engine/source/ts/collada/colladaImport.cpp b/Engine/source/ts/collada/colladaImport.cpp index 1cc2909b0..465e157ec 100644 --- a/Engine/source/ts/collada/colladaImport.cpp +++ b/Engine/source/ts/collada/colladaImport.cpp @@ -126,7 +126,7 @@ static void processNode(GuiTreeViewCtrl* tree, domNode* node, S32 parentID, Scen } } -DefineConsoleFunction( enumColladaForImport, bool, (const char * shapePath, const char * ctrl), , +DefineEngineFunction( enumColladaForImport, bool, (const char * shapePath, const char * ctrl), , "(string shapePath, GuiTreeViewCtrl ctrl) Collect scene information from " "a COLLADA file and store it in a GuiTreeView control. This function is " "used by the COLLADA import gui to show a preview of the scene contents " diff --git a/Engine/source/ts/collada/colladaLights.cpp b/Engine/source/ts/collada/colladaLights.cpp index bb699e4ff..fcc4bb67d 100644 --- a/Engine/source/ts/collada/colladaLights.cpp +++ b/Engine/source/ts/collada/colladaLights.cpp @@ -139,7 +139,7 @@ static void processNodeLights(AppNode* appNode, const MatrixF& offset, SimGroup* } // Load lights from a collada file and add to the scene. -DefineConsoleFunction( loadColladaLights, bool, (const char * filename, const char * parentGroup, const char * baseObject), ("", ""), +DefineEngineFunction( loadColladaLights, bool, (const char * filename, const char * parentGroup, const char * baseObject), ("", ""), "(string filename, SimGroup parentGroup=MissionGroup, SimObject baseObject=-1)" "Load all light instances from a COLLADA (.dae) file and add to the scene.\n" "@param filename COLLADA filename to load lights from\n" diff --git a/Engine/source/ts/loader/tsShapeLoader.cpp b/Engine/source/ts/loader/tsShapeLoader.cpp index 61c183d27..2ae067627 100644 --- a/Engine/source/ts/loader/tsShapeLoader.cpp +++ b/Engine/source/ts/loader/tsShapeLoader.cpp @@ -1325,14 +1325,14 @@ String TSShapeLoader::getFormatFilters() return output.end(); } -DefineConsoleFunction( getFormatExtensions, const char*, ( ),, +DefineEngineFunction( getFormatExtensions, const char*, ( ),, "Returns a list of supported shape format extensions separated by tabs." "Example output: *.dsq TAB *.dae TAB") { return Con::getReturnBuffer(TSShapeLoader::getFormatExtensions()); } -DefineConsoleFunction( getFormatFilters, const char*, ( ),, +DefineEngineFunction( getFormatFilters, const char*, ( ),, "Returns a list of supported shape formats in filter form.\n" "Example output: DSQ Files|*.dsq|COLLADA Files|*.dae|") { diff --git a/Engine/source/ts/tsLastDetail.cpp b/Engine/source/ts/tsLastDetail.cpp index 9619903b0..21dc8b415 100644 --- a/Engine/source/ts/tsLastDetail.cpp +++ b/Engine/source/ts/tsLastDetail.cpp @@ -543,7 +543,7 @@ void TSLastDetail::updateImposterImages( bool forceUpdate ) GFX->endScene(); } -DefineConsoleFunction( tsUpdateImposterImages, void, (bool forceUpdate), (false), "tsUpdateImposterImages( bool forceupdate )") +DefineEngineFunction( tsUpdateImposterImages, void, (bool forceUpdate), (false), "tsUpdateImposterImages( bool forceupdate )") { TSLastDetail::updateImposterImages(forceUpdate); } diff --git a/Engine/source/util/fpsTracker.cpp b/Engine/source/util/fpsTracker.cpp index ebf49b458..4013344e4 100644 --- a/Engine/source/util/fpsTracker.cpp +++ b/Engine/source/util/fpsTracker.cpp @@ -88,7 +88,7 @@ void FPSTracker::update() } } -DefineConsoleFunction( resetFPSTracker, void, (), , "()" +DefineEngineFunction( resetFPSTracker, void, (), , "()" "@brief Reset FPS stats (fps::)\n\n" "@ingroup Game") { diff --git a/Engine/source/util/messaging/dispatcher.cpp b/Engine/source/util/messaging/dispatcher.cpp index 2ae20ba17..d21f0dfdb 100644 --- a/Engine/source/util/messaging/dispatcher.cpp +++ b/Engine/source/util/messaging/dispatcher.cpp @@ -331,7 +331,7 @@ extern void unlockDispatcherMutex() using namespace Dispatcher; -DefineConsoleFunction( isQueueRegistered, bool, (const char * queueName), , "(string queueName)" +DefineEngineFunction( isQueueRegistered, bool, (const char * queueName), , "(string queueName)" "@brief Determines if a dispatcher queue exists\n\n" "@param queueName String containing the name of queue\n" "@ingroup Messaging") @@ -339,7 +339,7 @@ DefineConsoleFunction( isQueueRegistered, bool, (const char * queueName), , "(st return Dispatcher::isQueueRegistered(queueName); } -DefineConsoleFunction( registerMessageQueue, void, (const char *queueName), , "(string queueName)" +DefineEngineFunction( registerMessageQueue, void, (const char *queueName), , "(string queueName)" "@brief Registeres a dispatcher queue\n\n" "@param queueName String containing the name of queue\n" "@ingroup Messaging") @@ -347,7 +347,7 @@ DefineConsoleFunction( registerMessageQueue, void, (const char *queueName), , "( return Dispatcher::registerMessageQueue(queueName); } -DefineConsoleFunction( unregisterMessageQueue, void, (const char *queueName), , "(string queueName)" +DefineEngineFunction( unregisterMessageQueue, void, (const char *queueName), , "(string queueName)" "@brief Unregisters a dispatcher queue\n\n" "@param queueName String containing the name of queue\n" "@ingroup Messaging") @@ -357,7 +357,7 @@ DefineConsoleFunction( unregisterMessageQueue, void, (const char *queueName), , //----------------------------------------------------------------------------- -DefineConsoleFunction( registerMessageListener, bool, (const char *queueName, const char *listenerName), , "(string queueName, string listener)" +DefineEngineFunction( registerMessageListener, bool, (const char *queueName, const char *listenerName), , "(string queueName, string listener)" "@brief Registers an event message\n\n" "@param queueName String containing the name of queue to attach listener to\n" "@param listener Name of event messenger\n" @@ -373,7 +373,7 @@ DefineConsoleFunction( registerMessageListener, bool, (const char *queueName, co return Dispatcher::registerMessageListener(queueName, listener); } -DefineConsoleFunction( unregisterMessageListener, void, (const char *queueName, const char *listenerName), , "(string queueName, string listener)" +DefineEngineFunction( unregisterMessageListener, void, (const char *queueName, const char *listenerName), , "(string queueName, string listener)" "@brief Unregisters an event message\n\n" "@param queueName String containing the name of queue\n" "@param listener Name of event messenger\n" @@ -391,7 +391,7 @@ DefineConsoleFunction( unregisterMessageListener, void, (const char *queueName, //----------------------------------------------------------------------------- -DefineConsoleFunction( dispatchMessage, bool, (const char *queueName, const char *message, const char *data), (""), "(string queueName, string message, string data)" +DefineEngineFunction( dispatchMessage, bool, (const char *queueName, const char *message, const char *data), (""), "(string queueName, string message, string data)" "@brief Dispatch a message to a queue\n\n" "@param queueName Queue to dispatch the message to\n" "@param message Message to dispatch\n" @@ -403,7 +403,7 @@ DefineConsoleFunction( dispatchMessage, bool, (const char *queueName, const char return Dispatcher::dispatchMessage(queueName, message, data); } -DefineConsoleFunction( dispatchMessageObject, bool, (const char *queueName, const char *message), ("", ""), "(string queueName, string message)" +DefineEngineFunction( dispatchMessageObject, bool, (const char *queueName, const char *message), ("", ""), "(string queueName, string message)" "@brief Dispatch a message object to a queue\n\n" "@param queueName Queue to dispatch the message to\n" "@param message Message to dispatch\n" diff --git a/Engine/source/util/sampler.cpp b/Engine/source/util/sampler.cpp index 7e163d004..f4d051e1e 100644 --- a/Engine/source/util/sampler.cpp +++ b/Engine/source/util/sampler.cpp @@ -394,7 +394,7 @@ SAMPLE_FUNC( const char* ); // Console Functions. //-------------------------------------------------------------------------------- -DefineConsoleFunction( beginSampling, void, (const char * location, const char * backend), ("CSV"), "(location, [backend]) -" +DefineEngineFunction( beginSampling, void, (const char * location, const char * backend), ("CSV"), "(location, [backend]) -" "@brief Takes a string informing the backend where to store " "sample data and optionally a name of the specific logging " "backend to use. The default is the CSV backend. In most " @@ -408,14 +408,14 @@ DefineConsoleFunction( beginSampling, void, (const char * location, const char * beginSampling( location, backend ); } -DefineConsoleFunction( stopSampling, void, (), , "()" +DefineEngineFunction( stopSampling, void, (), , "()" "@brief Stops the rendering sampler\n\n" "@ingroup Rendering\n") { stopSampling(); } -DefineConsoleFunction( enableSamples, void, (const char * pattern, bool state), (true), "(pattern, [state]) -" +DefineEngineFunction( enableSamples, void, (const char * pattern, bool state), (true), "(pattern, [state]) -" "@brief Enable sampling for all keys that match the given name " "pattern. Slashes are treated as separators.\n\n" "@ingroup Rendering") From 3c99ef73a9d25cea43592cf245e123436caf8ea7 Mon Sep 17 00:00:00 2001 From: Lukas Joergensen Date: Tue, 17 Apr 2018 21:01:50 +0200 Subject: [PATCH 2/7] Eliminate DefineConsoleMethod --- Engine/source/T3D/aiClient.cpp | 24 +++--- Engine/source/T3D/aiConnection.cpp | 14 ++-- Engine/source/T3D/aiPlayer.cpp | 2 +- .../camera/cameraComponent_ScriptBinding.h | 10 +-- .../collisionComponent_ScriptBinding.h | 14 ++-- Engine/source/T3D/components/component.cpp | 4 +- Engine/source/T3D/entity.cpp | 20 ++--- Engine/source/T3D/lightBase.cpp | 4 +- Engine/source/T3D/missionMarker.cpp | 2 +- Engine/source/T3D/physics/physicsDebris.cpp | 2 +- Engine/source/T3D/staticShape.cpp | 4 +- .../source/assets/assetQuery_ScriptBinding.h | 4 +- Engine/source/console/SimXMLDocument.cpp | 4 +- Engine/source/console/consoleLogger.cpp | 4 +- Engine/source/console/engineAPI.h | 2 +- Engine/source/console/fieldBrushObject.cpp | 8 +- Engine/source/console/persistenceManager.cpp | 26 +++---- Engine/source/console/simDatablock.cpp | 2 +- Engine/source/console/simObject.cpp | 58 +++++++------- Engine/source/console/simPersistSet.cpp | 2 +- Engine/source/console/simSet.cpp | 6 +- Engine/source/core/fileObject.cpp | 2 +- .../editors/guiMeshRoadEditorCtrl.cpp | 30 +++---- .../editors/guiRiverEditorCtrl.cpp | 28 +++---- .../environment/editors/guiRoadEditorCtrl.cpp | 22 +++--- Engine/source/environment/skyBox.cpp | 2 +- Engine/source/environment/sun.cpp | 4 +- .../forest/editor/forestBrushElement.cpp | 2 +- .../source/forest/editor/forestBrushTool.cpp | 2 +- .../source/forest/editor/forestEditorCtrl.cpp | 12 +-- .../forest/editor/forestSelectionTool.cpp | 12 +-- Engine/source/forest/forest.cpp | 8 +- .../source/gfx/video/theoraTextureObject.cpp | 6 +- .../gui/buttons/guiToolboxButtonCtrl.cpp | 6 +- Engine/source/gui/controls/guiBitmapCtrl.cpp | 2 +- Engine/source/gui/controls/guiColorPicker.cpp | 6 +- .../source/gui/controls/guiFileTreeCtrl.cpp | 6 +- .../source/gui/controls/guiGradientCtrl.cpp | 4 +- .../source/gui/controls/guiMaterialCtrl.cpp | 2 +- Engine/source/gui/controls/guiPopUpCtrl.cpp | 38 ++++----- Engine/source/gui/controls/guiPopUpCtrlEx.cpp | 18 ++--- Engine/source/gui/core/guiCanvas.cpp | 24 +++--- Engine/source/gui/core/guiControl.cpp | 2 +- Engine/source/gui/editor/guiDebugger.cpp | 16 ++-- Engine/source/gui/editor/guiEditCtrl.cpp | 56 ++++++------- Engine/source/gui/editor/guiFilterCtrl.cpp | 4 +- Engine/source/gui/editor/guiMenuBar.cpp | 12 +-- .../gui/editor/guiParticleGraphCtrl.cpp | 60 +++++++------- .../gui/editor/inspector/componentGroup.cpp | 2 +- .../gui/editor/inspector/dynamicField.cpp | 2 +- .../gui/editor/inspector/dynamicGroup.cpp | 6 +- Engine/source/gui/editor/inspector/field.cpp | 18 ++--- .../gui/editor/inspector/variableGroup.cpp | 4 +- .../editor/inspector/variableInspector.cpp | 16 ++-- Engine/source/gui/editor/popupMenu.cpp | 20 ++--- .../gui/game/guiIdleCamFadeBitmapCtrl.cpp | 4 +- Engine/source/gui/shiny/guiTickCtrl.cpp | 2 +- Engine/source/gui/utility/messageVector.cpp | 2 +- Engine/source/gui/worldEditor/creator.cpp | 18 ++--- Engine/source/gui/worldEditor/editor.cpp | 10 +-- .../worldEditor/guiConvexShapeEditorCtrl.cpp | 16 ++-- .../gui/worldEditor/guiDecalEditorCtrl.cpp | 22 +++--- .../gui/worldEditor/guiMissionAreaEditor.cpp | 4 +- .../gui/worldEditor/guiTerrPreviewCtrl.cpp | 14 ++-- .../source/gui/worldEditor/terrainActions.cpp | 2 +- .../source/gui/worldEditor/terrainEditor.cpp | 78 +++++++++---------- Engine/source/gui/worldEditor/worldEditor.cpp | 2 +- Engine/source/i18n/lang.cpp | 14 ++-- .../source/materials/materialDefinition.cpp | 14 ++-- Engine/source/math/util/tResponseCurve.cpp | 6 +- Engine/source/scene/sceneObject.cpp | 2 +- Engine/source/sfx/sfxSource.cpp | 2 +- Engine/source/terrain/terrExport.cpp | 4 +- Engine/source/util/messaging/eventManager.cpp | 18 ++--- Engine/source/util/messaging/message.cpp | 6 +- Engine/source/util/settings.cpp | 22 +++--- Engine/source/util/undo.cpp | 34 ++++---- 77 files changed, 483 insertions(+), 483 deletions(-) diff --git a/Engine/source/T3D/aiClient.cpp b/Engine/source/T3D/aiClient.cpp index 1f4be793b..8801e3460 100644 --- a/Engine/source/T3D/aiClient.cpp +++ b/Engine/source/T3D/aiClient.cpp @@ -418,7 +418,7 @@ void AIClient::onAdd( const char *nameSpace ) { /** * Sets the move speed for an AI object */ -DefineConsoleMethod( AIClient, setMoveSpeed, void, (F32 speed), , "ai.setMoveSpeed( float );" ) +DefineEngineMethod( AIClient, setMoveSpeed, void, (F32 speed), , "ai.setMoveSpeed( float );" ) { AIClient *ai = static_cast( object ); ai->setMoveSpeed( speed ); @@ -427,7 +427,7 @@ DefineConsoleMethod( AIClient, setMoveSpeed, void, (F32 speed), , "ai.setMoveSpe /** * Stops all AI movement, halt! */ -DefineConsoleMethod( AIClient, stop, void, (),, "ai.stop();" ) +DefineEngineMethod( AIClient, stop, void, (),, "ai.stop();" ) { AIClient *ai = static_cast( object ); ai->setMoveMode( AIClient::ModeStop ); @@ -436,7 +436,7 @@ DefineConsoleMethod( AIClient, stop, void, (),, "ai.stop();" ) /** * Tells the AI to aim at the location provided */ -DefineConsoleMethod( AIClient, setAimLocation, void, (Point3F v), , "ai.setAimLocation( x y z );" ) +DefineEngineMethod( AIClient, setAimLocation, void, (Point3F v), , "ai.setAimLocation( x y z );" ) { AIClient *ai = static_cast( object ); @@ -446,7 +446,7 @@ DefineConsoleMethod( AIClient, setAimLocation, void, (Point3F v), , "ai.setAimLo /** * Tells the AI to move to the location provided */ -DefineConsoleMethod( AIClient, setMoveDestination, void, (Point3F v), , "ai.setMoveDestination( x y z );" ) +DefineEngineMethod( AIClient, setMoveDestination, void, (Point3F v), , "ai.setMoveDestination( x y z );" ) { AIClient *ai = static_cast( object ); @@ -456,7 +456,7 @@ DefineConsoleMethod( AIClient, setMoveDestination, void, (Point3F v), , "ai.setM /** * Returns the point the AI is aiming at */ -DefineConsoleMethod( AIClient, getAimLocation, Point3F, (),, "ai.getAimLocation();" ) +DefineEngineMethod( AIClient, getAimLocation, Point3F, (),, "ai.getAimLocation();" ) { AIClient *ai = static_cast( object ); return ai->getAimLocation(); @@ -465,7 +465,7 @@ DefineConsoleMethod( AIClient, getAimLocation, Point3F, (),, "ai.getAimLocation( /** * Returns the point the AI is set to move to */ -DefineConsoleMethod( AIClient, getMoveDestination, Point3F, (),, "ai.getMoveDestination();" ) +DefineEngineMethod( AIClient, getMoveDestination, Point3F, (),, "ai.getMoveDestination();" ) { AIClient *ai = static_cast( object ); return ai->getMoveDestination(); @@ -474,7 +474,7 @@ DefineConsoleMethod( AIClient, getMoveDestination, Point3F, (),, "ai.getMoveDest /** * Sets the bots target object */ -DefineConsoleMethod( AIClient, setTargetObject, void, (const char * objName), , "ai.setTargetObject( obj );" ) +DefineEngineMethod( AIClient, setTargetObject, void, (const char * objName), , "ai.setTargetObject( obj );" ) { AIClient *ai = static_cast( object ); @@ -489,7 +489,7 @@ DefineConsoleMethod( AIClient, setTargetObject, void, (const char * objName), , /** * Gets the object the AI is targeting */ -DefineConsoleMethod( AIClient, getTargetObject, S32, (),, "ai.getTargetObject();" ) +DefineEngineMethod( AIClient, getTargetObject, S32, (),, "ai.getTargetObject();" ) { AIClient *ai = static_cast( object ); @@ -499,7 +499,7 @@ DefineConsoleMethod( AIClient, getTargetObject, S32, (),, "ai.getTargetObject(); /** * Tells the bot the mission is cycling */ -DefineConsoleMethod( AIClient, missionCycleCleanup, void, (),, "ai.missionCycleCleanup();" ) +DefineEngineMethod( AIClient, missionCycleCleanup, void, (),, "ai.missionCycleCleanup();" ) { AIClient *ai = static_cast( object ); ai->missionCycleCleanup(); @@ -508,7 +508,7 @@ DefineConsoleMethod( AIClient, missionCycleCleanup, void, (),, "ai.missionCycleC /** * Sets the AI to run mode */ -DefineConsoleMethod( AIClient, move, void, (),, "ai.move();" ) +DefineEngineMethod( AIClient, move, void, (),, "ai.move();" ) { AIClient *ai = static_cast( object ); ai->setMoveMode( AIClient::ModeMove ); @@ -517,7 +517,7 @@ DefineConsoleMethod( AIClient, move, void, (),, "ai.move();" ) /** * Gets the AI's location in the world */ -DefineConsoleMethod( AIClient, getLocation, Point3F, (),, "ai.getLocation();" ) +DefineEngineMethod( AIClient, getLocation, Point3F, (),, "ai.getLocation();" ) { AIClient *ai = static_cast( object ); return ai->getLocation(); @@ -559,7 +559,7 @@ DefineEngineFunction( aiAddPlayer, S32, (const char * name, const char * ns), (" /** * Tells the AI to move forward 100 units...TEST FXN */ -DefineConsoleMethod( AIClient, moveForward, void, (),, "ai.moveForward();" ) +DefineEngineMethod( AIClient, moveForward, void, (),, "ai.moveForward();" ) { AIClient *ai = static_cast( object ); diff --git a/Engine/source/T3D/aiConnection.cpp b/Engine/source/T3D/aiConnection.cpp index af60b1d3c..21564d5eb 100644 --- a/Engine/source/T3D/aiConnection.cpp +++ b/Engine/source/T3D/aiConnection.cpp @@ -160,7 +160,7 @@ ConsoleFunction(aiConnect, S32 , 2, 20, "(...)" //----------------------------------------------------------------------------- -DefineConsoleMethod(AIConnection, setMove, void, (const char * field, F32 value), ,"(string field, float value)" +DefineEngineMethod(AIConnection, setMove, void, (const char * field, F32 value), ,"(string field, float value)" "Set a field on the current move.\n\n" "@param field One of {'x','y','z','yaw','pitch','roll'}\n" "@param value Value to set field to.") @@ -190,7 +190,7 @@ DefineConsoleMethod(AIConnection, setMove, void, (const char * field, F32 value) object->setMove(&move); } -DefineConsoleMethod(AIConnection,getMove,F32, (const char * field), ,"(string field)" +DefineEngineMethod(AIConnection,getMove,F32, (const char * field), ,"(string field)" "Get the given field of a move.\n\n" "@param field One of {'x','y','z','yaw','pitch','roll'}\n" "@returns The requested field on the current move.") @@ -212,7 +212,7 @@ DefineConsoleMethod(AIConnection,getMove,F32, (const char * field), ,"(string fi } -DefineConsoleMethod(AIConnection,setFreeLook,void,(bool isFreeLook), ,"(bool isFreeLook)" +DefineEngineMethod(AIConnection,setFreeLook,void,(bool isFreeLook), ,"(bool isFreeLook)" "Enable/disable freelook on the current move.") { Move move = object->getMove(); @@ -220,7 +220,7 @@ DefineConsoleMethod(AIConnection,setFreeLook,void,(bool isFreeLook), ,"(bool isF object->setMove(&move); } -DefineConsoleMethod(AIConnection, getFreeLook, bool, (), ,"getFreeLook()" +DefineEngineMethod(AIConnection, getFreeLook, bool, (), ,"getFreeLook()" "Is freelook on for the current move?") { return object->getMove().freeLook; @@ -229,7 +229,7 @@ DefineConsoleMethod(AIConnection, getFreeLook, bool, (), ,"getFreeLook()" //----------------------------------------------------------------------------- -DefineConsoleMethod(AIConnection,setTrigger,void, (S32 idx, bool set), ,"(int trigger, bool set)" +DefineEngineMethod(AIConnection,setTrigger,void, (S32 idx, bool set), ,"(int trigger, bool set)" "Set a trigger.") { if (idx >= 0 && idx < MaxTriggerKeys) @@ -240,7 +240,7 @@ DefineConsoleMethod(AIConnection,setTrigger,void, (S32 idx, bool set), ,"(int tr } } -DefineConsoleMethod(AIConnection,getTrigger,bool, (S32 idx), ,"(int trigger)" +DefineEngineMethod(AIConnection,getTrigger,bool, (S32 idx), ,"(int trigger)" "Is the given trigger set?") { if (idx >= 0 && idx < MaxTriggerKeys) @@ -251,7 +251,7 @@ DefineConsoleMethod(AIConnection,getTrigger,bool, (S32 idx), ,"(int trigger)" //----------------------------------------------------------------------------- -DefineConsoleMethod(AIConnection,getAddress,const char*,(), ,"") +DefineEngineMethod(AIConnection,getAddress,const char*,(), ,"") { // Override the netConnection method to return to indicate // this is an ai connection. diff --git a/Engine/source/T3D/aiPlayer.cpp b/Engine/source/T3D/aiPlayer.cpp index 6e1c39328..565bb742c 100644 --- a/Engine/source/T3D/aiPlayer.cpp +++ b/Engine/source/T3D/aiPlayer.cpp @@ -1251,7 +1251,7 @@ ConsoleDocFragment _setAimObject( "void setAimObject(GameBase targetObject, Point3F offset);" ); -DefineConsoleMethod( AIPlayer, setAimObject, void, ( const char * objName, Point3F offset ), (Point3F::Zero), "( GameBase obj, [Point3F offset] )" +DefineEngineMethod( AIPlayer, setAimObject, void, ( const char * objName, Point3F offset ), (Point3F::Zero), "( GameBase obj, [Point3F offset] )" "Sets the bot's target object. Optionally set an offset from target location." "@hide") { diff --git a/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h b/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h index 2c3f1dbef..d3b7f9883 100644 --- a/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h +++ b/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h @@ -30,7 +30,7 @@ ConsoleMethod(CameraComponent, getMode, const char*, 2, 2, "() - We get the firs return "fly"; } -DefineConsoleMethod(CameraComponent, getForwardVector, VectorF, (), , +DefineEngineMethod(CameraComponent, getForwardVector, VectorF, (), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -44,7 +44,7 @@ DefineConsoleMethod(CameraComponent, getForwardVector, VectorF, (), , return returnVec; } -DefineConsoleMethod(CameraComponent, getRightVector, VectorF, (), , +DefineEngineMethod(CameraComponent, getRightVector, VectorF, (), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -58,7 +58,7 @@ DefineConsoleMethod(CameraComponent, getRightVector, VectorF, (), , return returnVec; } -DefineConsoleMethod(CameraComponent, getUpVector, VectorF, (), , +DefineEngineMethod(CameraComponent, getUpVector, VectorF, (), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -72,14 +72,14 @@ DefineConsoleMethod(CameraComponent, getUpVector, VectorF, (), , return returnVec; } -DefineConsoleMethod(CameraComponent, setForwardVector, void, (VectorF newForward), (VectorF(0, 0, 0)), +DefineEngineMethod(CameraComponent, setForwardVector, void, (VectorF newForward), (VectorF(0, 0, 0)), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { object->setForwardVector(newForward); } -DefineConsoleMethod(CameraComponent, getWorldPosition, Point3F, (), , +DefineEngineMethod(CameraComponent, getWorldPosition, Point3F, (), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { diff --git a/Engine/source/T3D/components/collision/collisionComponent_ScriptBinding.h b/Engine/source/T3D/components/collision/collisionComponent_ScriptBinding.h index 3b8e83d11..30c41da2b 100644 --- a/Engine/source/T3D/components/collision/collisionComponent_ScriptBinding.h +++ b/Engine/source/T3D/components/collision/collisionComponent_ScriptBinding.h @@ -24,21 +24,21 @@ #include "T3D/components/collision/collisionComponent.h" #include "materials/baseMatInstance.h" -DefineConsoleMethod(CollisionComponent, getNumberOfContacts, S32, (), , +DefineEngineMethod(CollisionComponent, getNumberOfContacts, S32, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { return object->getCollisionList()->getCount(); } -DefineConsoleMethod(CollisionComponent, getBestContact, S32, (), , +DefineEngineMethod(CollisionComponent, getBestContact, S32, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { return 0; } -DefineConsoleMethod(CollisionComponent, getContactNormal, Point3F, (), , +DefineEngineMethod(CollisionComponent, getContactNormal, Point3F, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { @@ -53,7 +53,7 @@ DefineConsoleMethod(CollisionComponent, getContactNormal, Point3F, (), , return Point3F::Zero; } -DefineConsoleMethod(CollisionComponent, getContactMaterial, S32, (), , +DefineEngineMethod(CollisionComponent, getContactMaterial, S32, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { @@ -69,7 +69,7 @@ DefineConsoleMethod(CollisionComponent, getContactMaterial, S32, (), , return 0; } -DefineConsoleMethod(CollisionComponent, getContactObject, S32, (), , +DefineEngineMethod(CollisionComponent, getContactObject, S32, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { @@ -81,7 +81,7 @@ DefineConsoleMethod(CollisionComponent, getContactObject, S32, (), , return 0; } -DefineConsoleMethod(CollisionComponent, getContactPoint, Point3F, (), , +DefineEngineMethod(CollisionComponent, getContactPoint, Point3F, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { @@ -96,7 +96,7 @@ DefineConsoleMethod(CollisionComponent, getContactPoint, Point3F, (), , return Point3F::Zero; } -DefineConsoleMethod(CollisionComponent, getContactTime, S32, (), , +DefineEngineMethod(CollisionComponent, getContactTime, S32, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { diff --git a/Engine/source/T3D/components/component.cpp b/Engine/source/T3D/components/component.cpp index c7f9dcc2c..83fc015f1 100644 --- a/Engine/source/T3D/components/component.cpp +++ b/Engine/source/T3D/components/component.cpp @@ -633,7 +633,7 @@ ConsoleMethod(Component, endGroup, void, 2, 2, "()\n" object->endFieldGroup(); } -DefineConsoleMethod(Component, addComponentField, void, (String fieldName, String fieldDesc, String fieldType, String defValue, String userData, bool hidden), +DefineEngineMethod(Component, addComponentField, void, (String fieldName, String fieldDesc, String fieldType, String defValue, String userData, bool hidden), ("", "", "", "", "", false), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") @@ -678,7 +678,7 @@ ConsoleMethod(Component, setComponentield, const char *, 3, 3, "(int index) - Ge return buf; } -DefineConsoleMethod(Component, getComponentFieldType, const char *, (String fieldName), , +DefineEngineMethod(Component, getComponentFieldType, const char *, (String fieldName), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { diff --git a/Engine/source/T3D/entity.cpp b/Engine/source/T3D/entity.cpp index fe0303652..587eb145b 100644 --- a/Engine/source/T3D/entity.cpp +++ b/Engine/source/T3D/entity.cpp @@ -1800,7 +1800,7 @@ DefineEngineMethod(Entity, setBox, void, } -/*DefineConsoleMethod(Entity, callOnComponents, void, (const char* functionName), , +/*DefineEngineMethod(Entity, callOnComponents, void, (const char* functionName), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -1875,7 +1875,7 @@ ConsoleMethod(Entity, getComponentByIndex, S32, 3, 3, "(int index) - Gets a part return (comp != NULL) ? comp->getId() : 0; } -DefineConsoleMethod(Entity, getComponent, S32, (String componentName), (""), +DefineEngineMethod(Entity, getComponent, S32, (String componentName), (""), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -1916,7 +1916,7 @@ ConsoleMethod(Entity, getComponentCount, S32, 2, 2, "() - Get the count of behav return object->getComponentCount(); } -DefineConsoleMethod(Entity, setComponentDirty, void, (S32 componentID, bool forceUpdate), (0, false), +DefineEngineMethod(Entity, setComponentDirty, void, (S32 componentID, bool forceUpdate), (0, false), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -1925,7 +1925,7 @@ DefineConsoleMethod(Entity, setComponentDirty, void, (S32 componentID, bool forc object->setComponentDirty(comp, forceUpdate);*/ } -DefineConsoleMethod(Entity, getMoveVector, VectorF, (),, +DefineEngineMethod(Entity, getMoveVector, VectorF, (),, "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -1939,7 +1939,7 @@ DefineConsoleMethod(Entity, getMoveVector, VectorF, (),, return VectorF::Zero; } -DefineConsoleMethod(Entity, getMoveRotation, VectorF, (), , +DefineEngineMethod(Entity, getMoveRotation, VectorF, (), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -1953,7 +1953,7 @@ DefineConsoleMethod(Entity, getMoveRotation, VectorF, (), , return VectorF::Zero; } -DefineConsoleMethod(Entity, getMoveTrigger, bool, (S32 triggerNum), (0), +DefineEngineMethod(Entity, getMoveTrigger, bool, (S32 triggerNum), (0), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -1974,28 +1974,28 @@ DefineEngineMethod(Entity, getForwardVector, VectorF, (), , return forVec; } -DefineConsoleMethod(Entity, setForwardVector, void, (VectorF newForward), (VectorF(0,0,0)), +DefineEngineMethod(Entity, setForwardVector, void, (VectorF newForward), (VectorF(0,0,0)), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { object->setForwardVector(newForward); } -DefineConsoleMethod(Entity, lookAt, void, (Point3F lookPosition),, +DefineEngineMethod(Entity, lookAt, void, (Point3F lookPosition),, "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { //object->setForwardVector(newForward); } -DefineConsoleMethod(Entity, rotateTo, void, (Point3F lookPosition, F32 degreePerSecond), (1.0), +DefineEngineMethod(Entity, rotateTo, void, (Point3F lookPosition, F32 degreePerSecond), (1.0), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { //object->setForwardVector(newForward); } -DefineConsoleMethod(Entity, notify, void, (String signalFunction, String argA, String argB, String argC, String argD, String argE), +DefineEngineMethod(Entity, notify, void, (String signalFunction, String argA, String argB, String argC, String argD, String argE), ("", "", "", "", "", ""), "Triggers a signal call to all components for a certain function.") { diff --git a/Engine/source/T3D/lightBase.cpp b/Engine/source/T3D/lightBase.cpp index 6cc739ed3..007f2ca32 100644 --- a/Engine/source/T3D/lightBase.cpp +++ b/Engine/source/T3D/lightBase.cpp @@ -440,7 +440,7 @@ static ConsoleDocFragment _lbplayAnimation2( "void playAnimation(LightAnimData anim);" ); -DefineConsoleMethod( LightBase, playAnimation, void, (const char * anim), (""), "( [LightAnimData anim] )\t" +DefineEngineMethod( LightBase, playAnimation, void, (const char * anim), (""), "( [LightAnimData anim] )\t" "Plays a light animation on the light. If no LightAnimData is passed the " "existing one is played." "@hide") @@ -484,7 +484,7 @@ void LightBase::playAnimation( LightAnimData *animData ) } } -DefineConsoleMethod( LightBase, pauseAnimation, void, (), , "Stops the light animation." ) +DefineEngineMethod( LightBase, pauseAnimation, void, (), , "Stops the light animation." ) { object->pauseAnimation(); } diff --git a/Engine/source/T3D/missionMarker.cpp b/Engine/source/T3D/missionMarker.cpp index 1480e2f1f..ff4fc3c0d 100644 --- a/Engine/source/T3D/missionMarker.cpp +++ b/Engine/source/T3D/missionMarker.cpp @@ -494,7 +494,7 @@ ConsoleDocFragment _SpawnSpherespawnObject1( "bool spawnObject(string additionalProps);" ); -DefineConsoleMethod(SpawnSphere, spawnObject, S32, (String additionalProps), , +DefineEngineMethod(SpawnSphere, spawnObject, S32, (String additionalProps), , "([string additionalProps]) Spawns the object based on the SpawnSphere's " "class, datablock, properties, and script settings. Allows you to pass in " "extra properties." diff --git a/Engine/source/T3D/physics/physicsDebris.cpp b/Engine/source/T3D/physics/physicsDebris.cpp index a2e2026b3..90a225ff4 100644 --- a/Engine/source/T3D/physics/physicsDebris.cpp +++ b/Engine/source/T3D/physics/physicsDebris.cpp @@ -238,7 +238,7 @@ void PhysicsDebrisData::unpackData(BitStream* stream) shapeName = stream->readSTString(); } -DefineConsoleMethod( PhysicsDebrisData, preload, void, (), , +DefineEngineMethod( PhysicsDebrisData, preload, void, (), , "@brief Loads some information to have readily available at simulation time.\n\n" "Forces generation of shaders, materials, and other data used by the %PhysicsDebris object. " "This function should be used while a level is loading in order to shorten " diff --git a/Engine/source/T3D/staticShape.cpp b/Engine/source/T3D/staticShape.cpp index 874e31059..9bc7369e1 100644 --- a/Engine/source/T3D/staticShape.cpp +++ b/Engine/source/T3D/staticShape.cpp @@ -314,7 +314,7 @@ void StaticShape::unpackUpdate(NetConnection *connection, BitStream *bstream) // This appears to be legacy T2 stuff // Marked internal, as this is flagged to be deleted // [8/1/2010 mperry] -DefineConsoleMethod( StaticShape, setPoweredState, void, (bool isPowered), , "(bool isPowered)" +DefineEngineMethod( StaticShape, setPoweredState, void, (bool isPowered), , "(bool isPowered)" "@internal") { if(!object->isServerObject()) @@ -322,7 +322,7 @@ DefineConsoleMethod( StaticShape, setPoweredState, void, (bool isPowered), , "(b object->setPowered(isPowered); } -DefineConsoleMethod( StaticShape, getPoweredState, bool, (), , "@internal") +DefineEngineMethod( StaticShape, getPoweredState, bool, (), , "@internal") { if(!object->isServerObject()) return(false); diff --git a/Engine/source/assets/assetQuery_ScriptBinding.h b/Engine/source/assets/assetQuery_ScriptBinding.h index 1656d2eb3..71cc58f1a 100644 --- a/Engine/source/assets/assetQuery_ScriptBinding.h +++ b/Engine/source/assets/assetQuery_ScriptBinding.h @@ -59,7 +59,7 @@ DefineEngineMethod(AssetQuery, set, bool, (S32 queryId), , //----------------------------------------------------------------------------- -DefineConsoleMethod(AssetQuery, getCount, S32, (), , +DefineEngineMethod(AssetQuery, getCount, S32, (), , "Gets the count of asset Id results.\n" "@return (int)The count of asset Id results.\n") { @@ -68,7 +68,7 @@ DefineConsoleMethod(AssetQuery, getCount, S32, (), , //----------------------------------------------------------------------------- -DefineConsoleMethod(AssetQuery, getAsset, const char*, (S32 resultIndex), (-1), +DefineEngineMethod(AssetQuery, getAsset, const char*, (S32 resultIndex), (-1), "Gets the asset Id at the specified query result index.\n" "@param resultIndex The query result index to use.\n" "@return (assetId)The asset Id at the specified index or NULL if not valid.\n") diff --git a/Engine/source/console/SimXMLDocument.cpp b/Engine/source/console/SimXMLDocument.cpp index 156533503..df45888d1 100644 --- a/Engine/source/console/SimXMLDocument.cpp +++ b/Engine/source/console/SimXMLDocument.cpp @@ -571,7 +571,7 @@ DefineEngineMethod( SimXMLDocument, attribute, const char*, ( const char* attrib } // These two methods don't make a lot of sense the way TS works. Leaving them in for backwards-compatibility. -DefineConsoleMethod( SimXMLDocument, attributeF32, F32, (const char * attributeName), , "(string attributeName)" +DefineEngineMethod( SimXMLDocument, attributeF32, F32, (const char * attributeName), , "(string attributeName)" "@brief Get float attribute from the current Element on the stack.\n\n" "@param attributeName Name of attribute to retrieve.\n" "@return The value of the given attribute in the form of a float.\n" @@ -580,7 +580,7 @@ DefineConsoleMethod( SimXMLDocument, attributeF32, F32, (const char * attributeN return dAtof( object->attribute( attributeName ) ); } -DefineConsoleMethod(SimXMLDocument, attributeS32, S32, (const char * attributeName), , "(string attributeName)" +DefineEngineMethod(SimXMLDocument, attributeS32, S32, (const char * attributeName), , "(string attributeName)" "@brief Get int attribute from the current Element on the stack.\n\n" "@param attributeName Name of attribute to retrieve.\n" "@return The value of the given attribute in the form of an integer.\n" diff --git a/Engine/source/console/consoleLogger.cpp b/Engine/source/console/consoleLogger.cpp index 84347a332..fc2095eae 100644 --- a/Engine/source/console/consoleLogger.cpp +++ b/Engine/source/console/consoleLogger.cpp @@ -225,7 +225,7 @@ void ConsoleLogger::log( const char *consoleLine ) //----------------------------------------------------------------------------- -DefineConsoleMethod( ConsoleLogger, attach, bool, (), , "() Attaches the logger to the console and begins writing to file" +DefineEngineMethod( ConsoleLogger, attach, bool, (), , "() Attaches the logger to the console and begins writing to file" "@tsexample\n" "// Create the logger\n" "// Will automatically start writing to testLogging.txt with normal priority\n" @@ -247,7 +247,7 @@ DefineConsoleMethod( ConsoleLogger, attach, bool, (), , "() Attaches the logger //----------------------------------------------------------------------------- -DefineConsoleMethod( ConsoleLogger, detach, bool, (), , "() Detaches the logger from the console and stops writing to file" +DefineEngineMethod( ConsoleLogger, detach, bool, (), , "() Detaches the logger from the console and stops writing to file" "@tsexample\n" "// Create the logger\n" "// Will automatically start writing to testLogging.txt with normal priority\n" diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index 2eef409b6..ca7ca8a1d 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -861,7 +861,7 @@ public: // these macros can be removed and all definitions that make use of them can be removed // as well. -#define DefineConsoleMethod( className, name, returnType, args, defaultArgs, usage ) \ +#define DefineEngineMethod( className, name, returnType, args, defaultArgs, usage ) \ struct _ ## className ## name ## frame \ { \ typedef className ObjectType; \ diff --git a/Engine/source/console/fieldBrushObject.cpp b/Engine/source/console/fieldBrushObject.cpp index 0caf00e48..6ec9ace0d 100644 --- a/Engine/source/console/fieldBrushObject.cpp +++ b/Engine/source/console/fieldBrushObject.cpp @@ -123,7 +123,7 @@ static char* suppressSpaces(const char* in_pname) //----------------------------------------------------------------------------- // Query Groups. //----------------------------------------------------------------------------- -DefineConsoleMethod(FieldBrushObject, queryGroups, const char*, (const char* simObjName), , "(simObject) Query available static-field groups for selected object./\n" +DefineEngineMethod(FieldBrushObject, queryGroups, const char*, (const char* simObjName), , "(simObject) Query available static-field groups for selected object./\n" "@param simObject Object to query static-field groups on.\n" "@return Space-seperated static-field group list.") { @@ -191,7 +191,7 @@ DefineConsoleMethod(FieldBrushObject, queryGroups, const char*, (const char* sim //----------------------------------------------------------------------------- // Query Fields. //----------------------------------------------------------------------------- -DefineConsoleMethod(FieldBrushObject, queryFields, const char*, (const char* simObjName, const char* groupList), (""), "(simObject, [groupList]) Query available static-fields for selected object./\n" +DefineEngineMethod(FieldBrushObject, queryFields, const char*, (const char* simObjName, const char* groupList), (""), "(simObject, [groupList]) Query available static-fields for selected object./\n" "@param simObject Object to query static-fields on.\n" "@param groupList groups to filter static-fields against.\n" "@return Space-seperated static-field list.") @@ -366,7 +366,7 @@ DefineConsoleMethod(FieldBrushObject, queryFields, const char*, (const char* sim //----------------------------------------------------------------------------- // Copy Fields. //----------------------------------------------------------------------------- -DefineConsoleMethod(FieldBrushObject, copyFields, void, (const char* simObjName, const char* pFieldList), (""), "(simObject, [fieldList]) Copy selected static-fields for selected object./\n" +DefineEngineMethod(FieldBrushObject, copyFields, void, (const char* simObjName, const char* pFieldList), (""), "(simObject, [fieldList]) Copy selected static-fields for selected object./\n" "@param simObject Object to copy static-fields from.\n" "@param fieldList fields to filter static-fields against.\n" "@return No return value.") @@ -500,7 +500,7 @@ void FieldBrushObject::copyFields( SimObject* pSimObject, const char* fieldList //----------------------------------------------------------------------------- // Paste Fields. //----------------------------------------------------------------------------- -DefineConsoleMethod(FieldBrushObject, pasteFields, void, (const char* simObjName), , "(simObject) Paste copied static-fields to selected object./\n" +DefineEngineMethod(FieldBrushObject, pasteFields, void, (const char* simObjName), , "(simObject) Paste copied static-fields to selected object./\n" "@param simObject Object to paste static-fields to.\n" "@return No return value.") { diff --git a/Engine/source/console/persistenceManager.cpp b/Engine/source/console/persistenceManager.cpp index 56812cd4b..75f209237 100644 --- a/Engine/source/console/persistenceManager.cpp +++ b/Engine/source/console/persistenceManager.cpp @@ -2190,14 +2190,14 @@ void PersistenceManager::deleteObjectsFromFile(const char* fileName) clearAll(); } -DefineConsoleMethod( PersistenceManager, deleteObjectsFromFile, void, ( const char * fileName ), , "( fileName )" +DefineEngineMethod( PersistenceManager, deleteObjectsFromFile, void, ( const char * fileName ), , "( fileName )" "Delete all of the objects that are created from the given file." ) { // Delete Objects. object->deleteObjectsFromFile( fileName ); } -DefineConsoleMethod( PersistenceManager, setDirty, void, ( const char * objName, const char * fileName ), (""), "(SimObject object, [filename])" +DefineEngineMethod( PersistenceManager, setDirty, void, ( const char * objName, const char * fileName ), (""), "(SimObject object, [filename])" "Mark an existing SimObject as dirty (will be written out when saveDirty() is called).") { SimObject *dirtyObject = NULL; @@ -2226,7 +2226,7 @@ DefineConsoleMethod( PersistenceManager, setDirty, void, ( const char * objName } } -DefineConsoleMethod( PersistenceManager, removeDirty, void, ( const char * objName ), , "(SimObject object)" +DefineEngineMethod( PersistenceManager, removeDirty, void, ( const char * objName ), , "(SimObject object)" "Remove a SimObject from the dirty list.") { SimObject *dirtyObject = NULL; @@ -2243,7 +2243,7 @@ DefineConsoleMethod( PersistenceManager, removeDirty, void, ( const char * objNa object->removeDirty(dirtyObject); } -DefineConsoleMethod( PersistenceManager, isDirty, bool, ( const char * objName ), , "(SimObject object)" +DefineEngineMethod( PersistenceManager, isDirty, bool, ( const char * objName ), , "(SimObject object)" "Returns true if the SimObject is on the dirty list.") { SimObject *dirtyObject = NULL; @@ -2262,19 +2262,19 @@ DefineConsoleMethod( PersistenceManager, isDirty, bool, ( const char * objName ) return false; } -DefineConsoleMethod( PersistenceManager, hasDirty, bool, (), , "()" +DefineEngineMethod( PersistenceManager, hasDirty, bool, (), , "()" "Returns true if the manager has dirty objects to save." ) { return object->hasDirty(); } -DefineConsoleMethod( PersistenceManager, getDirtyObjectCount, S32, (), , "()" +DefineEngineMethod( PersistenceManager, getDirtyObjectCount, S32, (), , "()" "Returns the number of dirty objects." ) { return object->getDirtyList().size(); } -DefineConsoleMethod( PersistenceManager, getDirtyObject, S32, (S32 index), , "( index )" +DefineEngineMethod( PersistenceManager, getDirtyObject, S32, (S32 index), , "( index )" "Returns the ith dirty object." ) { if ( index < 0 || index >= object->getDirtyList().size() ) @@ -2290,7 +2290,7 @@ DefineConsoleMethod( PersistenceManager, getDirtyObject, S32, (S32 index), , "( return ( dirtyObject.getObject() ) ? dirtyObject.getObject()->getId() : 0; } -DefineConsoleMethod( PersistenceManager, listDirty, void, (), , "()" +DefineEngineMethod( PersistenceManager, listDirty, void, (), , "()" "Prints the dirty list to the console.") { const PersistenceManager::DirtyList dirtyList = object->getDirtyList(); @@ -2318,13 +2318,13 @@ DefineConsoleMethod( PersistenceManager, listDirty, void, (), , "()" } } -DefineConsoleMethod( PersistenceManager, saveDirty, bool, (), , "()" +DefineEngineMethod( PersistenceManager, saveDirty, bool, (), , "()" "Saves all of the SimObject's on the dirty list to their respective files.") { return object->saveDirty(); } -DefineConsoleMethod( PersistenceManager, saveDirtyObject, bool, (const char * objName), , "(SimObject object)" +DefineEngineMethod( PersistenceManager, saveDirtyObject, bool, (const char * objName), , "(SimObject object)" "Save a dirty SimObject to it's file.") { SimObject *dirtyObject = NULL; @@ -2342,13 +2342,13 @@ DefineConsoleMethod( PersistenceManager, saveDirtyObject, bool, (const char * ob return false; } -DefineConsoleMethod( PersistenceManager, clearAll, void, (), , "()" +DefineEngineMethod( PersistenceManager, clearAll, void, (), , "()" "Clears all the tracked objects without saving them." ) { object->clearAll(); } -DefineConsoleMethod( PersistenceManager, removeObjectFromFile, void, (const char * objName, const char * filename),("") , "(SimObject object, [filename])" +DefineEngineMethod( PersistenceManager, removeObjectFromFile, void, (const char * objName, const char * filename),("") , "(SimObject object, [filename])" "Remove an existing SimObject from a file (can optionally specify a different file than \ the one it was created in.") { @@ -2371,7 +2371,7 @@ DefineConsoleMethod( PersistenceManager, removeObjectFromFile, void, (const char } } -DefineConsoleMethod( PersistenceManager, removeField, void, (const char * objName, const char * fieldName), , "(SimObject object, string fieldName)" +DefineEngineMethod( PersistenceManager, removeField, void, (const char * objName, const char * fieldName), , "(SimObject object, string fieldName)" "Remove a specific field from an object declaration.") { SimObject *dirtyObject = NULL; diff --git a/Engine/source/console/simDatablock.cpp b/Engine/source/console/simDatablock.cpp index 6181fe810..771b1f039 100644 --- a/Engine/source/console/simDatablock.cpp +++ b/Engine/source/console/simDatablock.cpp @@ -428,7 +428,7 @@ void SimDataBlock::write(Stream &stream, U32 tabStop, U32 flags) //----------------------------------------------------------------------------- -DefineConsoleMethod( SimDataBlock, reloadOnLocalClient, void, (),, +DefineEngineMethod( SimDataBlock, reloadOnLocalClient, void, (),, "Reload the datablock. This can only be used with a local client configuration." ) { // Make sure we're running a local client. diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index b47448414..62ac25fd1 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -2271,7 +2271,7 @@ DefineEngineMethod( SimObject, dumpGroupHierarchy, void, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, isMethod, bool, ( const char* methodName ),, +DefineEngineMethod( SimObject, isMethod, bool, ( const char* methodName ),, "Test whether the given method is defined on this object.\n" "@param The name of the method.\n" "@return True if the object implements the given method." ) @@ -2291,7 +2291,7 @@ DefineEngineMethod( SimObject, isChildOfGroup, bool, ( SimGroup* group ),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getClassNamespace, const char*, (),, +DefineEngineMethod( SimObject, getClassNamespace, const char*, (),, "Get the name of the class namespace assigned to this object.\n" "@return The name of the 'class' namespace." ) { @@ -2300,7 +2300,7 @@ DefineConsoleMethod( SimObject, getClassNamespace, const char*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getSuperClassNamespace, const char*, (),, +DefineEngineMethod( SimObject, getSuperClassNamespace, const char*, (),, "Get the name of the superclass namespace assigned to this object.\n" "@return The name of the 'superClass' namespace." ) { @@ -2309,7 +2309,7 @@ DefineConsoleMethod( SimObject, getSuperClassNamespace, const char*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, setClassNamespace, void, ( const char* name ),, +DefineEngineMethod( SimObject, setClassNamespace, void, ( const char* name ),, "Assign a class namespace to this object.\n" "@param name The name of the 'class' namespace for this object." ) { @@ -2318,7 +2318,7 @@ DefineConsoleMethod( SimObject, setClassNamespace, void, ( const char* name ),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, setSuperClassNamespace, void, ( const char* name ),, +DefineEngineMethod( SimObject, setSuperClassNamespace, void, ( const char* name ),, "Assign a superclass namespace to this object.\n" "@param name The name of the 'superClass' namespace for this object." ) { @@ -2345,7 +2345,7 @@ DefineEngineMethod( SimObject, setIsSelected, void, ( bool state ), ( true ), //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, isExpanded, bool, (),, +DefineEngineMethod( SimObject, isExpanded, bool, (),, "Get whether the object has been marked as expanded. (in editor)\n" "@return True if the object is marked expanded." ) { @@ -2354,7 +2354,7 @@ DefineConsoleMethod( SimObject, isExpanded, bool, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, setIsExpanded, void, ( bool state ), ( true ), +DefineEngineMethod( SimObject, setIsExpanded, void, ( bool state ), ( true ), "Set whether the object has been marked as expanded. (in editor)\n" "@param state True if the object is to be marked expanded; false if not." ) { @@ -2363,7 +2363,7 @@ DefineConsoleMethod( SimObject, setIsExpanded, void, ( bool state ), ( true ), //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getFilename, const char*, (),, +DefineEngineMethod( SimObject, getFilename, const char*, (),, "Returns the filename the object is attached to.\n" "@return The name of the file the object is associated with; usually the file the object was loaded from." ) { @@ -2372,7 +2372,7 @@ DefineConsoleMethod( SimObject, getFilename, const char*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, setFilename, void, ( const char* fileName ),, +DefineEngineMethod( SimObject, setFilename, void, ( const char* fileName ),, "Sets the object's file name and path\n" "@param fileName The name of the file to associate this object with." ) { @@ -2381,7 +2381,7 @@ DefineConsoleMethod( SimObject, setFilename, void, ( const char* fileName ),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getDeclarationLine, S32, (),, +DefineEngineMethod( SimObject, getDeclarationLine, S32, (),, "Get the line number at which the object is defined in its file.\n\n" "@return The line number of the object's definition in script.\n" "@see getFilename()") @@ -2418,7 +2418,7 @@ DefineEngineFunction( debugEnumInstances, void, ( const char* className, const c //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, assignFieldsFrom, void, ( SimObject* fromObject ),, +DefineEngineMethod( SimObject, assignFieldsFrom, void, ( SimObject* fromObject ),, "Copy fields from another object onto this one. The objects must " "be of same type. Everything from the object will overwrite what's " "in this object; extra fields in this object will remain. This " @@ -2439,7 +2439,7 @@ DefineEngineMethod( SimObject, assignPersistentId, void, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getCanSave, bool, (),, +DefineEngineMethod( SimObject, getCanSave, bool, (),, "Get whether the object will be included in saves.\n" "@return True if the object will be saved; false otherwise." ) { @@ -2448,7 +2448,7 @@ DefineConsoleMethod( SimObject, getCanSave, bool, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, setCanSave, void, ( bool value ), ( true ), +DefineEngineMethod( SimObject, setCanSave, void, ( bool value ), ( true ), "Set whether the object will be included in saves.\n" "@param value If true, the object will be included in saves; if false, it will be excluded." ) { @@ -2529,7 +2529,7 @@ DefineEngineMethod( SimObject, setHidden, void, ( bool value ), ( true ), //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, dumpMethods, ArrayObject*, (),, +DefineEngineMethod( SimObject, dumpMethods, ArrayObject*, (),, "List the methods defined on this object.\n\n" "Each description is a newline-separated vector with the following elements:\n" "- Minimum number of arguments.\n" @@ -2776,7 +2776,7 @@ DefineEngineMethod( SimObject, dump, void, ( bool detailed ), ( false ), //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, save, bool, ( const char* fileName, bool selectedOnly, const char* preAppendString ), ( false, "" ), +DefineEngineMethod( SimObject, save, bool, ( const char* fileName, bool selectedOnly, const char* preAppendString ), ( false, "" ), "Save out the object to the given file.\n" "@param fileName The name of the file to save to." "@param selectedOnly If true, only objects marked as selected will be saved out.\n" @@ -2808,7 +2808,7 @@ DefineEngineMethod( SimObject, getName, const char*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getClassName, const char*, (),, +DefineEngineMethod( SimObject, getClassName, const char*, (),, "Get the name of the C++ class which the object is an instance of.\n" "@return The name of the C++ class of the object." ) { @@ -2818,7 +2818,7 @@ DefineConsoleMethod( SimObject, getClassName, const char*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, isField, bool, ( const char* fieldName ),, +DefineEngineMethod( SimObject, isField, bool, ( const char* fieldName ),, "Test whether the given field is defined on this object.\n" "@param fieldName The name of the field.\n" "@return True if the object implements the given field." ) @@ -2828,7 +2828,7 @@ DefineConsoleMethod( SimObject, isField, bool, ( const char* fieldName ),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getFieldValue, const char*, ( const char* fieldName, S32 index ), ( -1 ), +DefineEngineMethod( SimObject, getFieldValue, const char*, ( const char* fieldName, S32 index ), ( -1 ), "Return the value of the given field on this object.\n" "@param fieldName The name of the field. If it includes a field index, the index is parsed out.\n" "@param index Optional parameter to specify the index of an array field separately.\n" @@ -2872,7 +2872,7 @@ DefineConsoleMethod( SimObject, getFieldValue, const char*, ( const char* fieldN //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, setFieldValue, bool, ( const char* fieldName, const char* value, S32 index ), ( -1 ), +DefineEngineMethod( SimObject, setFieldValue, bool, ( const char* fieldName, const char* value, S32 index ), ( -1 ), "Set the value of the given field on this object.\n" "@param fieldName The name of the field to assign to. If it includes an array index, the index will be parsed out.\n" "@param value The new value to assign to the field.\n" @@ -2919,7 +2919,7 @@ DefineConsoleMethod( SimObject, setFieldValue, bool, ( const char* fieldName, co //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getFieldType, const char*, ( const char* fieldName ),, +DefineEngineMethod( SimObject, getFieldType, const char*, ( const char* fieldName ),, "Get the console type code of the given field.\n" "@return The numeric type code for the underlying console type of the given field." ) { @@ -2934,7 +2934,7 @@ DefineConsoleMethod( SimObject, getFieldType, const char*, ( const char* fieldNa //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, setFieldType, void, ( const char* fieldName, const char* type ),, +DefineEngineMethod( SimObject, setFieldType, void, ( const char* fieldName, const char* type ),, "Set the console type code for the given field.\n" "@param fieldName The name of the dynamic field to change to type for.\n" "@param type The name of the console type.\n" @@ -2974,7 +2974,7 @@ DefineEngineMethod( SimObject, getInternalName, const char*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, dumpClassHierarchy, void, (),, +DefineEngineMethod( SimObject, dumpClassHierarchy, void, (),, "Dump the native C++ class hierarchy of this object's C++ class to the console." ) { object->dumpClassHierarchy(); @@ -2982,7 +2982,7 @@ DefineConsoleMethod( SimObject, dumpClassHierarchy, void, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, isMemberOfClass, bool, ( const char* className ),, +DefineEngineMethod( SimObject, isMemberOfClass, bool, ( const char* className ),, "Test whether this object is a member of the specified class.\n" "@param className Name of a native C++ class.\n" "@return True if this object is an instance of the given C++ class or any of its super classes." ) @@ -3004,7 +3004,7 @@ DefineConsoleMethod( SimObject, isMemberOfClass, bool, ( const char* className ) //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, isInNamespaceHierarchy, bool, ( const char* name ),, +DefineEngineMethod( SimObject, isInNamespaceHierarchy, bool, ( const char* name ),, "Test whether the namespace of this object is a direct or indirect child to the given namespace.\n" "@param name The name of a namespace.\n" "@return True if the given namespace name is within the namespace hierarchy of this object." ) @@ -3039,7 +3039,7 @@ DefineEngineMethod( SimObject, getGroup, SimGroup*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, delete, void, (),, +DefineEngineMethod( SimObject, delete, void, (),, "Delete and remove the object." ) { object->deleteObject(); @@ -3067,7 +3067,7 @@ ConsoleMethod( SimObject,schedule, S32, 4, 0, "( float time, string method, stri //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getDynamicFieldCount, S32, (),, +DefineEngineMethod( SimObject, getDynamicFieldCount, S32, (),, "Get the number of dynamic fields defined on the object.\n" "@return The number of dynamic fields defined on the object." ) { @@ -3081,7 +3081,7 @@ DefineConsoleMethod( SimObject, getDynamicFieldCount, S32, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getDynamicField, const char*, ( S32 index ),, +DefineEngineMethod( SimObject, getDynamicField, const char*, ( S32 index ),, "Get a value of a dynamic field by index.\n" "@param index The index of the dynamic field.\n" "@return The value of the dynamic field at the given index or \"\"." ) @@ -3113,7 +3113,7 @@ DefineConsoleMethod( SimObject, getDynamicField, const char*, ( S32 index ),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getFieldCount, S32, (),, +DefineEngineMethod( SimObject, getFieldCount, S32, (),, "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object." ) { @@ -3135,7 +3135,7 @@ DefineConsoleMethod( SimObject, getFieldCount, S32, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getField, const char*, ( S32 index ),, +DefineEngineMethod( SimObject, getField, const char*, ( S32 index ),, "Retrieve the value of a static field by index.\n" "@param index The index of the static field.\n" "@return The value of the static field with the given index or \"\"." ) diff --git a/Engine/source/console/simPersistSet.cpp b/Engine/source/console/simPersistSet.cpp index 2dea6416e..00840c649 100644 --- a/Engine/source/console/simPersistSet.cpp +++ b/Engine/source/console/simPersistSet.cpp @@ -187,7 +187,7 @@ void SimPersistSet::addObject( SimObject* object ) //----------------------------------------------------------------------------- -DefineConsoleMethod( SimPersistSet, resolvePersistentIds, void, (), , "() - Try to bind unresolved persistent IDs in the set." ) +DefineEngineMethod( SimPersistSet, resolvePersistentIds, void, (), , "() - Try to bind unresolved persistent IDs in the set." ) { object->resolvePIDs(); } diff --git a/Engine/source/console/simSet.cpp b/Engine/source/console/simSet.cpp index c44b09c36..545c411b7 100644 --- a/Engine/source/console/simSet.cpp +++ b/Engine/source/console/simSet.cpp @@ -954,7 +954,7 @@ DefineEngineMethod( SimSet, clear, void, (),, //----------------------------------------------------------------------------- //UNSAFE; don't want this in the new API -DefineConsoleMethod( SimSet, deleteAllObjects, void, (), , "() Delete all objects in the set." ) +DefineEngineMethod( SimSet, deleteAllObjects, void, (), , "() Delete all objects in the set." ) { object->deleteAllObjects(); } @@ -1026,7 +1026,7 @@ DEFINE_CALLIN( fnSimSet_getCountRecursive, getCountRecursive, SimSet, U32, ( Sim return set->sizeRecursive(); } -DefineConsoleMethod( SimSet, getFullCount, S32, (), , "() Get the number of direct and indirect child objects contained in the set.\n" +DefineEngineMethod( SimSet, getFullCount, S32, (), , "() Get the number of direct and indirect child objects contained in the set.\n" "@return The number of objects contained in the set as well as in other sets contained directly or indirectly in the set." ) { return object->sizeRecursive(); @@ -1122,7 +1122,7 @@ DefineEngineMethod( SimSet, pushToBack, void, ( SimObject* obj ),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimSet, sort, void, ( const char * callbackFunction ), , "( string callbackFunction ) Sort the objects in the set using the given comparison function.\n" +DefineEngineMethod( SimSet, sort, void, ( const char * callbackFunction ), , "( string callbackFunction ) Sort the objects in the set using the given comparison function.\n" "@param callbackFunction Name of a function that takes two object arguments A and B and returns -1 if A is less, 1 if B is less, and 0 if both are equal." ) { object->scriptSort( callbackFunction ); diff --git a/Engine/source/core/fileObject.cpp b/Engine/source/core/fileObject.cpp index e872d7838..c0f9b17ae 100644 --- a/Engine/source/core/fileObject.cpp +++ b/Engine/source/core/fileObject.cpp @@ -484,7 +484,7 @@ static ConsoleDocFragment _FileObjectwriteObject2( "FileObject", "void writeObject( SimObject* object, string prepend);"); -DefineConsoleMethod( FileObject, writeObject, void, (const char * simName, const char * objName), (""), "FileObject.writeObject(SimObject, object prepend)" +DefineEngineMethod( FileObject, writeObject, void, (const char * simName, const char * objName), (""), "FileObject.writeObject(SimObject, object prepend)" "@hide") { SimObject* obj = Sim::findObject( simName ); diff --git a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp index e1a612b00..23b79e904 100644 --- a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp @@ -1185,67 +1185,67 @@ void GuiMeshRoadEditorCtrl::matchTerrainToRoad() // with the terrain underneath it. } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, deleteNode, void, (), , "deleteNode()" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, deleteNode, void, (), , "deleteNode()" ) { object->deleteSelectedNode(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getMode, const char*, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getMode, const char*, (), , "" ) { return object->getMode(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setMode, void, (const char * mode), , "setMode( String mode )" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setMode, void, (const char * mode), , "setMode( String mode )" ) { String newMode = ( mode ); object->setMode( newMode ); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getNodeWidth, F32, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getNodeWidth, F32, (), , "" ) { return object->getNodeWidth(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) { object->setNodeWidth( width ); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getNodeDepth, F32, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getNodeDepth, F32, (), , "" ) { return object->getNodeDepth(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setNodeDepth, void, ( F32 depth ), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setNodeDepth, void, ( F32 depth ), , "" ) { object->setNodeDepth( depth ); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getNodePosition, Point3F, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getNodePosition, Point3F, (), , "" ) { return object->getNodePosition(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setNodePosition, void, (Point3F pos), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setNodePosition, void, (Point3F pos), , "" ) { object->setNodePosition( pos ); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getNodeNormal, Point3F, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getNodeNormal, Point3F, (), , "" ) { return object->getNodeNormal(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setNodeNormal, void, (Point3F normal), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setNodeNormal, void, (Point3F normal), , "" ) { object->setNodeNormal( normal ); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setSelectedRoad, void, (const char * objName), (""), "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setSelectedRoad, void, (const char * objName), (""), "" ) { if ( String::isEmpty(objName) ) object->setSelectedRoad(NULL); @@ -1257,7 +1257,7 @@ DefineConsoleMethod( GuiMeshRoadEditorCtrl, setSelectedRoad, void, (const char * } } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) { MeshRoad *road = object->getSelectedRoad(); if ( !road ) @@ -1266,14 +1266,14 @@ DefineConsoleMethod( GuiMeshRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) return road->getId(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, regenerate, void, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, regenerate, void, (), , "" ) { MeshRoad *road = object->getSelectedRoad(); if ( road ) road->regenerate(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, matchTerrainToRoad, void, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, matchTerrainToRoad, void, (), , "" ) { object->matchTerrainToRoad(); } diff --git a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp index 01ab745a8..1b2dd02d3 100644 --- a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp @@ -1393,66 +1393,66 @@ void GuiRiverEditorCtrl::_renderSelectedRiver( ObjectRenderInst *ri, SceneRender } } -DefineConsoleMethod( GuiRiverEditorCtrl, deleteNode, void, (), , "deleteNode()" ) +DefineEngineMethod( GuiRiverEditorCtrl, deleteNode, void, (), , "deleteNode()" ) { object->deleteSelectedNode(); } -DefineConsoleMethod( GuiRiverEditorCtrl, getMode, const char*, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getMode, const char*, (), , "" ) { return object->getMode(); } -DefineConsoleMethod( GuiRiverEditorCtrl, setMode, void, ( const char * mode ), , "setMode( String mode )" ) +DefineEngineMethod( GuiRiverEditorCtrl, setMode, void, ( const char * mode ), , "setMode( String mode )" ) { String newMode = ( mode ); object->setMode( newMode ); } -DefineConsoleMethod( GuiRiverEditorCtrl, getNodeWidth, F32, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getNodeWidth, F32, (), , "" ) { return object->getNodeWidth(); } -DefineConsoleMethod( GuiRiverEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) { object->setNodeWidth( width ); } -DefineConsoleMethod( GuiRiverEditorCtrl, getNodeDepth, F32, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getNodeDepth, F32, (), , "" ) { return object->getNodeDepth(); } -DefineConsoleMethod( GuiRiverEditorCtrl, setNodeDepth, void, ( F32 depth ), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, setNodeDepth, void, ( F32 depth ), , "" ) { object->setNodeDepth( depth ); } -DefineConsoleMethod( GuiRiverEditorCtrl, getNodePosition, Point3F, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getNodePosition, Point3F, (), , "" ) { return object->getNodePosition(); } -DefineConsoleMethod( GuiRiverEditorCtrl, setNodePosition, void, (Point3F pos), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, setNodePosition, void, (Point3F pos), , "" ) { object->setNodePosition( pos ); } -DefineConsoleMethod( GuiRiverEditorCtrl, getNodeNormal, Point3F, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getNodeNormal, Point3F, (), , "" ) { return object->getNodeNormal(); } -DefineConsoleMethod( GuiRiverEditorCtrl, setNodeNormal, void, (Point3F normal), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, setNodeNormal, void, (Point3F normal), , "" ) { object->setNodeNormal( normal ); } -DefineConsoleMethod( GuiRiverEditorCtrl, setSelectedRiver, void, (const char * objName), (""), "" ) +DefineEngineMethod( GuiRiverEditorCtrl, setSelectedRiver, void, (const char * objName), (""), "" ) { if (dStrcmp( objName,"" )==0) object->setSelectedRiver(NULL); @@ -1464,7 +1464,7 @@ DefineConsoleMethod( GuiRiverEditorCtrl, setSelectedRiver, void, (const char * o } } -DefineConsoleMethod( GuiRiverEditorCtrl, getSelectedRiver, S32, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getSelectedRiver, S32, (), , "" ) { River *river = object->getSelectedRiver(); if ( !river ) @@ -1473,7 +1473,7 @@ DefineConsoleMethod( GuiRiverEditorCtrl, getSelectedRiver, S32, (), , "" ) return river->getId(); } -DefineConsoleMethod( GuiRiverEditorCtrl, regenerate, void, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, regenerate, void, (), , "" ) { River *river = object->getSelectedRiver(); if ( river ) diff --git a/Engine/source/environment/editors/guiRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiRoadEditorCtrl.cpp index 167a5db45..7a2ec8a96 100644 --- a/Engine/source/environment/editors/guiRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRoadEditorCtrl.cpp @@ -1037,45 +1037,45 @@ void GuiRoadEditorCtrl::submitUndo( const UTF8 *name ) undoMan->addAction( action ); } -DefineConsoleMethod( GuiRoadEditorCtrl, deleteNode, void, (), , "deleteNode()" ) +DefineEngineMethod( GuiRoadEditorCtrl, deleteNode, void, (), , "deleteNode()" ) { object->deleteSelectedNode(); } -DefineConsoleMethod( GuiRoadEditorCtrl, getMode, const char*, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, getMode, const char*, (), , "" ) { return object->getMode(); } -DefineConsoleMethod( GuiRoadEditorCtrl, setMode, void, ( const char * mode ), , "setMode( String mode )" ) +DefineEngineMethod( GuiRoadEditorCtrl, setMode, void, ( const char * mode ), , "setMode( String mode )" ) { String newMode = ( mode ); object->setMode( newMode ); } -DefineConsoleMethod( GuiRoadEditorCtrl, getNodeWidth, F32, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, getNodeWidth, F32, (), , "" ) { return object->getNodeWidth(); } -DefineConsoleMethod( GuiRoadEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) { object->setNodeWidth( width ); } -DefineConsoleMethod( GuiRoadEditorCtrl, getNodePosition, Point3F, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, getNodePosition, Point3F, (), , "" ) { return object->getNodePosition(); } -DefineConsoleMethod( GuiRoadEditorCtrl, setNodePosition, void, ( Point3F pos ), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, setNodePosition, void, ( Point3F pos ), , "" ) { object->setNodePosition( pos ); } -DefineConsoleMethod( GuiRoadEditorCtrl, setSelectedRoad, void, ( const char * pathRoad ), (""), "" ) +DefineEngineMethod( GuiRoadEditorCtrl, setSelectedRoad, void, ( const char * pathRoad ), (""), "" ) { if (dStrcmp( pathRoad,"")==0 ) object->setSelectedRoad(NULL); @@ -1087,7 +1087,7 @@ DefineConsoleMethod( GuiRoadEditorCtrl, setSelectedRoad, void, ( const char * pa } } -DefineConsoleMethod( GuiRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) { DecalRoad *road = object->getSelectedRoad(); if ( road ) @@ -1096,12 +1096,12 @@ DefineConsoleMethod( GuiRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) return NULL; } -DefineConsoleMethod( GuiRoadEditorCtrl, getSelectedNode, S32, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, getSelectedNode, S32, (), , "" ) { return object->getSelectedNode(); } -DefineConsoleMethod( GuiRoadEditorCtrl, deleteRoad, void, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, deleteRoad, void, (), , "" ) { object->deleteSelectedRoad(); } diff --git a/Engine/source/environment/skyBox.cpp b/Engine/source/environment/skyBox.cpp index daadcf885..8aca8d266 100644 --- a/Engine/source/environment/skyBox.cpp +++ b/Engine/source/environment/skyBox.cpp @@ -640,7 +640,7 @@ BaseMatInstance* SkyBox::_getMaterialInstance() return mMatInstance; } -DefineConsoleMethod( SkyBox, postApply, void, (), , "") +DefineEngineMethod( SkyBox, postApply, void, (), , "") { object->inspectPostApply(); } \ No newline at end of file diff --git a/Engine/source/environment/sun.cpp b/Engine/source/environment/sun.cpp index d83d7078b..7063e1a27 100644 --- a/Engine/source/environment/sun.cpp +++ b/Engine/source/environment/sun.cpp @@ -558,12 +558,12 @@ void Sun::_onUnselected() Parent::_onUnselected(); } -DefineConsoleMethod(Sun, apply, void, (), , "") +DefineEngineMethod(Sun, apply, void, (), , "") { object->inspectPostApply(); } -DefineConsoleMethod(Sun, animate, void, ( F32 duration, F32 startAzimuth, F32 endAzimuth, F32 startElevation, F32 endElevation ), , "animate( F32 duration, F32 startAzimuth, F32 endAzimuth, F32 startElevation, F32 endElevation )") +DefineEngineMethod(Sun, animate, void, ( F32 duration, F32 startAzimuth, F32 endAzimuth, F32 startElevation, F32 endElevation ), , "animate( F32 duration, F32 startAzimuth, F32 endAzimuth, F32 startElevation, F32 endElevation )") { object->animate(duration, startAzimuth, endAzimuth, startElevation, endElevation); diff --git a/Engine/source/forest/editor/forestBrushElement.cpp b/Engine/source/forest/editor/forestBrushElement.cpp index f61834c9e..bbee91e5a 100644 --- a/Engine/source/forest/editor/forestBrushElement.cpp +++ b/Engine/source/forest/editor/forestBrushElement.cpp @@ -187,7 +187,7 @@ bool ForestBrush::containsItemData( const ForestItemData *inData ) return false; } -DefineConsoleMethod( ForestBrush, containsItemData, bool, ( const char * obj ), , "( ForestItemData obj )" ) +DefineEngineMethod( ForestBrush, containsItemData, bool, ( const char * obj ), , "( ForestItemData obj )" ) { ForestItemData *data = NULL; if ( !Sim::findObject( obj, data ) ) diff --git a/Engine/source/forest/editor/forestBrushTool.cpp b/Engine/source/forest/editor/forestBrushTool.cpp index ae71951b5..d0d64d517 100644 --- a/Engine/source/forest/editor/forestBrushTool.cpp +++ b/Engine/source/forest/editor/forestBrushTool.cpp @@ -682,7 +682,7 @@ bool ForestBrushTool::getGroundAt( const Point3F &worldPt, F32 *zValueOut, Vecto return true; } -DefineConsoleMethod( ForestBrushTool, collectElements, void, (), , "" ) +DefineEngineMethod( ForestBrushTool, collectElements, void, (), , "" ) { object->collectElements(); } \ No newline at end of file diff --git a/Engine/source/forest/editor/forestEditorCtrl.cpp b/Engine/source/forest/editor/forestEditorCtrl.cpp index d8b54ba9c..db8a58f3c 100644 --- a/Engine/source/forest/editor/forestEditorCtrl.cpp +++ b/Engine/source/forest/editor/forestEditorCtrl.cpp @@ -370,24 +370,24 @@ bool ForestEditorCtrl::isDirty() return foundDirty; } -DefineConsoleMethod( ForestEditorCtrl, updateActiveForest, void, (), , "()" ) +DefineEngineMethod( ForestEditorCtrl, updateActiveForest, void, (), , "()" ) { object->updateActiveForest( true ); } -DefineConsoleMethod( ForestEditorCtrl, setActiveTool, void, ( const char * toolName ), , "( ForestTool tool )" ) +DefineEngineMethod( ForestEditorCtrl, setActiveTool, void, ( const char * toolName ), , "( ForestTool tool )" ) { ForestTool *tool = dynamic_cast( Sim::findObject( toolName ) ); object->setActiveTool( tool ); } -DefineConsoleMethod( ForestEditorCtrl, getActiveTool, S32, (), , "()" ) +DefineEngineMethod( ForestEditorCtrl, getActiveTool, S32, (), , "()" ) { ForestTool *tool = object->getActiveTool(); return tool ? tool->getId() : 0; } -DefineConsoleMethod( ForestEditorCtrl, deleteMeshSafe, void, ( const char * obj ), , "( ForestItemData obj )" ) +DefineEngineMethod( ForestEditorCtrl, deleteMeshSafe, void, ( const char * obj ), , "( ForestItemData obj )" ) { ForestItemData *db; if ( !Sim::findObject( obj, db ) ) @@ -396,12 +396,12 @@ DefineConsoleMethod( ForestEditorCtrl, deleteMeshSafe, void, ( const char * obj object->deleteMeshSafe( db ); } -DefineConsoleMethod( ForestEditorCtrl, isDirty, bool, (), , "" ) +DefineEngineMethod( ForestEditorCtrl, isDirty, bool, (), , "" ) { return object->isDirty(); } -DefineConsoleMethod(ForestEditorCtrl, setActiveForest, void, (const char * obj), , "( Forest obj )") +DefineEngineMethod(ForestEditorCtrl, setActiveForest, void, (const char * obj), , "( Forest obj )") { Forest *forestObject; if (!Sim::findObject(obj, forestObject)) diff --git a/Engine/source/forest/editor/forestSelectionTool.cpp b/Engine/source/forest/editor/forestSelectionTool.cpp index a453f4e99..f6689c9b8 100644 --- a/Engine/source/forest/editor/forestSelectionTool.cpp +++ b/Engine/source/forest/editor/forestSelectionTool.cpp @@ -563,32 +563,32 @@ void ForestSelectionTool::onUndoAction() mBounds.intersect( mSelection[i].getWorldBox() ); } -DefineConsoleMethod( ForestSelectionTool, getSelectionCount, S32, (), , "" ) +DefineEngineMethod( ForestSelectionTool, getSelectionCount, S32, (), , "" ) { return object->getSelectionCount(); } -DefineConsoleMethod( ForestSelectionTool, deleteSelection, void, (), , "" ) +DefineEngineMethod( ForestSelectionTool, deleteSelection, void, (), , "" ) { object->deleteSelection(); } -DefineConsoleMethod( ForestSelectionTool, clearSelection, void, (), , "" ) +DefineEngineMethod( ForestSelectionTool, clearSelection, void, (), , "" ) { object->clearSelection(); } -DefineConsoleMethod( ForestSelectionTool, cutSelection, void, (), , "" ) +DefineEngineMethod( ForestSelectionTool, cutSelection, void, (), , "" ) { object->cutSelection(); } -DefineConsoleMethod( ForestSelectionTool, copySelection, void, (), , "" ) +DefineEngineMethod( ForestSelectionTool, copySelection, void, (), , "" ) { object->copySelection(); } -DefineConsoleMethod( ForestSelectionTool, pasteSelection, void, (), , "" ) +DefineEngineMethod( ForestSelectionTool, pasteSelection, void, (), , "" ) { object->pasteSelection(); } diff --git a/Engine/source/forest/forest.cpp b/Engine/source/forest/forest.cpp index e6b2fd8bd..985f34151 100644 --- a/Engine/source/forest/forest.cpp +++ b/Engine/source/forest/forest.cpp @@ -361,22 +361,22 @@ void Forest::saveDataFile( const char *path ) mData->write( mDataFileName ); } -DefineConsoleMethod( Forest, saveDataFile, void, (const char * path), (""), "saveDataFile( [path] )" ) +DefineEngineMethod( Forest, saveDataFile, void, (const char * path), (""), "saveDataFile( [path] )" ) { object->saveDataFile( path ); } -DefineConsoleMethod(Forest, isDirty, bool, (), , "()") +DefineEngineMethod(Forest, isDirty, bool, (), , "()") { return object->getData() && object->getData()->isDirty(); } -DefineConsoleMethod(Forest, regenCells, void, (), , "()") +DefineEngineMethod(Forest, regenCells, void, (), , "()") { object->getData()->regenCells(); } -DefineConsoleMethod(Forest, clear, void, (), , "()" ) +DefineEngineMethod(Forest, clear, void, (), , "()" ) { object->clear(); } diff --git a/Engine/source/gfx/video/theoraTextureObject.cpp b/Engine/source/gfx/video/theoraTextureObject.cpp index 13e73402b..e83314870 100644 --- a/Engine/source/gfx/video/theoraTextureObject.cpp +++ b/Engine/source/gfx/video/theoraTextureObject.cpp @@ -191,7 +191,7 @@ void TheoraTextureObject::play() //----------------------------------------------------------------------------- -DefineConsoleMethod( TheoraTextureObject, play, void, (),, +DefineEngineMethod( TheoraTextureObject, play, void, (),, "Start playback of the video." ) { object->play(); @@ -199,7 +199,7 @@ DefineConsoleMethod( TheoraTextureObject, play, void, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( TheoraTextureObject, stop, void, (),, +DefineEngineMethod( TheoraTextureObject, stop, void, (),, "Stop playback of the video." ) { object->stop(); @@ -207,7 +207,7 @@ DefineConsoleMethod( TheoraTextureObject, stop, void, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( TheoraTextureObject, pause, void, (),, +DefineEngineMethod( TheoraTextureObject, pause, void, (),, "Pause playback of the video." ) { object->pause(); diff --git a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp index fb2b9a5f9..c3e7cf8a2 100644 --- a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp @@ -92,17 +92,17 @@ void GuiToolboxButtonCtrl::onSleep() //------------------------------------- -DefineConsoleMethod( GuiToolboxButtonCtrl, setNormalBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is active") +DefineEngineMethod( GuiToolboxButtonCtrl, setNormalBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is active") { object->setNormalBitmap(name); } -DefineConsoleMethod( GuiToolboxButtonCtrl, setLoweredBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is disabled") +DefineEngineMethod( GuiToolboxButtonCtrl, setLoweredBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is disabled") { object->setLoweredBitmap(name); } -DefineConsoleMethod( GuiToolboxButtonCtrl, setHoverBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is disabled") +DefineEngineMethod( GuiToolboxButtonCtrl, setHoverBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is disabled") { object->setHoverBitmap(name); } diff --git a/Engine/source/gui/controls/guiBitmapCtrl.cpp b/Engine/source/gui/controls/guiBitmapCtrl.cpp index 769445dc3..855b78900 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.cpp +++ b/Engine/source/gui/controls/guiBitmapCtrl.cpp @@ -261,7 +261,7 @@ static ConsoleDocFragment _sGuiBitmapCtrlSetBitmap2( //"Set the bitmap displayed in the control. Note that it is limited in size, to 256x256." -DefineConsoleMethod( GuiBitmapCtrl, setBitmap, void, ( const char * fileRoot, bool resize), ( false), +DefineEngineMethod( GuiBitmapCtrl, setBitmap, void, ( const char * fileRoot, bool resize), ( false), "( String filename | String filename, bool resize ) Assign an image to the control.\n\n" "@hide" ) { diff --git a/Engine/source/gui/controls/guiColorPicker.cpp b/Engine/source/gui/controls/guiColorPicker.cpp index 98f9620b3..d0e3034b6 100644 --- a/Engine/source/gui/controls/guiColorPicker.cpp +++ b/Engine/source/gui/controls/guiColorPicker.cpp @@ -658,17 +658,17 @@ void GuiColorPickerCtrl::setScriptValue(const char *value) setValue(newValue); } -DefineConsoleMethod(GuiColorPickerCtrl, getSelectorPos, Point2I, (), , "Gets the current position of the selector") +DefineEngineMethod(GuiColorPickerCtrl, getSelectorPos, Point2I, (), , "Gets the current position of the selector") { return object->getSelectorPos(); } -DefineConsoleMethod(GuiColorPickerCtrl, setSelectorPos, void, (Point2I newPos), , "Sets the current position of the selector") +DefineEngineMethod(GuiColorPickerCtrl, setSelectorPos, void, (Point2I newPos), , "Sets the current position of the selector") { object->setSelectorPos(newPos); } -DefineConsoleMethod(GuiColorPickerCtrl, updateColor, void, (), , "Forces update of pick color") +DefineEngineMethod(GuiColorPickerCtrl, updateColor, void, (), , "Forces update of pick color") { object->updateColor(); } diff --git a/Engine/source/gui/controls/guiFileTreeCtrl.cpp b/Engine/source/gui/controls/guiFileTreeCtrl.cpp index b6531fbaa..8513fb82b 100644 --- a/Engine/source/gui/controls/guiFileTreeCtrl.cpp +++ b/Engine/source/gui/controls/guiFileTreeCtrl.cpp @@ -379,18 +379,18 @@ void GuiFileTreeCtrl::recurseInsert( Item* parent, StringTableEntry path ) } -DefineConsoleMethod( GuiFileTreeCtrl, getSelectedPath, const char*, (), , "getSelectedPath() - returns the currently selected path in the tree") +DefineEngineMethod( GuiFileTreeCtrl, getSelectedPath, const char*, (), , "getSelectedPath() - returns the currently selected path in the tree") { const String& path = object->getSelectedPath(); return Con::getStringArg( path ); } -DefineConsoleMethod( GuiFileTreeCtrl, setSelectedPath, bool, (const char * path), , "setSelectedPath(path) - expands the tree to the specified path") +DefineEngineMethod( GuiFileTreeCtrl, setSelectedPath, bool, (const char * path), , "setSelectedPath(path) - expands the tree to the specified path") { return object->setSelectedPath( path ); } -DefineConsoleMethod( GuiFileTreeCtrl, reload, void, (), , "() - Reread the directory tree hierarchy." ) +DefineEngineMethod( GuiFileTreeCtrl, reload, void, (), , "() - Reread the directory tree hierarchy." ) { object->updateTree(); } diff --git a/Engine/source/gui/controls/guiGradientCtrl.cpp b/Engine/source/gui/controls/guiGradientCtrl.cpp index 20454b73d..112f3859d 100644 --- a/Engine/source/gui/controls/guiGradientCtrl.cpp +++ b/Engine/source/gui/controls/guiGradientCtrl.cpp @@ -601,7 +601,7 @@ void GuiGradientCtrl::sortColorRange() dQsort( mAlphaRange.address(), mAlphaRange.size(), sizeof(ColorRange), _numIncreasing); } -DefineConsoleMethod(GuiGradientCtrl, getColorCount, S32, (), , "Get color count") +DefineEngineMethod(GuiGradientCtrl, getColorCount, S32, (), , "Get color count") { if( object->getDisplayMode() == GuiGradientCtrl::pHorizColorRange ) return object->mColorRange.size(); @@ -611,7 +611,7 @@ DefineConsoleMethod(GuiGradientCtrl, getColorCount, S32, (), , "Get color count" return 0; } -DefineConsoleMethod(GuiGradientCtrl, getColor, LinearColorF, (S32 idx), , "Get color value") +DefineEngineMethod(GuiGradientCtrl, getColor, LinearColorF, (S32 idx), , "Get color value") { if( object->getDisplayMode() == GuiGradientCtrl::pHorizColorRange ) diff --git a/Engine/source/gui/controls/guiMaterialCtrl.cpp b/Engine/source/gui/controls/guiMaterialCtrl.cpp index edfb12e76..d6e5cf833 100644 --- a/Engine/source/gui/controls/guiMaterialCtrl.cpp +++ b/Engine/source/gui/controls/guiMaterialCtrl.cpp @@ -167,7 +167,7 @@ void GuiMaterialCtrl::onRender( Point2I offset, const RectI &updateRect ) GFX->setTexture( 0, NULL ); } -DefineConsoleMethod( GuiMaterialCtrl, setMaterial, bool, ( const char * materialName ), , "( string materialName )" +DefineEngineMethod( GuiMaterialCtrl, setMaterial, bool, ( const char * materialName ), , "( string materialName )" "Set the material to be displayed in the control." ) { return object->setMaterial( materialName ); diff --git a/Engine/source/gui/controls/guiPopUpCtrl.cpp b/Engine/source/gui/controls/guiPopUpCtrl.cpp index 0697c6a36..88eb5c59f 100644 --- a/Engine/source/gui/controls/guiPopUpCtrl.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrl.cpp @@ -300,82 +300,82 @@ void GuiPopUpMenuCtrl::initPersistFields(void) } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrl, add, void, (const char * name, S32 idNum, U32 scheme), ("", -1, 0), "(string name, int idNum, int scheme=0)") +DefineEngineMethod( GuiPopUpMenuCtrl, add, void, (const char * name, S32 idNum, U32 scheme), ("", -1, 0), "(string name, int idNum, int scheme=0)") { object->addEntry(name, idNum, scheme); } -DefineConsoleMethod( GuiPopUpMenuCtrl, addScheme, void, (U32 id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL), , +DefineEngineMethod( GuiPopUpMenuCtrl, addScheme, void, (U32 id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL), , "(int id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL)") { object->addScheme( id, fontColor, fontColorHL, fontColorSEL ); } -DefineConsoleMethod( GuiPopUpMenuCtrl, getText, const char*, (), , "") +DefineEngineMethod( GuiPopUpMenuCtrl, getText, const char*, (), , "") { return object->getText(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, clear, void, (), , "Clear the popup list.") +DefineEngineMethod( GuiPopUpMenuCtrl, clear, void, (), , "Clear the popup list.") { object->clear(); } //FIXME: clashes with SimSet.sort -DefineConsoleMethod(GuiPopUpMenuCtrl, sort, void, (), , "Sort the list alphabetically.") +DefineEngineMethod(GuiPopUpMenuCtrl, sort, void, (), , "Sort the list alphabetically.") { object->sort(); } // Added to sort the entries by ID -DefineConsoleMethod(GuiPopUpMenuCtrl, sortID, void, (), , "Sort the list by ID.") +DefineEngineMethod(GuiPopUpMenuCtrl, sortID, void, (), , "Sort the list by ID.") { object->sortID(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, forceOnAction, void, (), , "") +DefineEngineMethod( GuiPopUpMenuCtrl, forceOnAction, void, (), , "") { object->onAction(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, forceClose, void, (), , "") +DefineEngineMethod( GuiPopUpMenuCtrl, forceClose, void, (), , "") { object->closePopUp(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, getSelected, S32, (), , "Gets the selected index") +DefineEngineMethod( GuiPopUpMenuCtrl, getSelected, S32, (), , "Gets the selected index") { return object->getSelected(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, setSelected, void, (S32 id, bool scriptCallback), (true), "(int id, [scriptCallback=true])") +DefineEngineMethod( GuiPopUpMenuCtrl, setSelected, void, (S32 id, bool scriptCallback), (true), "(int id, [scriptCallback=true])") { object->setSelected( id, scriptCallback ); } -DefineConsoleMethod( GuiPopUpMenuCtrl, setFirstSelected, void, (bool scriptCallback), (true), "([scriptCallback=true])") +DefineEngineMethod( GuiPopUpMenuCtrl, setFirstSelected, void, (bool scriptCallback), (true), "([scriptCallback=true])") { object->setFirstSelected( scriptCallback ); } -DefineConsoleMethod( GuiPopUpMenuCtrl, setNoneSelected, void, (), , "") +DefineEngineMethod( GuiPopUpMenuCtrl, setNoneSelected, void, (), , "") { object->setNoneSelected(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, getTextById, const char*, (S32 id), , "(int id)") +DefineEngineMethod( GuiPopUpMenuCtrl, getTextById, const char*, (S32 id), , "(int id)") { return(object->getTextById(id)); } -DefineConsoleMethod( GuiPopUpMenuCtrl, changeTextById, void, ( S32 id, const char * text ), , "( int id, string text )" ) +DefineEngineMethod( GuiPopUpMenuCtrl, changeTextById, void, ( S32 id, const char * text ), , "( int id, string text )" ) { object->setEntryText( id, text ); } -DefineConsoleMethod( GuiPopUpMenuCtrl, setEnumContent, void, (const char * className, const char * enumName), , "(string class, string enum)" +DefineEngineMethod( GuiPopUpMenuCtrl, setEnumContent, void, (const char * className, const char * enumName), , "(string class, string enum)" "This fills the popup with a classrep's field enumeration type info.\n\n" "More of a helper function than anything. If console access to the field list is added, " "at least for the enumerated types, then this should go away..") @@ -429,20 +429,20 @@ DefineConsoleMethod( GuiPopUpMenuCtrl, setEnumContent, void, (const char * class } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrl, findText, S32, (const char * text), , "(string text)" +DefineEngineMethod( GuiPopUpMenuCtrl, findText, S32, (const char * text), , "(string text)" "Returns the position of the first entry containing the specified text or -1 if not found.") { return( object->findText( text ) ); } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrl, size, S32, (), , "Get the size of the menu - the number of entries in it.") +DefineEngineMethod( GuiPopUpMenuCtrl, size, S32, (), , "Get the size of the menu - the number of entries in it.") { return( object->getNumEntries() ); } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrl, replaceText, void, (bool doReplaceText), , "(bool doReplaceText)") +DefineEngineMethod( GuiPopUpMenuCtrl, replaceText, void, (bool doReplaceText), , "(bool doReplaceText)") { object->replaceText(S32(doReplaceText)); } @@ -532,7 +532,7 @@ void GuiPopUpMenuCtrl::clearEntry( S32 entry ) } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrl, clearEntry, void, (S32 entry), , "(S32 entry)") +DefineEngineMethod( GuiPopUpMenuCtrl, clearEntry, void, (S32 entry), , "(S32 entry)") { object->clearEntry(entry); } diff --git a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp index 2c8f5342a..1a39c95af 100644 --- a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp @@ -364,7 +364,7 @@ ConsoleDocFragment _GuiPopUpMenuCtrlExAdd( "void add(string name, S32 idNum, S32 scheme=0);" ); -DefineConsoleMethod( GuiPopUpMenuCtrlEx, add, void, (const char * name, S32 idNum, U32 scheme), ("", -1, 0), "(string name, int idNum, int scheme=0)") +DefineEngineMethod( GuiPopUpMenuCtrlEx, add, void, (const char * name, S32 idNum, U32 scheme), ("", -1, 0), "(string name, int idNum, int scheme=0)") { object->addEntry(name, idNum, scheme); } @@ -525,7 +525,7 @@ ConsoleDocFragment _GuiPopUpMenuCtrlExsetSelected( "setSelected(int id, bool scriptCallback=true);" ); -DefineConsoleMethod( GuiPopUpMenuCtrlEx, setSelected, void, (S32 id, bool scriptCallback), (true), "(int id, [scriptCallback=true])" +DefineEngineMethod( GuiPopUpMenuCtrlEx, setSelected, void, (S32 id, bool scriptCallback), (true), "(int id, [scriptCallback=true])" "@hide") { object->setSelected( id, scriptCallback ); @@ -539,7 +539,7 @@ ConsoleDocFragment _GuiPopUpMenuCtrlExsetFirstSelected( ); -DefineConsoleMethod( GuiPopUpMenuCtrlEx, setFirstSelected, void, (bool scriptCallback), (true), "([scriptCallback=true])" +DefineEngineMethod( GuiPopUpMenuCtrlEx, setFirstSelected, void, (bool scriptCallback), (true), "([scriptCallback=true])" "@hide") { object->setFirstSelected( scriptCallback ); @@ -561,7 +561,7 @@ DefineEngineMethod( GuiPopUpMenuCtrlEx, getTextById, const char*, (S32 id),, } -DefineConsoleMethod( GuiPopUpMenuCtrlEx, getColorById, ColorI, (S32 id), , +DefineEngineMethod( GuiPopUpMenuCtrlEx, getColorById, ColorI, (S32 id), , "@brief Get color of an entry's box\n\n" "@param id ID number of entry to query\n\n" "@return ColorI in the format of \"Red Green Blue Alpha\", each of with is a value between 0 - 255") @@ -572,7 +572,7 @@ DefineConsoleMethod( GuiPopUpMenuCtrlEx, getColorById, ColorI, (S32 id), , } -DefineConsoleMethod( GuiPopUpMenuCtrlEx, setEnumContent, void, ( const char * className, const char * enumName ), , +DefineEngineMethod( GuiPopUpMenuCtrlEx, setEnumContent, void, ( const char * className, const char * enumName ), , "@brief This fills the popup with a classrep's field enumeration type info.\n\n" "More of a helper function than anything. If console access to the field list is added, " "at least for the enumerated types, then this should go away.\n\n" @@ -628,7 +628,7 @@ DefineConsoleMethod( GuiPopUpMenuCtrlEx, setEnumContent, void, ( const char * cl } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrlEx, findText, S32, (const char * text), , "(string text)" +DefineEngineMethod( GuiPopUpMenuCtrlEx, findText, S32, (const char * text), , "(string text)" "Returns the id of the first entry containing the specified text or -1 if not found." "@param text String value used for the query\n\n" "@return Numerical ID of entry containing the text.") @@ -637,7 +637,7 @@ DefineConsoleMethod( GuiPopUpMenuCtrlEx, findText, S32, (const char * text), , " } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrlEx, size, S32, (), , +DefineEngineMethod( GuiPopUpMenuCtrlEx, size, S32, (), , "@brief Get the size of the menu\n\n" "@return Number of entries in the menu\n") { @@ -645,7 +645,7 @@ DefineConsoleMethod( GuiPopUpMenuCtrlEx, size, S32, (), , } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrlEx, replaceText, void, (S32 boolVal), , +DefineEngineMethod( GuiPopUpMenuCtrlEx, replaceText, void, (S32 boolVal), , "@brief Flag that causes each new text addition to replace the current entry\n\n" "@param True to turn on replacing, false to disable it") { @@ -737,7 +737,7 @@ void GuiPopUpMenuCtrlEx::clearEntry( S32 entry ) } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrlEx, clearEntry, void, (S32 entry), , "(S32 entry)") +DefineEngineMethod( GuiPopUpMenuCtrlEx, clearEntry, void, (S32 entry), , "(S32 entry)") { object->clearEntry(entry); } diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index efb0674ea..885d157a0 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -2139,7 +2139,7 @@ ConsoleDocFragment _pushDialog( "void pushDialog( GuiControl ctrl, int layer=0, bool center=false);" ); -DefineConsoleMethod( GuiCanvas, pushDialog, void, (const char * ctrlName, S32 layer, bool center), ( 0, false), "(GuiControl ctrl, int layer=0, bool center=false)" +DefineEngineMethod( GuiCanvas, pushDialog, void, (const char * ctrlName, S32 layer, bool center), ( 0, false), "(GuiControl ctrl, int layer=0, bool center=false)" "@hide") { GuiControl *gui; @@ -2176,7 +2176,7 @@ ConsoleDocFragment _popDialog2( "void popDialog();" ); -DefineConsoleMethod( GuiCanvas, popDialog, void, (GuiControl * gui), (nullAsType()), "(GuiControl ctrl=NULL)" +DefineEngineMethod( GuiCanvas, popDialog, void, (GuiControl * gui), (nullAsType()), "(GuiControl ctrl=NULL)" "@hide") { if (gui) @@ -2204,7 +2204,7 @@ ConsoleDocFragment _popLayer2( "void popLayer(S32 layer);" ); -DefineConsoleMethod( GuiCanvas, popLayer, void, (S32 layer), (0), "(int layer)" +DefineEngineMethod( GuiCanvas, popLayer, void, (S32 layer), (0), "(int layer)" "@hide") { @@ -2362,7 +2362,7 @@ ConsoleDocFragment _setCursorPos2( "bool setCursorPos( F32 posX, F32 posY);" ); -DefineConsoleMethod( GuiCanvas, setCursorPos, void, (Point2I pos), , "(Point2I pos)" +DefineEngineMethod( GuiCanvas, setCursorPos, void, (Point2I pos), , "(Point2I pos)" "@hide") { @@ -2647,7 +2647,7 @@ DefineEngineMethod( GuiCanvas, setWindowPosition, void, ( Point2I position ),, object->getPlatformWindow()->setPosition( position ); } -DefineConsoleMethod( GuiCanvas, isFullscreen, bool, (), , "() - Is this canvas currently fullscreen?" ) +DefineEngineMethod( GuiCanvas, isFullscreen, bool, (), , "() - Is this canvas currently fullscreen?" ) { if (Platform::getWebDeployment()) return false; @@ -2658,14 +2658,14 @@ DefineConsoleMethod( GuiCanvas, isFullscreen, bool, (), , "() - Is this canvas c return object->getPlatformWindow()->getVideoMode().fullScreen; } -DefineConsoleMethod( GuiCanvas, minimizeWindow, void, (), , "() - minimize this canvas' window." ) +DefineEngineMethod( GuiCanvas, minimizeWindow, void, (), , "() - minimize this canvas' window." ) { PlatformWindow* window = object->getPlatformWindow(); if ( window ) window->minimize(); } -DefineConsoleMethod( GuiCanvas, isMinimized, bool, (), , "()" ) +DefineEngineMethod( GuiCanvas, isMinimized, bool, (), , "()" ) { PlatformWindow* window = object->getPlatformWindow(); if ( window ) @@ -2674,7 +2674,7 @@ DefineConsoleMethod( GuiCanvas, isMinimized, bool, (), , "()" ) return false; } -DefineConsoleMethod( GuiCanvas, isMaximized, bool, (), , "()" ) +DefineEngineMethod( GuiCanvas, isMaximized, bool, (), , "()" ) { PlatformWindow* window = object->getPlatformWindow(); if ( window ) @@ -2683,21 +2683,21 @@ DefineConsoleMethod( GuiCanvas, isMaximized, bool, (), , "()" ) return false; } -DefineConsoleMethod( GuiCanvas, maximizeWindow, void, (), , "() - maximize this canvas' window." ) +DefineEngineMethod( GuiCanvas, maximizeWindow, void, (), , "() - maximize this canvas' window." ) { PlatformWindow* window = object->getPlatformWindow(); if ( window ) window->maximize(); } -DefineConsoleMethod( GuiCanvas, restoreWindow, void, (), , "() - restore this canvas' window." ) +DefineEngineMethod( GuiCanvas, restoreWindow, void, (), , "() - restore this canvas' window." ) { PlatformWindow* window = object->getPlatformWindow(); if( window ) window->restore(); } -DefineConsoleMethod( GuiCanvas, setFocus, void, (), , "() - Claim OS input focus for this canvas' window.") +DefineEngineMethod( GuiCanvas, setFocus, void, (), , "() - Claim OS input focus for this canvas' window.") { PlatformWindow* window = object->getPlatformWindow(); if( window ) @@ -2712,7 +2712,7 @@ DefineEngineMethod( GuiCanvas, setMenuBar, void, ( GuiControl* menu ),, return object->setMenuBar( menu ); } -DefineConsoleMethod( GuiCanvas, setVideoMode, void, +DefineEngineMethod( GuiCanvas, setVideoMode, void, (U32 width, U32 height, bool fullscreen, U32 bitDepth, U32 refreshRate, U32 antialiasLevel), ( false, 0, 0, 0), "(int width, int height, bool fullscreen, [int bitDepth], [int refreshRate], [int antialiasLevel] )\n" diff --git a/Engine/source/gui/core/guiControl.cpp b/Engine/source/gui/core/guiControl.cpp index 6fded2e92..5526c2cc6 100644 --- a/Engine/source/gui/core/guiControl.cpp +++ b/Engine/source/gui/core/guiControl.cpp @@ -2898,7 +2898,7 @@ static ConsoleDocFragment _sGuiControlSetExtent2( "GuiControl", // The class to place the method in; use NULL for functions. "void setExtent( Point2I p );" ); // The definition string. -DefineConsoleMethod( GuiControl, setExtent, void, ( const char* extOrX, const char* y ), (""), +DefineEngineMethod( GuiControl, setExtent, void, ( const char* extOrX, const char* y ), (""), "( Point2I p | int x, int y ) Set the width and height of the control.\n\n" "@hide" ) { diff --git a/Engine/source/gui/editor/guiDebugger.cpp b/Engine/source/gui/editor/guiDebugger.cpp index fb888538a..7c60d4359 100644 --- a/Engine/source/gui/editor/guiDebugger.cpp +++ b/Engine/source/gui/editor/guiDebugger.cpp @@ -66,13 +66,13 @@ DbgFileView::DbgFileView() mSize.set(1, 0); } -DefineConsoleMethod(DbgFileView, setCurrentLine, void, (S32 line, bool selected), , "(int line, bool selected)" +DefineEngineMethod(DbgFileView, setCurrentLine, void, (S32 line, bool selected), , "(int line, bool selected)" "Set the current highlighted line.") { object->setCurrentLine(line, selected); } -DefineConsoleMethod(DbgFileView, getCurrentLine, const char *, (), , "()" +DefineEngineMethod(DbgFileView, getCurrentLine, const char *, (), , "()" "Get the currently executing file and line, if any.\n\n" "@returns A string containing the file, a tab, and then the line number." " Use getField() with this.") @@ -84,38 +84,38 @@ DefineConsoleMethod(DbgFileView, getCurrentLine, const char *, (), , "()" return ret; } -DefineConsoleMethod(DbgFileView, open, bool, (const char * filename), , "(string filename)" +DefineEngineMethod(DbgFileView, open, bool, (const char * filename), , "(string filename)" "Open a file for viewing.\n\n" "@note This loads the file from the local system.") { return object->openFile(filename); } -DefineConsoleMethod(DbgFileView, clearBreakPositions, void, (), , "()" +DefineEngineMethod(DbgFileView, clearBreakPositions, void, (), , "()" "Clear all break points in the current file.") { object->clearBreakPositions(); } -DefineConsoleMethod(DbgFileView, setBreakPosition, void, (U32 line), , "(int line)" +DefineEngineMethod(DbgFileView, setBreakPosition, void, (U32 line), , "(int line)" "Set a breakpoint at the specified line.") { object->setBreakPosition(line); } -DefineConsoleMethod(DbgFileView, setBreak, void, (U32 line), , "(int line)" +DefineEngineMethod(DbgFileView, setBreak, void, (U32 line), , "(int line)" "Set a breakpoint at the specified line.") { object->setBreakPointStatus(line, true); } -DefineConsoleMethod(DbgFileView, removeBreak, void, (U32 line), , "(int line)" +DefineEngineMethod(DbgFileView, removeBreak, void, (U32 line), , "(int line)" "Remove a breakpoint from the specified line.") { object->setBreakPointStatus(line, false); } -DefineConsoleMethod(DbgFileView, findString, bool, (const char * findThis), , "(string findThis)" +DefineEngineMethod(DbgFileView, findString, bool, (const char * findThis), , "(string findThis)" "Find the specified string in the currently viewed file and " "scroll it into view.") { diff --git a/Engine/source/gui/editor/guiEditCtrl.cpp b/Engine/source/gui/editor/guiEditCtrl.cpp index 6eb290142..be4179421 100644 --- a/Engine/source/gui/editor/guiEditCtrl.cpp +++ b/Engine/source/gui/editor/guiEditCtrl.cpp @@ -2468,7 +2468,7 @@ void GuiEditCtrl::startMouseGuideDrag( guideAxis axis, U32 guideIndex, bool lock //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, getContentControl, S32, (), , "() - Return the toplevel control edited inside the GUI editor." ) +DefineEngineMethod( GuiEditCtrl, getContentControl, S32, (), , "() - Return the toplevel control edited inside the GUI editor." ) { GuiControl* ctrl = object->getContentControl(); if( ctrl ) @@ -2479,7 +2479,7 @@ DefineConsoleMethod( GuiEditCtrl, getContentControl, S32, (), , "() - Return the //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, setContentControl, void, (GuiControl *ctrl ), , "( GuiControl ctrl ) - Set the toplevel control to edit in the GUI editor." ) +DefineEngineMethod( GuiEditCtrl, setContentControl, void, (GuiControl *ctrl ), , "( GuiControl ctrl ) - Set the toplevel control to edit in the GUI editor." ) { if (ctrl) object->setContentControl(ctrl); @@ -2487,7 +2487,7 @@ DefineConsoleMethod( GuiEditCtrl, setContentControl, void, (GuiControl *ctrl ), //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, addNewCtrl, void, (GuiControl *ctrl), , "(GuiControl ctrl)") +DefineEngineMethod( GuiEditCtrl, addNewCtrl, void, (GuiControl *ctrl), , "(GuiControl ctrl)") { if (ctrl) object->addNewControl(ctrl); @@ -2495,28 +2495,28 @@ DefineConsoleMethod( GuiEditCtrl, addNewCtrl, void, (GuiControl *ctrl), , "(GuiC //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, addSelection, void, (S32 id), , "selects a control.") +DefineEngineMethod( GuiEditCtrl, addSelection, void, (S32 id), , "selects a control.") { object->addSelection(id); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, removeSelection, void, (S32 id), , "deselects a control.") +DefineEngineMethod( GuiEditCtrl, removeSelection, void, (S32 id), , "deselects a control.") { object->removeSelection(id); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, clearSelection, void, (), , "Clear selected controls list.") +DefineEngineMethod( GuiEditCtrl, clearSelection, void, (), , "Clear selected controls list.") { object->clearSelection(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, select, void, (GuiControl *ctrl), , "(GuiControl ctrl)") +DefineEngineMethod( GuiEditCtrl, select, void, (GuiControl *ctrl), , "(GuiControl ctrl)") { if (ctrl) object->setSelection(ctrl, false); @@ -2524,7 +2524,7 @@ DefineConsoleMethod( GuiEditCtrl, select, void, (GuiControl *ctrl), , "(GuiContr //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, setCurrentAddSet, void, (GuiControl *addSet), , "(GuiControl ctrl)") +DefineEngineMethod( GuiEditCtrl, setCurrentAddSet, void, (GuiControl *addSet), , "(GuiControl ctrl)") { if (addSet) object->setCurrentAddSet(addSet); @@ -2532,7 +2532,7 @@ DefineConsoleMethod( GuiEditCtrl, setCurrentAddSet, void, (GuiControl *addSet), //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, getCurrentAddSet, S32, (), , "Returns the set to which new controls will be added") +DefineEngineMethod( GuiEditCtrl, getCurrentAddSet, S32, (), , "Returns the set to which new controls will be added") { const GuiControl* add = object->getCurrentAddSet(); return add ? add->getId() : 0; @@ -2540,49 +2540,49 @@ DefineConsoleMethod( GuiEditCtrl, getCurrentAddSet, S32, (), , "Returns the set //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, toggle, void, (), , "Toggle activation.") +DefineEngineMethod( GuiEditCtrl, toggle, void, (), , "Toggle activation.") { object->setEditMode( !object->isActive() ); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, justify, void, (U32 mode), , "(int mode)" ) +DefineEngineMethod( GuiEditCtrl, justify, void, (U32 mode), , "(int mode)" ) { object->justifySelection( (GuiEditCtrl::Justification)mode ); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, bringToFront, void, (), , "") +DefineEngineMethod( GuiEditCtrl, bringToFront, void, (), , "") { object->bringToFront(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, pushToBack, void, (), , "") +DefineEngineMethod( GuiEditCtrl, pushToBack, void, (), , "") { object->pushToBack(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, deleteSelection, void, (), , "() - Delete the selected controls.") +DefineEngineMethod( GuiEditCtrl, deleteSelection, void, (), , "() - Delete the selected controls.") { object->deleteSelection(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, moveSelection, void, (S32 dx, S32 dy), , "Move all controls in the selection by (dx,dy) pixels.") +DefineEngineMethod( GuiEditCtrl, moveSelection, void, (S32 dx, S32 dy), , "Move all controls in the selection by (dx,dy) pixels.") { object->moveAndSnapSelection(Point2I(dx, dy)); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, saveSelection, void, (const char * filename), (nullAsType()), "( string fileName=null ) - Save selection to file or clipboard.") +DefineEngineMethod( GuiEditCtrl, saveSelection, void, (const char * filename), (nullAsType()), "( string fileName=null ) - Save selection to file or clipboard.") { object->saveSelection( filename ); @@ -2590,7 +2590,7 @@ DefineConsoleMethod( GuiEditCtrl, saveSelection, void, (const char * filename), //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, loadSelection, void, (const char * filename), (nullAsType()), "( string fileName=null ) - Load selection from file or clipboard.") +DefineEngineMethod( GuiEditCtrl, loadSelection, void, (const char * filename), (nullAsType()), "( string fileName=null ) - Load selection from file or clipboard.") { object->loadSelection( filename ); @@ -2598,7 +2598,7 @@ DefineConsoleMethod( GuiEditCtrl, loadSelection, void, (const char * filename), //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, selectAll, void, (), , "()") +DefineEngineMethod( GuiEditCtrl, selectAll, void, (), , "()") { object->selectAll(); } @@ -2613,14 +2613,14 @@ DefineEngineMethod( GuiEditCtrl, getSelection, SimSet*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, getNumSelected, S32, (), , "() - Return the number of controls currently selected." ) +DefineEngineMethod( GuiEditCtrl, getNumSelected, S32, (), , "() - Return the number of controls currently selected." ) { return object->getNumSelected(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, getSelectionGlobalBounds, const char*, (), , "() - Returns global bounds of current selection as vector 'x y width height'." ) +DefineEngineMethod( GuiEditCtrl, getSelectionGlobalBounds, const char*, (), , "() - Returns global bounds of current selection as vector 'x y width height'." ) { RectI bounds = object->getSelectionGlobalBounds(); String str = String::ToString( "%i %i %i %i", bounds.point.x, bounds.point.y, bounds.extent.x, bounds.extent.y ); @@ -2633,7 +2633,7 @@ DefineConsoleMethod( GuiEditCtrl, getSelectionGlobalBounds, const char*, (), , " //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, selectParents, void, ( bool addToSelection ), (false), "( bool addToSelection=false ) - Select parents of currently selected controls." ) +DefineEngineMethod( GuiEditCtrl, selectParents, void, ( bool addToSelection ), (false), "( bool addToSelection=false ) - Select parents of currently selected controls." ) { object->selectParents( addToSelection ); @@ -2641,7 +2641,7 @@ DefineConsoleMethod( GuiEditCtrl, selectParents, void, ( bool addToSelection ), //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, selectChildren, void, ( bool addToSelection ), (false), "( bool addToSelection=false ) - Select children of currently selected controls." ) +DefineEngineMethod( GuiEditCtrl, selectChildren, void, ( bool addToSelection ), (false), "( bool addToSelection=false ) - Select children of currently selected controls." ) { object->selectChildren( addToSelection ); @@ -2657,14 +2657,14 @@ DefineEngineMethod( GuiEditCtrl, getTrash, SimGroup*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod(GuiEditCtrl, setSnapToGrid, void, (U32 gridsize), , "GuiEditCtrl.setSnapToGrid(gridsize)") +DefineEngineMethod(GuiEditCtrl, setSnapToGrid, void, (U32 gridsize), , "GuiEditCtrl.setSnapToGrid(gridsize)") { object->setSnapToGrid(gridsize); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, readGuides, void, ( GuiControl* ctrl, S32 axis ), (-1), "( GuiControl ctrl [, int axis ] ) - Read the guides from the given control." ) +DefineEngineMethod( GuiEditCtrl, readGuides, void, ( GuiControl* ctrl, S32 axis ), (-1), "( GuiControl ctrl [, int axis ] ) - Read the guides from the given control." ) { // Find the control. @@ -2694,7 +2694,7 @@ DefineConsoleMethod( GuiEditCtrl, readGuides, void, ( GuiControl* ctrl, S32 axis //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, writeGuides, void, ( GuiControl* ctrl, S32 axis ), ( -1), "( GuiControl ctrl [, int axis ] ) - Write the guides to the given control." ) +DefineEngineMethod( GuiEditCtrl, writeGuides, void, ( GuiControl* ctrl, S32 axis ), ( -1), "( GuiControl ctrl [, int axis ] ) - Write the guides to the given control." ) { // Find the control. @@ -2724,7 +2724,7 @@ DefineConsoleMethod( GuiEditCtrl, writeGuides, void, ( GuiControl* ctrl, S32 axi //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, clearGuides, void, ( S32 axis ), (-1), "( [ int axis ] ) - Clear all currently set guide lines." ) +DefineEngineMethod( GuiEditCtrl, clearGuides, void, ( S32 axis ), (-1), "( [ int axis ] ) - Clear all currently set guide lines." ) { if( axis != -1 ) { @@ -2745,7 +2745,7 @@ DefineConsoleMethod( GuiEditCtrl, clearGuides, void, ( S32 axis ), (-1), "( [ in //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, fitIntoParents, void, (bool width, bool height), (true, true), "( bool width=true, bool height=true ) - Fit selected controls into their parents." ) +DefineEngineMethod( GuiEditCtrl, fitIntoParents, void, (bool width, bool height), (true, true), "( bool width=true, bool height=true ) - Fit selected controls into their parents." ) { object->fitIntoParents( width, height ); @@ -2753,7 +2753,7 @@ DefineConsoleMethod( GuiEditCtrl, fitIntoParents, void, (bool width, bool height //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, getMouseMode, const char*, (), , "() - Return the current mouse mode." ) +DefineEngineMethod( GuiEditCtrl, getMouseMode, const char*, (), , "() - Return the current mouse mode." ) { switch( object->getMouseMode() ) { diff --git a/Engine/source/gui/editor/guiFilterCtrl.cpp b/Engine/source/gui/editor/guiFilterCtrl.cpp index 67a0232ae..c0d9c2a72 100644 --- a/Engine/source/gui/editor/guiFilterCtrl.cpp +++ b/Engine/source/gui/editor/guiFilterCtrl.cpp @@ -60,7 +60,7 @@ void GuiFilterCtrl::initPersistFields() Parent::initPersistFields(); } -DefineConsoleMethod( GuiFilterCtrl, getValue, const char*, (), , "Return a tuple containing all the values in the filter." +DefineEngineMethod( GuiFilterCtrl, getValue, const char*, (), , "Return a tuple containing all the values in the filter." "@internal") { static char buffer[512]; @@ -89,7 +89,7 @@ ConsoleMethod( GuiFilterCtrl, setValue, void, 3, 20, "(f1, f2, ...)" object->set(filter); } -DefineConsoleMethod( GuiFilterCtrl, identity, void, (), , "Reset the filtering." +DefineEngineMethod( GuiFilterCtrl, identity, void, (), , "Reset the filtering." "@internal") { object->identity(); diff --git a/Engine/source/gui/editor/guiMenuBar.cpp b/Engine/source/gui/editor/guiMenuBar.cpp index dc168436b..efe534358 100644 --- a/Engine/source/gui/editor/guiMenuBar.cpp +++ b/Engine/source/gui/editor/guiMenuBar.cpp @@ -1486,7 +1486,7 @@ PopupMenu* GuiMenuBar::findMenu(StringTableEntry barTitle) //----------------------------------------------------------------------------- // Console Methods //----------------------------------------------------------------------------- -DefineConsoleMethod(GuiMenuBar, attachToCanvas, void, (const char *canvas, S32 pos), , "(GuiCanvas, pos)") +DefineEngineMethod(GuiMenuBar, attachToCanvas, void, (const char *canvas, S32 pos), , "(GuiCanvas, pos)") { GuiCanvas* canv = dynamic_cast(Sim::findObject(canvas)); if (canv) @@ -1495,7 +1495,7 @@ DefineConsoleMethod(GuiMenuBar, attachToCanvas, void, (const char *canvas, S32 p } } -DefineConsoleMethod(GuiMenuBar, removeFromCanvas, void, (), , "()") +DefineEngineMethod(GuiMenuBar, removeFromCanvas, void, (), , "()") { GuiCanvas* canvas = object->getRoot(); @@ -1503,23 +1503,23 @@ DefineConsoleMethod(GuiMenuBar, removeFromCanvas, void, (), , "()") canvas->setMenuBar(nullptr); } -DefineConsoleMethod(GuiMenuBar, getMenuCount, S32, (), , "()") +DefineEngineMethod(GuiMenuBar, getMenuCount, S32, (), , "()") { return object->getMenuListCount(); } -DefineConsoleMethod(GuiMenuBar, getMenu, S32, (S32 index), (0), "(Index)") +DefineEngineMethod(GuiMenuBar, getMenu, S32, (S32 index), (0), "(Index)") { return object->getMenu(index)->getId(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(GuiMenuBar, insert, void, (SimObject* pObject, S32 pos), (nullAsType(), -1), "(object, pos) insert object at position") +DefineEngineMethod(GuiMenuBar, insert, void, (SimObject* pObject, S32 pos), (nullAsType(), -1), "(object, pos) insert object at position") { object->insert(pObject, pos); } -DefineConsoleMethod(GuiMenuBar, findMenu, S32, (const char* barTitle), (""), "(barTitle)") +DefineEngineMethod(GuiMenuBar, findMenu, S32, (const char* barTitle), (""), "(barTitle)") { StringTableEntry barTitleStr = StringTable->insert(barTitle); PopupMenu* menu = object->findMenu(barTitleStr); diff --git a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp index 342646fb1..4b71a1518 100644 --- a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp @@ -1004,7 +1004,7 @@ bool GuiParticleGraphCtrl::renderGraphTooltip(Point2I cursorPos, StringTableEntr return true; } -DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPoint, void, (S32 point), , "(int point)" +DefineEngineMethod(GuiParticleGraphCtrl, setSelectedPoint, void, (S32 point), , "(int point)" "Set the selected point on the graph.\n" "@return No return value") { @@ -1016,7 +1016,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPoint, void, (S32 point), , object->setSelectedPoint( point ); } -DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPlot, void, (S32 plotID), , "(int plotID)" +DefineEngineMethod(GuiParticleGraphCtrl, setSelectedPlot, void, (S32 plotID), , "(int plotID)" "Set the selected plot (a.k.a. graph)." "@return No return value" ) { @@ -1028,7 +1028,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPlot, void, (S32 plotID), , object->setSelectedPlot( plotID ); } -DefineConsoleMethod(GuiParticleGraphCtrl, clearGraph, void, (S32 plotID), , "(int plotID)" +DefineEngineMethod(GuiParticleGraphCtrl, clearGraph, void, (S32 plotID), , "(int plotID)" "Clear the graph of the given plot." "@return No return value") { @@ -1040,14 +1040,14 @@ DefineConsoleMethod(GuiParticleGraphCtrl, clearGraph, void, (S32 plotID), , "(in object->clearGraph( plotID ); } -DefineConsoleMethod(GuiParticleGraphCtrl, clearAllGraphs, void, (), , "()" +DefineEngineMethod(GuiParticleGraphCtrl, clearAllGraphs, void, (), , "()" "Clear all of the graphs." "@return No return value") { object->clearAllGraphs(); } -DefineConsoleMethod(GuiParticleGraphCtrl, addPlotPoint, S32, (S32 plotID, F32 x, F32 y, bool setAdded), (true), "(int plotID, float x, float y, bool setAdded = true;)" +DefineEngineMethod(GuiParticleGraphCtrl, addPlotPoint, S32, (S32 plotID, F32 x, F32 y, bool setAdded), (true), "(int plotID, float x, float y, bool setAdded = true;)" "Add a data point to the given plot." "@return") { @@ -1060,7 +1060,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, addPlotPoint, S32, (S32 plotID, F32 x, return object->addPlotPoint( plotID, Point2F(x, y), setAdded); } -DefineConsoleMethod(GuiParticleGraphCtrl, insertPlotPoint, void, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)\n" +DefineEngineMethod(GuiParticleGraphCtrl, insertPlotPoint, void, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)\n" "Insert a data point to the given plot and plot position.\n" "@param plotID The plot you want to access\n" "@param i The data point.\n" @@ -1075,7 +1075,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, insertPlotPoint, void, (S32 plotID, S3 object->insertPlotPoint( plotID, i, Point2F(x, y)); } -DefineConsoleMethod(GuiParticleGraphCtrl, changePlotPoint, S32, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)" +DefineEngineMethod(GuiParticleGraphCtrl, changePlotPoint, S32, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)" "Change a data point to the given plot and plot position.\n" "@param plotID The plot you want to access\n" "@param i The data point.\n" @@ -1090,21 +1090,21 @@ DefineConsoleMethod(GuiParticleGraphCtrl, changePlotPoint, S32, (S32 plotID, S32 return object->changePlotPoint( plotID, i, Point2F(x, y)); } -DefineConsoleMethod(GuiParticleGraphCtrl, getSelectedPlot, S32, (), , "() " +DefineEngineMethod(GuiParticleGraphCtrl, getSelectedPlot, S32, (), , "() " "Gets the selected Plot (a.k.a. graph).\n" "@return The plot's ID.") { return object->getSelectedPlot(); } -DefineConsoleMethod(GuiParticleGraphCtrl, getSelectedPoint, S32, (), , "()" +DefineEngineMethod(GuiParticleGraphCtrl, getSelectedPoint, S32, (), , "()" "Gets the selected Point on the Plot (a.k.a. graph)." "@return The last selected point ID") { return object->getSelectedPoint(); } -DefineConsoleMethod(GuiParticleGraphCtrl, isExistingPoint, bool, (S32 plotID, S32 samples), , "(int plotID, int samples)" +DefineEngineMethod(GuiParticleGraphCtrl, isExistingPoint, bool, (S32 plotID, S32 samples), , "(int plotID, int samples)" "@return Returns true or false whether or not the point in the plot passed is an existing point.") { @@ -1119,7 +1119,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, isExistingPoint, bool, (S32 plotID, S3 return object->isExistingPoint(plotID, samples); } -DefineConsoleMethod(GuiParticleGraphCtrl, getPlotPoint, Point2F, (S32 plotID, S32 samples), , "(int plotID, int samples)" +DefineEngineMethod(GuiParticleGraphCtrl, getPlotPoint, Point2F, (S32 plotID, S32 samples), , "(int plotID, int samples)" "Get a data point from the plot specified, samples from the start of the graph." "@return The data point ID") { @@ -1137,7 +1137,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getPlotPoint, Point2F, (S32 plotID, S3 return object->getPlotPoint(plotID, samples); } -DefineConsoleMethod(GuiParticleGraphCtrl, getPlotIndex, S32, (S32 plotID, F32 x, F32 y), , "(int plotID, float x, float y)\n" +DefineEngineMethod(GuiParticleGraphCtrl, getPlotIndex, S32, (S32 plotID, F32 x, F32 y), , "(int plotID, float x, float y)\n" "Gets the index of the point passed on the plotID passed (graph ID).\n" "@param plotID The plot you wish to check.\n" "@param x,y The coordinates of the point to get.\n" @@ -1151,7 +1151,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getPlotIndex, S32, (S32 plotID, F32 x, return object->getPlotIndex(plotID, x, y); } -DefineConsoleMethod(GuiParticleGraphCtrl, getGraphColor, LinearColorF, (S32 plotID), , "(int plotID)" +DefineEngineMethod(GuiParticleGraphCtrl, getGraphColor, LinearColorF, (S32 plotID), , "(int plotID)" "Get the color of the graph passed." "@return Returns the color of the graph as a string of RGB values formatted as \"R G B\"") { @@ -1165,7 +1165,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphColor, LinearColorF, (S32 plot } -DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMin, Point2F, (S32 plotID), , "(int plotID) " +DefineEngineMethod(GuiParticleGraphCtrl, getGraphMin, Point2F, (S32 plotID), , "(int plotID) " "Get the minimum values of the graph ranges.\n" "@return Returns the minimum of the range formatted as \"x-min y-min\"") { @@ -1177,7 +1177,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMin, Point2F, (S32 plotID), , return object->getGraphMin(plotID); } -DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMax, Point2F, (S32 plotID), , "(int plotID) " +DefineEngineMethod(GuiParticleGraphCtrl, getGraphMax, Point2F, (S32 plotID), , "(int plotID) " "Get the maximum values of the graph ranges.\n" "@return Returns the maximum of the range formatted as \"x-max y-max\"") { @@ -1190,7 +1190,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMax, Point2F, (S32 plotID), , } -DefineConsoleMethod(GuiParticleGraphCtrl, getGraphName, const char*, (S32 plotID), , "(int plotID) " +DefineEngineMethod(GuiParticleGraphCtrl, getGraphName, const char*, (S32 plotID), , "(int plotID) " "Get the name of the graph passed.\n" "@return Returns the name of the plot") { @@ -1207,7 +1207,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphName, const char*, (S32 plotID return retBuffer; } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMin, void, (S32 plotID, F32 minX, F32 minY), , "(int plotID, float minX, float minY) " +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMin, void, (S32 plotID, F32 minX, F32 minY), , "(int plotID, float minX, float minY) " "Set the min values of the graph of plotID.\n" "@param plotID The plot to modify\n" "@param minX,minY The minimum bound of the value range.\n" @@ -1223,7 +1223,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMin, void, (S32 plotID, F32 mi object->setGraphMin(plotID, Point2F(minX, minY)); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinX, void, (S32 plotID, F32 minX), , "(int plotID, float minX) " +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMinX, void, (S32 plotID, F32 minX), , "(int plotID, float minX) " "Set the min X value of the graph of plotID.\n" "@param plotID The plot to modify.\n" "@param minX The minimum x value.\n" @@ -1239,7 +1239,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinX, void, (S32 plotID, F32 m object->setGraphMinX(plotID, minX); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinY, void, (S32 plotID, F32 minX), , "(int plotID, float minY) " +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMinY, void, (S32 plotID, F32 minX), , "(int plotID, float minY) " "Set the min Y value of the graph of plotID." "@param plotID The plot to modify.\n" "@param minY The minimum y value.\n" @@ -1255,7 +1255,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinY, void, (S32 plotID, F32 m object->setGraphMinY(plotID, minX); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMax, void, (S32 plotID, F32 maxX, F32 maxY), , "(int plotID, float maxX, float maxY) " +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMax, void, (S32 plotID, F32 maxX, F32 maxY), , "(int plotID, float maxX, float maxY) " "Set the max values of the graph of plotID." "@param plotID The plot to modify\n" "@param maxX,maxY The maximum bound of the value range.\n" @@ -1271,7 +1271,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMax, void, (S32 plotID, F32 ma object->setGraphMax(plotID, Point2F(maxX, maxY)); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxX, void, (S32 plotID, F32 maxX), , "(int plotID, float maxX)" +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMaxX, void, (S32 plotID, F32 maxX), , "(int plotID, float maxX)" "Set the max X value of the graph of plotID." "@param plotID The plot to modify.\n" "@param maxX The maximum x value.\n" @@ -1287,7 +1287,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxX, void, (S32 plotID, F32 m object->setGraphMaxX(plotID, maxX); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxY, void, (S32 plotID, F32 maxX), , "(int plotID, float maxY)" +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMaxY, void, (S32 plotID, F32 maxX), , "(int plotID, float maxY)" "Set the max Y value of the graph of plotID." "@param plotID The plot to modify.\n" "@param maxY The maximum y value.\n" @@ -1303,7 +1303,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxY, void, (S32 plotID, F32 m object->setGraphMaxY(plotID, maxX); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphHidden, void, (S32 plotID, bool isHidden), , "(int plotID, bool isHidden)" +DefineEngineMethod(GuiParticleGraphCtrl, setGraphHidden, void, (S32 plotID, bool isHidden), , "(int plotID, bool isHidden)" "Set whether the graph number passed is hidden or not." "@return No return value.") { @@ -1317,7 +1317,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphHidden, void, (S32 plotID, boo object->setGraphHidden(plotID, isHidden); } -DefineConsoleMethod(GuiParticleGraphCtrl, setAutoGraphMax, void, (bool autoMax), , "(bool autoMax) " +DefineEngineMethod(GuiParticleGraphCtrl, setAutoGraphMax, void, (bool autoMax), , "(bool autoMax) " "Set whether the max will automatically be set when adding points " "(ie if you add a value over the current max, the max is increased to that value).\n" "@return No return value.") @@ -1325,35 +1325,35 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setAutoGraphMax, void, (bool autoMax), object->setAutoGraphMax(autoMax); } -DefineConsoleMethod(GuiParticleGraphCtrl, setAutoRemove, void, (bool autoRemove), , "(bool autoRemove) " +DefineEngineMethod(GuiParticleGraphCtrl, setAutoRemove, void, (bool autoRemove), , "(bool autoRemove) " "Set whether or not a point should be deleted when you drag another one over it." "@return No return value.") { object->setAutoRemove(autoRemove); } -DefineConsoleMethod(GuiParticleGraphCtrl, setRenderAll, void, (bool autoRemove), , "(bool renderAll)" +DefineEngineMethod(GuiParticleGraphCtrl, setRenderAll, void, (bool autoRemove), , "(bool renderAll)" "Set whether or not a position should be rendered on every point or just the last selected." "@return No return value.") { object->setRenderAll(autoRemove); } -DefineConsoleMethod(GuiParticleGraphCtrl, setPointXMovementClamped, void, (bool autoRemove), , "(bool clamped)" +DefineEngineMethod(GuiParticleGraphCtrl, setPointXMovementClamped, void, (bool autoRemove), , "(bool clamped)" "Set whether the x position of the selected graph point should be clamped" "@return No return value.") { object->setPointXMovementClamped(autoRemove); } -DefineConsoleMethod(GuiParticleGraphCtrl, setRenderGraphTooltip, void, (bool autoRemove), , "(bool renderGraphTooltip)" +DefineEngineMethod(GuiParticleGraphCtrl, setRenderGraphTooltip, void, (bool autoRemove), , "(bool renderGraphTooltip)" "Set whether or not to render the graph tooltip." "@return No return value.") { object->setRenderGraphTooltip(autoRemove); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphName, void, (S32 plotID, const char * graphName), , "(int plotID, string graphName) " +DefineEngineMethod(GuiParticleGraphCtrl, setGraphName, void, (S32 plotID, const char * graphName), , "(int plotID, string graphName) " "Set the name of the given plot.\n" "@param plotID The plot to modify.\n" "@param graphName The name to set on the plot.\n" @@ -1369,7 +1369,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphName, void, (S32 plotID, const object->setGraphName(plotID, graphName); } -DefineConsoleMethod(GuiParticleGraphCtrl, resetSelectedPoint, void, (), , "()" +DefineEngineMethod(GuiParticleGraphCtrl, resetSelectedPoint, void, (), , "()" "This will reset the currently selected point to nothing." "@return No return value.") { diff --git a/Engine/source/gui/editor/inspector/componentGroup.cpp b/Engine/source/gui/editor/inspector/componentGroup.cpp index 6e16db173..27aec03fa 100644 --- a/Engine/source/gui/editor/inspector/componentGroup.cpp +++ b/Engine/source/gui/editor/inspector/componentGroup.cpp @@ -524,7 +524,7 @@ ConsoleMethod(GuiInspectorComponentGroup, removeDynamicField, void, 3, 3, "") { } -DefineConsoleMethod(GuiInspectorComponentGroup, getComponent, S32, (), ,"") +DefineEngineMethod(GuiInspectorComponentGroup, getComponent, S32, (), ,"") { return object->getComponent()->getId(); } diff --git a/Engine/source/gui/editor/inspector/dynamicField.cpp b/Engine/source/gui/editor/inspector/dynamicField.cpp index d028a6c7a..092af36f4 100644 --- a/Engine/source/gui/editor/inspector/dynamicField.cpp +++ b/Engine/source/gui/editor/inspector/dynamicField.cpp @@ -316,7 +316,7 @@ void GuiInspectorDynamicField::_executeSelectedCallback() Con::executef( mInspector, "onFieldSelected", mDynField->slotName, "TypeDynamicField" ); } -DefineConsoleMethod( GuiInspectorDynamicField, renameField, void, (const char* newDynamicFieldName),, "field.renameField(newDynamicFieldName);" ) +DefineEngineMethod( GuiInspectorDynamicField, renameField, void, (const char* newDynamicFieldName),, "field.renameField(newDynamicFieldName);" ) { object->renameField( newDynamicFieldName ); } diff --git a/Engine/source/gui/editor/inspector/dynamicGroup.cpp b/Engine/source/gui/editor/inspector/dynamicGroup.cpp index 3d9879919..931a00836 100644 --- a/Engine/source/gui/editor/inspector/dynamicGroup.cpp +++ b/Engine/source/gui/editor/inspector/dynamicGroup.cpp @@ -188,7 +188,7 @@ void GuiInspectorDynamicGroup::updateAllFields() inspectGroup(); } -DefineConsoleMethod(GuiInspectorDynamicGroup, inspectGroup, bool, (), , "Refreshes the dynamic fields in the inspector.") +DefineEngineMethod(GuiInspectorDynamicGroup, inspectGroup, bool, (), , "Refreshes the dynamic fields in the inspector.") { return object->inspectGroup(); } @@ -263,11 +263,11 @@ void GuiInspectorDynamicGroup::addDynamicField() instantExpand(); } -DefineConsoleMethod( GuiInspectorDynamicGroup, addDynamicField, void, (), , "obj.addDynamicField();" ) +DefineEngineMethod( GuiInspectorDynamicGroup, addDynamicField, void, (), , "obj.addDynamicField();" ) { object->addDynamicField(); } -DefineConsoleMethod( GuiInspectorDynamicGroup, removeDynamicField, void, (), , "" ) +DefineEngineMethod( GuiInspectorDynamicGroup, removeDynamicField, void, (), , "" ) { } diff --git a/Engine/source/gui/editor/inspector/field.cpp b/Engine/source/gui/editor/inspector/field.cpp index f8efaca02..2808ee140 100644 --- a/Engine/source/gui/editor/inspector/field.cpp +++ b/Engine/source/gui/editor/inspector/field.cpp @@ -688,59 +688,59 @@ void GuiInspectorField::_setFieldDocs( StringTableEntry docs ) //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, getInspector, S32, (), , "() - Return the GuiInspector to which this field belongs." ) +DefineEngineMethod( GuiInspectorField, getInspector, S32, (), , "() - Return the GuiInspector to which this field belongs." ) { return object->getInspector()->getId(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, getInspectedFieldName, const char*, (), , "() - Return the name of the field edited by this inspector field." ) +DefineEngineMethod( GuiInspectorField, getInspectedFieldName, const char*, (), , "() - Return the name of the field edited by this inspector field." ) { return object->getFieldName(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, getInspectedFieldType, const char*, (), , "() - Return the type of the field edited by this inspector field." ) +DefineEngineMethod( GuiInspectorField, getInspectedFieldType, const char*, (), , "() - Return the type of the field edited by this inspector field." ) { return object->getFieldType(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, apply, void, ( const char * newValue, bool callbacks ), (true), "( string newValue, bool callbacks=true ) - Set the field's value. Suppress callbacks for undo if callbacks=false." ) +DefineEngineMethod( GuiInspectorField, apply, void, ( const char * newValue, bool callbacks ), (true), "( string newValue, bool callbacks=true ) - Set the field's value. Suppress callbacks for undo if callbacks=false." ) { object->setData( newValue, callbacks ); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, applyWithoutUndo, void, (const char * data), , "() - Set field value without recording undo (same as 'apply( value, false )')." ) +DefineEngineMethod( GuiInspectorField, applyWithoutUndo, void, (const char * data), , "() - Set field value without recording undo (same as 'apply( value, false )')." ) { object->setData( data, false ); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, getData, const char*, (), , "() - Return the value currently displayed on the field." ) +DefineEngineMethod( GuiInspectorField, getData, const char*, (), , "() - Return the value currently displayed on the field." ) { return object->getData(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, reset, void, (), , "() - Reset to default value." ) +DefineEngineMethod( GuiInspectorField, reset, void, (), , "() - Reset to default value." ) { object->resetData(); } -DefineConsoleMethod(GuiInspectorField, setCaption, void, (String newCaption),, "() - Reset to default value.") +DefineEngineMethod(GuiInspectorField, setCaption, void, (String newCaption),, "() - Reset to default value.") { object->setCaption(StringTable->insert(newCaption.c_str())); } -DefineConsoleMethod(GuiInspectorField, setEditControl, void, (GuiControl* editCtrl), (nullAsType()), "() - Reset to default value.") +DefineEngineMethod(GuiInspectorField, setEditControl, void, (GuiControl* editCtrl), (nullAsType()), "() - Reset to default value.") { object->setEditControl(editCtrl); } diff --git a/Engine/source/gui/editor/inspector/variableGroup.cpp b/Engine/source/gui/editor/inspector/variableGroup.cpp index 83e4f3c32..cb23d9c6e 100644 --- a/Engine/source/gui/editor/inspector/variableGroup.cpp +++ b/Engine/source/gui/editor/inspector/variableGroup.cpp @@ -250,12 +250,12 @@ GuiInspectorField* GuiInspectorVariableGroup::createInspectorField() return NULL; } -DefineConsoleMethod(GuiInspectorVariableGroup, createInspectorField, GuiInspectorField*, (),, "createInspectorField()") +DefineEngineMethod(GuiInspectorVariableGroup, createInspectorField, GuiInspectorField*, (),, "createInspectorField()") { return object->createInspectorField(); } -DefineConsoleMethod(GuiInspectorVariableGroup, addInspectorField, void, (GuiInspectorField* field), (nullAsType()), "addInspectorField( GuiInspectorFieldObject )") +DefineEngineMethod(GuiInspectorVariableGroup, addInspectorField, void, (GuiInspectorField* field), (nullAsType()), "addInspectorField( GuiInspectorFieldObject )") { object->addInspectorField(field); } \ No newline at end of file diff --git a/Engine/source/gui/editor/inspector/variableInspector.cpp b/Engine/source/gui/editor/inspector/variableInspector.cpp index 115e48b83..10d640fc9 100644 --- a/Engine/source/gui/editor/inspector/variableInspector.cpp +++ b/Engine/source/gui/editor/inspector/variableInspector.cpp @@ -216,17 +216,17 @@ void GuiVariableInspector::setFieldEnabled(const char* name, bool enabled) } } -DefineConsoleMethod(GuiVariableInspector, startGroup, void, (const char* name),, "startGroup( groupName )") +DefineEngineMethod(GuiVariableInspector, startGroup, void, (const char* name),, "startGroup( groupName )") { object->startGroup(name); } -DefineConsoleMethod(GuiVariableInspector, endGroup, void, (),, "endGroup()") +DefineEngineMethod(GuiVariableInspector, endGroup, void, (),, "endGroup()") { object->endGroup(); } -DefineConsoleMethod(GuiVariableInspector, addField, void, (const char* name, const char* label, const char* typeName, +DefineEngineMethod(GuiVariableInspector, addField, void, (const char* name, const char* label, const char* typeName, const char* description, const char* defaultValue, const char* dataValues, SimObject* ownerObj), ("","","","","", "", nullAsType()), "addField( fieldName/varName, fieldLabel, fieldTypeName, description, defaultValue, defaultValues, ownerObject )") { @@ -236,7 +236,7 @@ DefineConsoleMethod(GuiVariableInspector, addField, void, (const char* name, con object->addField(name, label, typeName, description, defaultValue, dataValues, ownerObj); } -DefineConsoleMethod(GuiVariableInspector, addCallbackField, void, (const char* name, const char* label, const char* typeName, +DefineEngineMethod(GuiVariableInspector, addCallbackField, void, (const char* name, const char* label, const char* typeName, const char* description, const char* defaultValue, const char* dataValues, const char* callbackName, SimObject* ownerObj), ("", "", "", "", "", "", nullAsType()), "addField( fieldName/varName, fieldLabel, fieldTypeName, description, defaultValue, defaultValues, callbackName, ownerObject )") { @@ -246,22 +246,22 @@ DefineConsoleMethod(GuiVariableInspector, addCallbackField, void, (const char* n object->addCallbackField(name, label, typeName, description, defaultValue, dataValues, callbackName, ownerObj); } -DefineConsoleMethod(GuiVariableInspector, update, void, (), , "update()") +DefineEngineMethod(GuiVariableInspector, update, void, (), , "update()") { object->update(); } -DefineConsoleMethod(GuiVariableInspector, clearFields, void, (), , "clearFields()") +DefineEngineMethod(GuiVariableInspector, clearFields, void, (), , "clearFields()") { object->clearFields(); } -DefineConsoleMethod(GuiVariableInspector, setFieldEnabled, void, (const char* fieldName, bool isEnabled), (true), "setFieldEnabled( fieldName, isEnabled )") +DefineEngineMethod(GuiVariableInspector, setFieldEnabled, void, (const char* fieldName, bool isEnabled), (true), "setFieldEnabled( fieldName, isEnabled )") { object->setFieldEnabled(fieldName, isEnabled); } -DefineConsoleMethod( GuiVariableInspector, loadVars, void, ( const char * searchString ), , "loadVars( searchString )" ) +DefineEngineMethod( GuiVariableInspector, loadVars, void, ( const char * searchString ), , "loadVars( searchString )" ) { object->loadVars( searchString ); } \ No newline at end of file diff --git a/Engine/source/gui/editor/popupMenu.cpp b/Engine/source/gui/editor/popupMenu.cpp index 0e5db18da..4dac1525e 100644 --- a/Engine/source/gui/editor/popupMenu.cpp +++ b/Engine/source/gui/editor/popupMenu.cpp @@ -445,17 +445,17 @@ void PopupMenu::hidePopupSubmenus() //----------------------------------------------------------------------------- // Console Methods //----------------------------------------------------------------------------- -DefineConsoleMethod(PopupMenu, insertItem, S32, (S32 pos, const char * title, const char * accelerator, const char* cmd), ("", "", ""), "(pos[, title][, accelerator][, cmd])") +DefineEngineMethod(PopupMenu, insertItem, S32, (S32 pos, const char * title, const char * accelerator, const char* cmd), ("", "", ""), "(pos[, title][, accelerator][, cmd])") { return object->insertItem(pos, title, accelerator, cmd); } -DefineConsoleMethod(PopupMenu, removeItem, void, (S32 pos), , "(pos)") +DefineEngineMethod(PopupMenu, removeItem, void, (S32 pos), , "(pos)") { object->removeItem(pos); } -DefineConsoleMethod(PopupMenu, insertSubMenu, S32, (S32 pos, String title, String subMenu), , "(pos, title, subMenu)") +DefineEngineMethod(PopupMenu, insertSubMenu, S32, (S32 pos, String title, String subMenu), , "(pos, title, subMenu)") { PopupMenu *mnu = dynamic_cast(Sim::findObject(subMenu)); if(mnu == NULL) @@ -466,40 +466,40 @@ DefineConsoleMethod(PopupMenu, insertSubMenu, S32, (S32 pos, String title, Strin return object->insertSubMenu(pos, title, mnu); } -DefineConsoleMethod(PopupMenu, setItem, bool, (S32 pos, const char * title, const char * accelerator, const char *cmd), (""), "(pos, title[, accelerator][, cmd])") +DefineEngineMethod(PopupMenu, setItem, bool, (S32 pos, const char * title, const char * accelerator, const char *cmd), (""), "(pos, title[, accelerator][, cmd])") { return object->setItem(pos, title, accelerator, cmd); } //----------------------------------------------------------------------------- -DefineConsoleMethod(PopupMenu, enableItem, void, (S32 pos, bool enabled), , "(pos, enabled)") +DefineEngineMethod(PopupMenu, enableItem, void, (S32 pos, bool enabled), , "(pos, enabled)") { object->enableItem(pos, enabled); } -DefineConsoleMethod(PopupMenu, checkItem, void, (S32 pos, bool checked), , "(pos, checked)") +DefineEngineMethod(PopupMenu, checkItem, void, (S32 pos, bool checked), , "(pos, checked)") { object->checkItem(pos, checked); } -DefineConsoleMethod(PopupMenu, checkRadioItem, void, (S32 firstPos, S32 lastPos, S32 checkPos), , "(firstPos, lastPos, checkPos)") +DefineEngineMethod(PopupMenu, checkRadioItem, void, (S32 firstPos, S32 lastPos, S32 checkPos), , "(firstPos, lastPos, checkPos)") { object->checkRadioItem(firstPos, lastPos, checkPos); } -DefineConsoleMethod(PopupMenu, isItemChecked, bool, (S32 pos), , "(pos)") +DefineEngineMethod(PopupMenu, isItemChecked, bool, (S32 pos), , "(pos)") { return object->isItemChecked(pos); } -DefineConsoleMethod(PopupMenu, getItemCount, S32, (), , "()") +DefineEngineMethod(PopupMenu, getItemCount, S32, (), , "()") { return object->getItemCount(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(PopupMenu, showPopup, void, (const char * canvasName, S32 x, S32 y), ( -1, -1), "(Canvas,[x, y])") +DefineEngineMethod(PopupMenu, showPopup, void, (const char * canvasName, S32 x, S32 y), ( -1, -1), "(Canvas,[x, y])") { GuiCanvas *pCanvas = dynamic_cast(Sim::findObject(canvasName)); object->showPopup(pCanvas, x, y); diff --git a/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp b/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp index 17cc97548..e53d70486 100644 --- a/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp @@ -177,13 +177,13 @@ ConsoleDocClass( GuiIdleCamFadeBitmapCtrl, "This is going to be deprecated, and any useful code ported to FadeinBitmap\n\n" "@internal"); -DefineConsoleMethod(GuiIdleCamFadeBitmapCtrl, fadeIn, void, (), , "()" +DefineEngineMethod(GuiIdleCamFadeBitmapCtrl, fadeIn, void, (), , "()" "@internal") { object->fadeIn(); } -DefineConsoleMethod(GuiIdleCamFadeBitmapCtrl, fadeOut, void, (), , "()" +DefineEngineMethod(GuiIdleCamFadeBitmapCtrl, fadeOut, void, (), , "()" "@internal") { object->fadeOut(); diff --git a/Engine/source/gui/shiny/guiTickCtrl.cpp b/Engine/source/gui/shiny/guiTickCtrl.cpp index fa788ea7b..02eca4599 100644 --- a/Engine/source/gui/shiny/guiTickCtrl.cpp +++ b/Engine/source/gui/shiny/guiTickCtrl.cpp @@ -59,7 +59,7 @@ static ConsoleDocFragment _setProcessTicks( "void setProcessTicks( bool tick )" ); -DefineConsoleMethod( GuiTickCtrl, setProcessTicks, void, (bool tick), (true), "( [tick = true] ) - This will set this object to either be processing ticks or not" ) +DefineEngineMethod( GuiTickCtrl, setProcessTicks, void, (bool tick), (true), "( [tick = true] ) - This will set this object to either be processing ticks or not" ) { object->setProcessTicks(tick); } \ No newline at end of file diff --git a/Engine/source/gui/utility/messageVector.cpp b/Engine/source/gui/utility/messageVector.cpp index 19255e38b..97fd33382 100644 --- a/Engine/source/gui/utility/messageVector.cpp +++ b/Engine/source/gui/utility/messageVector.cpp @@ -258,7 +258,7 @@ static ConsoleDocFragment _MessageVectordump2( "MessageVector", "void dump( string filename, string header);"); -DefineConsoleMethod( MessageVector, dump, void, (const char * filename, const char * header), (""), "(string filename, string header=NULL)" +DefineEngineMethod( MessageVector, dump, void, (const char * filename, const char * header), (""), "(string filename, string header=NULL)" "Dump the message vector to a file, optionally prefixing a header." "@hide") { diff --git a/Engine/source/gui/worldEditor/creator.cpp b/Engine/source/gui/worldEditor/creator.cpp index 28fc15e84..99264f4ba 100644 --- a/Engine/source/gui/worldEditor/creator.cpp +++ b/Engine/source/gui/worldEditor/creator.cpp @@ -219,7 +219,7 @@ void CreatorTree::sort() } //------------------------------------------------------------------------------ -DefineConsoleMethod( CreatorTree, addGroup, S32, (S32 group, const char * name, const char * value), , "(string group, string name, string value)") +DefineEngineMethod( CreatorTree, addGroup, S32, (S32 group, const char * name, const char * value), , "(string group, string name, string value)") { CreatorTree::Node * grp = object->findNode(group); @@ -236,7 +236,7 @@ DefineConsoleMethod( CreatorTree, addGroup, S32, (S32 group, const char * name, return(node ? node->getId() : -1); } -DefineConsoleMethod( CreatorTree, addItem, S32, (S32 group, const char * name, const char * value), , "(Node group, string name, string value)") +DefineEngineMethod( CreatorTree, addItem, S32, (S32 group, const char * name, const char * value), , "(Node group, string name, string value)") { CreatorTree::Node * grp = object->findNode(group); @@ -249,7 +249,7 @@ DefineConsoleMethod( CreatorTree, addItem, S32, (S32 group, const char * name, c } //------------------------------------------------------------------------------ -DefineConsoleMethod( CreatorTree, fileNameMatch, bool, (const char * world, const char * type, const char * filename), , "(string world, string type, string filename)") +DefineEngineMethod( CreatorTree, fileNameMatch, bool, (const char * world, const char * type, const char * filename), , "(string world, string type, string filename)") { // argv[2] - world short // argv[3] - type short @@ -269,12 +269,12 @@ DefineConsoleMethod( CreatorTree, fileNameMatch, bool, (const char * world, cons return(!dStrnicmp(filename+1, type, typeLen)); } -DefineConsoleMethod( CreatorTree, getSelected, S32, (), , "Return a handle to the currently selected item.") +DefineEngineMethod( CreatorTree, getSelected, S32, (), , "Return a handle to the currently selected item.") { return(object->getSelected()); } -DefineConsoleMethod( CreatorTree, isGroup, bool, (const char * group), , "(Group g)") +DefineEngineMethod( CreatorTree, isGroup, bool, (const char * group), , "(Group g)") { CreatorTree::Node * node = object->findNode(dAtoi(group)); if(node && node->isGroup()) @@ -282,24 +282,24 @@ DefineConsoleMethod( CreatorTree, isGroup, bool, (const char * group), , "(Group return(false); } -DefineConsoleMethod( CreatorTree, getName, const char*, (const char * item), , "(Node item)") +DefineEngineMethod( CreatorTree, getName, const char*, (const char * item), , "(Node item)") { CreatorTree::Node * node = object->findNode(dAtoi(item)); return(node ? node->mName : 0); } -DefineConsoleMethod( CreatorTree, getValue, const char*, (S32 nodeValue), , "(Node n)") +DefineEngineMethod( CreatorTree, getValue, const char*, (S32 nodeValue), , "(Node n)") { CreatorTree::Node * node = object->findNode(nodeValue); return(node ? node->mValue : 0); } -DefineConsoleMethod( CreatorTree, clear, void, (), , "Clear the tree.") +DefineEngineMethod( CreatorTree, clear, void, (), , "Clear the tree.") { object->clear(); } -DefineConsoleMethod( CreatorTree, getParent, S32, (S32 nodeValue), , "(Node n)") +DefineEngineMethod( CreatorTree, getParent, S32, (S32 nodeValue), , "(Node n)") { CreatorTree::Node * node = object->findNode(nodeValue); if(node && node->mParent) diff --git a/Engine/source/gui/worldEditor/editor.cpp b/Engine/source/gui/worldEditor/editor.cpp index 2f05c96ad..c60127540 100644 --- a/Engine/source/gui/worldEditor/editor.cpp +++ b/Engine/source/gui/worldEditor/editor.cpp @@ -128,7 +128,7 @@ static GameBase * getControlObj() return(control); } -DefineConsoleMethod( EditManager, setBookmark, void, (S32 val), , "(int slot)") +DefineEngineMethod( EditManager, setBookmark, void, (S32 val), , "(int slot)") { if(val < 0 || val > 9) return; @@ -138,7 +138,7 @@ DefineConsoleMethod( EditManager, setBookmark, void, (S32 val), , "(int slot)") object->mBookmarks[val] = control->getTransform(); } -DefineConsoleMethod( EditManager, gotoBookmark, void, (S32 val), , "(int slot)") +DefineEngineMethod( EditManager, gotoBookmark, void, (S32 val), , "(int slot)") { if(val < 0 || val > 9) return; @@ -148,17 +148,17 @@ DefineConsoleMethod( EditManager, gotoBookmark, void, (S32 val), , "(int slot)") control->setTransform(object->mBookmarks[val]); } -DefineConsoleMethod( EditManager, editorEnabled, void, (), , "Perform the onEditorEnabled callback on all SimObjects and set gEditingMission true" ) +DefineEngineMethod( EditManager, editorEnabled, void, (), , "Perform the onEditorEnabled callback on all SimObjects and set gEditingMission true" ) { object->editorEnabled(); } -DefineConsoleMethod( EditManager, editorDisabled, void, (), , "Perform the onEditorDisabled callback on all SimObjects and set gEditingMission false" ) +DefineEngineMethod( EditManager, editorDisabled, void, (), , "Perform the onEditorDisabled callback on all SimObjects and set gEditingMission false" ) { object->editorDisabled(); } -DefineConsoleMethod( EditManager, isEditorEnabled, bool, (), , "Return the value of gEditingMission." ) +DefineEngineMethod( EditManager, isEditorEnabled, bool, (), , "Return the value of gEditingMission." ) { return gEditingMission; } \ No newline at end of file diff --git a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp index 6bc043d09..02c2138e3 100644 --- a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp +++ b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp @@ -2179,43 +2179,43 @@ void GuiConvexEditorCtrl::splitSelectedFace() updateGizmoPos(); } -DefineConsoleMethod( GuiConvexEditorCtrl, hollowSelection, void, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, hollowSelection, void, (), , "" ) { object->hollowSelection(); } -DefineConsoleMethod( GuiConvexEditorCtrl, recenterSelection, void, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, recenterSelection, void, (), , "" ) { object->recenterSelection(); } -DefineConsoleMethod( GuiConvexEditorCtrl, hasSelection, S32, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, hasSelection, S32, (), , "" ) { return object->hasSelection(); } -DefineConsoleMethod( GuiConvexEditorCtrl, handleDelete, void, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, handleDelete, void, (), , "" ) { object->handleDelete(); } -DefineConsoleMethod( GuiConvexEditorCtrl, handleDeselect, void, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, handleDeselect, void, (), , "" ) { object->handleDeselect(); } -DefineConsoleMethod( GuiConvexEditorCtrl, dropSelectionAtScreenCenter, void, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, dropSelectionAtScreenCenter, void, (), , "" ) { object->dropSelectionAtScreenCenter(); } -DefineConsoleMethod( GuiConvexEditorCtrl, selectConvex, void, (ConvexShape *convex), , "( ConvexShape )" ) +DefineEngineMethod( GuiConvexEditorCtrl, selectConvex, void, (ConvexShape *convex), , "( ConvexShape )" ) { if (convex) object->setSelection( convex, -1 ); } -DefineConsoleMethod( GuiConvexEditorCtrl, splitSelectedFace, void, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, splitSelectedFace, void, (), , "" ) { object->splitSelectedFace(); } \ No newline at end of file diff --git a/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp b/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp index 6712d7762..1d76d3d30 100644 --- a/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp +++ b/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp @@ -784,12 +784,12 @@ void GuiDecalEditorCtrl::setMode( String mode, bool sourceShortcut = false ) Con::executef( this, "paletteSync", mMode ); } -DefineConsoleMethod( GuiDecalEditorCtrl, deleteSelectedDecal, void, (), , "deleteSelectedDecal()" ) +DefineEngineMethod( GuiDecalEditorCtrl, deleteSelectedDecal, void, (), , "deleteSelectedDecal()" ) { object->deleteSelectedDecal(); } -DefineConsoleMethod( GuiDecalEditorCtrl, deleteDecalDatablock, void, ( const char * datablock ), , "deleteSelectedDecalDatablock( String datablock )" ) +DefineEngineMethod( GuiDecalEditorCtrl, deleteDecalDatablock, void, ( const char * datablock ), , "deleteSelectedDecalDatablock( String datablock )" ) { String lookupName( datablock ); if( lookupName == String::EmptyString ) @@ -798,22 +798,22 @@ DefineConsoleMethod( GuiDecalEditorCtrl, deleteDecalDatablock, void, ( const cha object->deleteDecalDatablock( lookupName ); } -DefineConsoleMethod( GuiDecalEditorCtrl, setMode, void, ( String newMode ), , "setMode( String mode )()" ) +DefineEngineMethod( GuiDecalEditorCtrl, setMode, void, ( String newMode ), , "setMode( String mode )()" ) { object->setMode( newMode ); } -DefineConsoleMethod( GuiDecalEditorCtrl, getMode, const char*, (), , "getMode()" ) +DefineEngineMethod( GuiDecalEditorCtrl, getMode, const char*, (), , "getMode()" ) { return object->mMode; } -DefineConsoleMethod( GuiDecalEditorCtrl, getDecalCount, S32, (), , "getDecalCount()" ) +DefineEngineMethod( GuiDecalEditorCtrl, getDecalCount, S32, (), , "getDecalCount()" ) { return gDecalManager->mDecalInstanceVec.size(); } -DefineConsoleMethod( GuiDecalEditorCtrl, getDecalTransform, const char*, ( U32 id ), , "getDecalTransform()" ) +DefineEngineMethod( GuiDecalEditorCtrl, getDecalTransform, const char*, ( U32 id ), , "getDecalTransform()" ) { DecalInstance *decalInstance = gDecalManager->mDecalInstanceVec[id]; @@ -835,7 +835,7 @@ DefineConsoleMethod( GuiDecalEditorCtrl, getDecalTransform, const char*, ( U32 i return returnBuffer; } -DefineConsoleMethod( GuiDecalEditorCtrl, getDecalLookupName, const char*, ( U32 id ), , "getDecalLookupName( S32 )()" ) +DefineEngineMethod( GuiDecalEditorCtrl, getDecalLookupName, const char*, ( U32 id ), , "getDecalLookupName( S32 )()" ) { DecalInstance *decalInstance = gDecalManager->mDecalInstanceVec[id]; if( decalInstance == NULL ) @@ -844,7 +844,7 @@ DefineConsoleMethod( GuiDecalEditorCtrl, getDecalLookupName, const char*, ( U32 return decalInstance->mDataBlock->lookupName; } -DefineConsoleMethod( GuiDecalEditorCtrl, selectDecal, void, ( U32 id ), , "selectDecal( S32 )()" ) +DefineEngineMethod( GuiDecalEditorCtrl, selectDecal, void, ( U32 id ), , "selectDecal( S32 )()" ) { DecalInstance *decalInstance = gDecalManager->mDecalInstanceVec[id]; if( decalInstance == NULL ) @@ -853,7 +853,7 @@ DefineConsoleMethod( GuiDecalEditorCtrl, selectDecal, void, ( U32 id ), , "selec object->selectDecal( decalInstance ); } -DefineConsoleMethod( GuiDecalEditorCtrl, editDecalDetails, void, ( U32 id, Point3F pos, Point3F tan,F32 size ), , "editDecalDetails( S32 )()" ) +DefineEngineMethod( GuiDecalEditorCtrl, editDecalDetails, void, ( U32 id, Point3F pos, Point3F tan,F32 size ), , "editDecalDetails( S32 )()" ) { DecalInstance *decalInstance = gDecalManager->mDecalInstanceVec[id]; if( decalInstance == NULL ) @@ -872,14 +872,14 @@ DefineConsoleMethod( GuiDecalEditorCtrl, editDecalDetails, void, ( U32 id, Point gDecalManager->notifyDecalModified( decalInstance ); } -DefineConsoleMethod( GuiDecalEditorCtrl, getSelectionCount, S32, (), , "" ) +DefineEngineMethod( GuiDecalEditorCtrl, getSelectionCount, S32, (), , "" ) { if ( object->mSELDecal != NULL ) return 1; return 0; } -DefineConsoleMethod( GuiDecalEditorCtrl, retargetDecalDatablock, void, ( const char * dbFrom, const char * dbTo ), , "" ) +DefineEngineMethod( GuiDecalEditorCtrl, retargetDecalDatablock, void, ( const char * dbFrom, const char * dbTo ), , "" ) { if( dStrcmp( dbFrom, "" ) != 0 && dStrcmp( dbTo, "" ) != 0 ) object->retargetDecalDatablock( dbFrom, dbTo ); diff --git a/Engine/source/gui/worldEditor/guiMissionAreaEditor.cpp b/Engine/source/gui/worldEditor/guiMissionAreaEditor.cpp index 411fd074a..839d39017 100644 --- a/Engine/source/gui/worldEditor/guiMissionAreaEditor.cpp +++ b/Engine/source/gui/worldEditor/guiMissionAreaEditor.cpp @@ -95,7 +95,7 @@ void GuiMissionAreaEditorCtrl::setSelectedMissionArea( MissionArea *missionArea Con::executef( this, "onMissionAreaSelected" ); } -DefineConsoleMethod( GuiMissionAreaEditorCtrl, setSelectedMissionArea, void, (const char * missionAreaName), (""), "" ) +DefineEngineMethod( GuiMissionAreaEditorCtrl, setSelectedMissionArea, void, (const char * missionAreaName), (""), "" ) { if ( dStrcmp( missionAreaName, "" )==0 ) object->setSelectedMissionArea(NULL); @@ -107,7 +107,7 @@ DefineConsoleMethod( GuiMissionAreaEditorCtrl, setSelectedMissionArea, void, (co } } -DefineConsoleMethod( GuiMissionAreaEditorCtrl, getSelectedMissionArea, const char*, (), , "" ) +DefineEngineMethod( GuiMissionAreaEditorCtrl, getSelectedMissionArea, const char*, (), , "" ) { MissionArea *missionArea = object->getSelectedMissionArea(); if ( !missionArea ) diff --git a/Engine/source/gui/worldEditor/guiTerrPreviewCtrl.cpp b/Engine/source/gui/worldEditor/guiTerrPreviewCtrl.cpp index 18db8de5f..0d3c988bf 100644 --- a/Engine/source/gui/worldEditor/guiTerrPreviewCtrl.cpp +++ b/Engine/source/gui/worldEditor/guiTerrPreviewCtrl.cpp @@ -88,35 +88,35 @@ void GuiTerrPreviewCtrl::initPersistFields() } -DefineConsoleMethod( GuiTerrPreviewCtrl, reset, void, (), , "Reset the view of the terrain.") +DefineEngineMethod( GuiTerrPreviewCtrl, reset, void, (), , "Reset the view of the terrain.") { object->reset(); } -DefineConsoleMethod( GuiTerrPreviewCtrl, setRoot, void, (), , "Add the origin to the root and reset the origin.") +DefineEngineMethod( GuiTerrPreviewCtrl, setRoot, void, (), , "Add the origin to the root and reset the origin.") { object->setRoot(); } -DefineConsoleMethod( GuiTerrPreviewCtrl, getRoot, Point2F, (), , "Return a Point2F representing the position of the root.") +DefineEngineMethod( GuiTerrPreviewCtrl, getRoot, Point2F, (), , "Return a Point2F representing the position of the root.") { return object->getRoot(); } -DefineConsoleMethod( GuiTerrPreviewCtrl, setOrigin, void, (Point2F pos), , "(float x, float y)" +DefineEngineMethod( GuiTerrPreviewCtrl, setOrigin, void, (Point2F pos), , "(float x, float y)" "Set the origin of the view.") { object->setOrigin( pos ); } -DefineConsoleMethod( GuiTerrPreviewCtrl, getOrigin, Point2F, (), , "Return a Point2F containing the position of the origin.") +DefineEngineMethod( GuiTerrPreviewCtrl, getOrigin, Point2F, (), , "Return a Point2F containing the position of the origin.") { return object->getOrigin(); } -DefineConsoleMethod( GuiTerrPreviewCtrl, getValue, const char*, (), , "Returns a 4-tuple containing: root_x root_y origin_x origin_y") +DefineEngineMethod( GuiTerrPreviewCtrl, getValue, const char*, (), , "Returns a 4-tuple containing: root_x root_y origin_x origin_y") { Point2F r = object->getRoot(); Point2F o = object->getOrigin(); @@ -126,7 +126,7 @@ DefineConsoleMethod( GuiTerrPreviewCtrl, getValue, const char*, (), , "Returns a return valuebuf; } -DefineConsoleMethod( GuiTerrPreviewCtrl, setValue, void, (const char * tuple), , "Accepts a 4-tuple in the same form as getValue returns.\n\n" +DefineEngineMethod( GuiTerrPreviewCtrl, setValue, void, (const char * tuple), , "Accepts a 4-tuple in the same form as getValue returns.\n\n" "@see GuiTerrPreviewCtrl::getValue()") { Point2F r,o; diff --git a/Engine/source/gui/worldEditor/terrainActions.cpp b/Engine/source/gui/worldEditor/terrainActions.cpp index 11360f82d..b64cade26 100644 --- a/Engine/source/gui/worldEditor/terrainActions.cpp +++ b/Engine/source/gui/worldEditor/terrainActions.cpp @@ -795,7 +795,7 @@ void TerrainSmoothAction::smooth( TerrainBlock *terrain, F32 factor, U32 steps ) redo(); } -DefineConsoleMethod( TerrainSmoothAction, smooth, void, ( TerrainBlock *terrain, F32 factor, U32 steps ), , "( TerrainBlock obj, F32 factor, U32 steps )") +DefineEngineMethod( TerrainSmoothAction, smooth, void, ( TerrainBlock *terrain, F32 factor, U32 steps ), , "( TerrainBlock obj, F32 factor, U32 steps )") { if (terrain) object->smooth( terrain, factor, mClamp( steps, 1, 13 ) ); diff --git a/Engine/source/gui/worldEditor/terrainEditor.cpp b/Engine/source/gui/worldEditor/terrainEditor.cpp index 8e81d84e3..f1bf5fd58 100644 --- a/Engine/source/gui/worldEditor/terrainEditor.cpp +++ b/Engine/source/gui/worldEditor/terrainEditor.cpp @@ -2403,7 +2403,7 @@ void TerrainEditor::reorderMaterial( S32 index, S32 orderPos ) //------------------------------------------------------------------------------ -DefineConsoleMethod( TerrainEditor, attachTerrain, void, (const char * terrain), (""), "(TerrainBlock terrain)") +DefineEngineMethod( TerrainEditor, attachTerrain, void, (const char * terrain), (""), "(TerrainBlock terrain)") { SimSet * missionGroup = dynamic_cast(Sim::findObject("MissionGroup")); if (!missionGroup) @@ -2459,12 +2459,12 @@ DefineConsoleMethod( TerrainEditor, attachTerrain, void, (const char * terrain), } } -DefineConsoleMethod( TerrainEditor, getTerrainBlockCount, S32, (), , "()") +DefineEngineMethod( TerrainEditor, getTerrainBlockCount, S32, (), , "()") { return object->getTerrainBlockCount(); } -DefineConsoleMethod( TerrainEditor, getTerrainBlock, S32, (S32 index), , "(S32 index)") +DefineEngineMethod( TerrainEditor, getTerrainBlock, S32, (S32 index), , "(S32 index)") { TerrainBlock* tb = object->getTerrainBlock(index); if(!tb) @@ -2473,7 +2473,7 @@ DefineConsoleMethod( TerrainEditor, getTerrainBlock, S32, (S32 index), , "(S32 i return tb->getId(); } -DefineConsoleMethod(TerrainEditor, getTerrainBlocksMaterialList, const char *, (), , "() gets the list of current terrain materials for all terrain blocks.") +DefineEngineMethod(TerrainEditor, getTerrainBlocksMaterialList, const char *, (), , "() gets the list of current terrain materials for all terrain blocks.") { Vector list; object->getTerrainBlocksMaterialList(list); @@ -2502,23 +2502,23 @@ DefineConsoleMethod(TerrainEditor, getTerrainBlocksMaterialList, const char *, ( return ret; } -DefineConsoleMethod( TerrainEditor, setBrushType, void, (String type), , "(string type)" +DefineEngineMethod( TerrainEditor, setBrushType, void, (String type), , "(string type)" "One of box, ellipse, selection.") { object->setBrushType(type); } -DefineConsoleMethod( TerrainEditor, getBrushType, const char*, (), , "()") +DefineEngineMethod( TerrainEditor, getBrushType, const char*, (), , "()") { return object->getBrushType(); } -DefineConsoleMethod( TerrainEditor, setBrushSize, void, ( S32 w, S32 h), (0), "(int w [, int h])") +DefineEngineMethod( TerrainEditor, setBrushSize, void, ( S32 w, S32 h), (0), "(int w [, int h])") { object->setBrushSize( w, h==0?w:h ); } -DefineConsoleMethod( TerrainEditor, getBrushSize, const char*, (), , "()") +DefineEngineMethod( TerrainEditor, getBrushSize, const char*, (), , "()") { Point2I size = object->getBrushSize(); @@ -2528,74 +2528,74 @@ DefineConsoleMethod( TerrainEditor, getBrushSize, const char*, (), , "()") return ret; } -DefineConsoleMethod( TerrainEditor, setBrushPressure, void, (F32 pressure), , "(float pressure)") +DefineEngineMethod( TerrainEditor, setBrushPressure, void, (F32 pressure), , "(float pressure)") { object->setBrushPressure( pressure ); } -DefineConsoleMethod( TerrainEditor, getBrushPressure, F32, (), , "()") +DefineEngineMethod( TerrainEditor, getBrushPressure, F32, (), , "()") { return object->getBrushPressure(); } -DefineConsoleMethod( TerrainEditor, setBrushSoftness, void, (F32 softness), , "(float softness)") +DefineEngineMethod( TerrainEditor, setBrushSoftness, void, (F32 softness), , "(float softness)") { object->setBrushSoftness( softness ); } -DefineConsoleMethod( TerrainEditor, getBrushSoftness, F32, (), , "()") +DefineEngineMethod( TerrainEditor, getBrushSoftness, F32, (), , "()") { return object->getBrushSoftness(); } -DefineConsoleMethod( TerrainEditor, getBrushPos, const char*, (), , "Returns a Point2I.") +DefineEngineMethod( TerrainEditor, getBrushPos, const char*, (), , "Returns a Point2I.") { return object->getBrushPos(); } -DefineConsoleMethod( TerrainEditor, setBrushPos, void, (Point2I pos), , "Location") +DefineEngineMethod( TerrainEditor, setBrushPos, void, (Point2I pos), , "Location") { object->setBrushPos(pos); } -DefineConsoleMethod( TerrainEditor, setAction, void, (const char * action_name), , "(string action_name)") +DefineEngineMethod( TerrainEditor, setAction, void, (const char * action_name), , "(string action_name)") { object->setAction(action_name); } -DefineConsoleMethod( TerrainEditor, getActionName, const char*, (U32 index), , "(int num)") +DefineEngineMethod( TerrainEditor, getActionName, const char*, (U32 index), , "(int num)") { return (object->getActionName(index)); } -DefineConsoleMethod( TerrainEditor, getNumActions, S32, (), , "") +DefineEngineMethod( TerrainEditor, getNumActions, S32, (), , "") { return(object->getNumActions()); } -DefineConsoleMethod( TerrainEditor, getCurrentAction, const char*, (), , "") +DefineEngineMethod( TerrainEditor, getCurrentAction, const char*, (), , "") { return object->getCurrentAction(); } -DefineConsoleMethod( TerrainEditor, resetSelWeights, void, (bool clear), , "(bool clear)") +DefineEngineMethod( TerrainEditor, resetSelWeights, void, (bool clear), , "(bool clear)") { object->resetSelWeights(clear); } -DefineConsoleMethod( TerrainEditor, clearSelection, void, (), , "") +DefineEngineMethod( TerrainEditor, clearSelection, void, (), , "") { object->clearSelection(); } -DefineConsoleMethod( TerrainEditor, processAction, void, (String action), (""), "(string action=NULL)") +DefineEngineMethod( TerrainEditor, processAction, void, (String action), (""), "(string action=NULL)") { object->processAction(action); } -DefineConsoleMethod( TerrainEditor, getActiveTerrain, S32, (), , "") +DefineEngineMethod( TerrainEditor, getActiveTerrain, S32, (), , "") { S32 ret = 0; @@ -2607,27 +2607,27 @@ DefineConsoleMethod( TerrainEditor, getActiveTerrain, S32, (), , "") return ret; } -DefineConsoleMethod( TerrainEditor, getNumTextures, S32, (), , "") +DefineEngineMethod( TerrainEditor, getNumTextures, S32, (), , "") { return object->getNumTextures(); } -DefineConsoleMethod( TerrainEditor, markEmptySquares, void, (), , "") +DefineEngineMethod( TerrainEditor, markEmptySquares, void, (), , "") { object->markEmptySquares(); } -DefineConsoleMethod( TerrainEditor, mirrorTerrain, void, (S32 mirrorIndex), , "") +DefineEngineMethod( TerrainEditor, mirrorTerrain, void, (S32 mirrorIndex), , "") { object->mirrorTerrain(mirrorIndex); } -DefineConsoleMethod(TerrainEditor, setTerraformOverlay, void, (bool overlayEnable), , "(bool overlayEnable) - sets the terraformer current heightmap to draw as an overlay over the current terrain.") +DefineEngineMethod(TerrainEditor, setTerraformOverlay, void, (bool overlayEnable), , "(bool overlayEnable) - sets the terraformer current heightmap to draw as an overlay over the current terrain.") { // XA: This one needs to be implemented :) } -DefineConsoleMethod(TerrainEditor, updateMaterial, bool, ( U32 index, String matName ), , +DefineEngineMethod(TerrainEditor, updateMaterial, bool, ( U32 index, String matName ), , "( int index, string matName )\n" "Changes the material name at the index." ) { @@ -2645,7 +2645,7 @@ DefineConsoleMethod(TerrainEditor, updateMaterial, bool, ( U32 index, String mat return true; } -DefineConsoleMethod(TerrainEditor, addMaterial, S32, ( String matName ), , +DefineEngineMethod(TerrainEditor, addMaterial, S32, ( String matName ), , "( string matName )\n" "Adds a new material." ) { @@ -2660,7 +2660,7 @@ DefineConsoleMethod(TerrainEditor, addMaterial, S32, ( String matName ), , return true; } -DefineConsoleMethod( TerrainEditor, removeMaterial, void, ( S32 index ), , "( int index ) - Remove the material at the given index." ) +DefineEngineMethod( TerrainEditor, removeMaterial, void, ( S32 index ), , "( int index ) - Remove the material at the given index." ) { TerrainBlock *terr = object->getClientTerrain(); if ( !terr ) @@ -2689,7 +2689,7 @@ DefineConsoleMethod( TerrainEditor, removeMaterial, void, ( S32 index ), , "( in object->setGridUpdateMinMax(); } -DefineConsoleMethod(TerrainEditor, getMaterialCount, S32, (), , +DefineEngineMethod(TerrainEditor, getMaterialCount, S32, (), , "Returns the current material count." ) { TerrainBlock *terr = object->getClientTerrain(); @@ -2699,7 +2699,7 @@ DefineConsoleMethod(TerrainEditor, getMaterialCount, S32, (), , return 0; } -DefineConsoleMethod(TerrainEditor, getMaterials, const char *, (), , "() gets the list of current terrain materials.") +DefineEngineMethod(TerrainEditor, getMaterials, const char *, (), , "() gets the list of current terrain materials.") { TerrainBlock *terr = object->getClientTerrain(); if ( !terr ) @@ -2716,7 +2716,7 @@ DefineConsoleMethod(TerrainEditor, getMaterials, const char *, (), , "() gets th return ret; } -DefineConsoleMethod( TerrainEditor, getMaterialName, const char*, (S32 index), , "( int index ) - Returns the name of the material at the given index." ) +DefineEngineMethod( TerrainEditor, getMaterialName, const char*, (S32 index), , "( int index ) - Returns the name of the material at the given index." ) { TerrainBlock *terr = object->getClientTerrain(); if ( !terr ) @@ -2732,7 +2732,7 @@ DefineConsoleMethod( TerrainEditor, getMaterialName, const char*, (S32 index), , return Con::getReturnBuffer( name ); } -DefineConsoleMethod( TerrainEditor, getMaterialIndex, S32, ( String name ), , "( string name ) - Returns the index of the material with the given name or -1." ) +DefineEngineMethod( TerrainEditor, getMaterialIndex, S32, ( String name ), , "( string name ) - Returns the index of the material with the given name or -1." ) { TerrainBlock *terr = object->getClientTerrain(); if ( !terr ) @@ -2747,13 +2747,13 @@ DefineConsoleMethod( TerrainEditor, getMaterialIndex, S32, ( String name ), , "( return -1; } -DefineConsoleMethod( TerrainEditor, reorderMaterial, void, ( S32 index, S32 orderPos ), , "( int index, int order ) " +DefineEngineMethod( TerrainEditor, reorderMaterial, void, ( S32 index, S32 orderPos ), , "( int index, int order ) " "- Reorder material at the given index to the new position, changing the order in which it is rendered / blended." ) { object->reorderMaterial( index, orderPos ); } -DefineConsoleMethod(TerrainEditor, getTerrainUnderWorldPoint, S32, (const char * ptOrX, const char * Y, const char * Z), ("", "", ""), +DefineEngineMethod(TerrainEditor, getTerrainUnderWorldPoint, S32, (const char * ptOrX, const char * Y, const char * Z), ("", "", ""), "(x/y/z) Gets the terrain block that is located under the given world point.\n" "@param x/y/z The world coordinates (floating point values) you wish to query at. " "These can be formatted as either a string (\"x y z\") or separately as (x, y, z)\n" @@ -2822,12 +2822,12 @@ void TerrainEditor::initPersistFields() Parent::initPersistFields(); } -DefineConsoleMethod( TerrainEditor, getSlopeLimitMinAngle, F32, (), , "") +DefineEngineMethod( TerrainEditor, getSlopeLimitMinAngle, F32, (), , "") { return object->mSlopeMinAngle; } -DefineConsoleMethod( TerrainEditor, setSlopeLimitMinAngle, F32, (F32 angle), , "") +DefineEngineMethod( TerrainEditor, setSlopeLimitMinAngle, F32, (F32 angle), , "") { if ( angle < 0.0f ) angle = 0.0f; @@ -2838,12 +2838,12 @@ DefineConsoleMethod( TerrainEditor, setSlopeLimitMinAngle, F32, (F32 angle), , " return angle; } -DefineConsoleMethod( TerrainEditor, getSlopeLimitMaxAngle, F32, (), , "") +DefineEngineMethod( TerrainEditor, getSlopeLimitMaxAngle, F32, (), , "") { return object->mSlopeMaxAngle; } -DefineConsoleMethod( TerrainEditor, setSlopeLimitMaxAngle, F32, (F32 angle), , "") +DefineEngineMethod( TerrainEditor, setSlopeLimitMaxAngle, F32, (F32 angle), , "") { if ( angle > 90.0f ) angle = 90.0f; diff --git a/Engine/source/gui/worldEditor/worldEditor.cpp b/Engine/source/gui/worldEditor/worldEditor.cpp index b66ead790..24e710091 100644 --- a/Engine/source/gui/worldEditor/worldEditor.cpp +++ b/Engine/source/gui/worldEditor/worldEditor.cpp @@ -3252,7 +3252,7 @@ DefineEngineMethod( WorldEditor, getActiveSelection, S32, (),, return object->getActiveSelectionSet()->getId(); } -DefineConsoleMethod( WorldEditor, setActiveSelection, void, ( WorldEditorSelection* selection), , +DefineEngineMethod( WorldEditor, setActiveSelection, void, ( WorldEditorSelection* selection), , "Set the currently active WorldEditorSelection object.\n" "@param selection A WorldEditorSelectionSet object to use for the selection container.") { diff --git a/Engine/source/i18n/lang.cpp b/Engine/source/i18n/lang.cpp index 7e1efe4a5..b1fa76c6a 100644 --- a/Engine/source/i18n/lang.cpp +++ b/Engine/source/i18n/lang.cpp @@ -329,7 +329,7 @@ void LangTable::setCurrentLanguage(S32 langid) -DefineConsoleMethod(LangTable, addLanguage, S32, (String filename, String languageName), ("", ""), +DefineEngineMethod(LangTable, addLanguage, S32, (String filename, String languageName), ("", ""), "(string filename, [string languageName])" "@brief Adds a language to the table\n\n" "@param filename Name and path to the language file\n" @@ -343,7 +343,7 @@ DefineConsoleMethod(LangTable, addLanguage, S32, (String filename, String langua return object->addLanguage(scriptFilenameBuffer, (const UTF8*)languageName); } -DefineConsoleMethod(LangTable, getString, const char *, (U32 id), , +DefineEngineMethod(LangTable, getString, const char *, (U32 id), , "(string filename)" "@brief Grabs a string from the specified table\n\n" "If an invalid is passed, the function will attempt to " @@ -363,14 +363,14 @@ DefineConsoleMethod(LangTable, getString, const char *, (U32 id), , return ""; } -DefineConsoleMethod(LangTable, setDefaultLanguage, void, (S32 langId), , "(int language)" +DefineEngineMethod(LangTable, setDefaultLanguage, void, (S32 langId), , "(int language)" "@brief Sets the default language table\n\n" "@param language ID of the table\n") { object->setDefaultLanguage(langId); } -DefineConsoleMethod(LangTable, setCurrentLanguage, void, (S32 langId), , +DefineEngineMethod(LangTable, setCurrentLanguage, void, (S32 langId), , "(int language)" "@brief Sets the current language table for grabbing text\n\n" "@param language ID of the table\n") @@ -378,14 +378,14 @@ DefineConsoleMethod(LangTable, setCurrentLanguage, void, (S32 langId), , object->setCurrentLanguage(langId); } -DefineConsoleMethod(LangTable, getCurrentLanguage, S32, (), , "()" +DefineEngineMethod(LangTable, getCurrentLanguage, S32, (), , "()" "@brief Get the ID of the current language table\n\n" "@return Numerical ID of the current language table") { return object->getCurrentLanguage(); } -DefineConsoleMethod(LangTable, getLangName, const char *, (S32 langId), , "(int language)" +DefineEngineMethod(LangTable, getLangName, const char *, (S32 langId), , "(int language)" "@brief Return the readable name of the language table\n\n" "@param language Numerical ID of the language table to access\n\n" "@return String containing the name of the table, NULL if ID was invalid or name was never specified") @@ -402,7 +402,7 @@ DefineConsoleMethod(LangTable, getLangName, const char *, (S32 langId), , "(int return ""; } -DefineConsoleMethod(LangTable, getNumLang, S32, (), , "()" +DefineEngineMethod(LangTable, getNumLang, S32, (), , "()" "@brief Used to find out how many languages are in the table\n\n" "@return Size of the vector containing the languages, numerical") { diff --git a/Engine/source/materials/materialDefinition.cpp b/Engine/source/materials/materialDefinition.cpp index 3ef1b1d01..9fd3f857a 100644 --- a/Engine/source/materials/materialDefinition.cpp +++ b/Engine/source/materials/materialDefinition.cpp @@ -629,25 +629,25 @@ void Material::StageData::getFeatureSet( FeatureSet *outFeatures ) const } } -DefineConsoleMethod( Material, flush, void, (),, +DefineEngineMethod( Material, flush, void, (),, "Flushes all material instances that use this material." ) { object->flush(); } -DefineConsoleMethod( Material, reload, void, (),, +DefineEngineMethod( Material, reload, void, (),, "Reloads all material instances that use this material." ) { object->reload(); } -DefineConsoleMethod( Material, dumpInstances, void, (),, +DefineEngineMethod( Material, dumpInstances, void, (),, "Dumps a formatted list of the currently allocated material instances for this material to the console." ) { MATMGR->dumpMaterialInstances( object ); } -DefineConsoleMethod( Material, getAnimFlags, const char*, (U32 id), , "" ) +DefineEngineMethod( Material, getAnimFlags, const char*, (U32 id), , "" ) { char * animFlags = Con::getReturnBuffer(512); @@ -688,19 +688,19 @@ DefineConsoleMethod( Material, getAnimFlags, const char*, (U32 id), , "" ) return animFlags; } -DefineConsoleMethod(Material, getFilename, const char*, (),, "Get filename of material") +DefineEngineMethod(Material, getFilename, const char*, (),, "Get filename of material") { SimObject *material = static_cast(object); return material->getFilename(); } -DefineConsoleMethod( Material, isAutoGenerated, bool, (),, +DefineEngineMethod( Material, isAutoGenerated, bool, (),, "Returns true if this Material was automatically generated by MaterialList::mapMaterials()" ) { return object->isAutoGenerated(); } -DefineConsoleMethod( Material, setAutoGenerated, void, (bool isAutoGenerated), , +DefineEngineMethod( Material, setAutoGenerated, void, (bool isAutoGenerated), , "setAutoGenerated(bool isAutoGenerated): Set whether or not the Material is autogenerated." ) { object->setAutoGenerated(isAutoGenerated); diff --git a/Engine/source/math/util/tResponseCurve.cpp b/Engine/source/math/util/tResponseCurve.cpp index 2c1d5c53c..f6c7cfb74 100644 --- a/Engine/source/math/util/tResponseCurve.cpp +++ b/Engine/source/math/util/tResponseCurve.cpp @@ -64,17 +64,17 @@ void SimResponseCurve::clear() mCurve.clear(); } -DefineConsoleMethod( SimResponseCurve, addPoint, void, ( F32 value, F32 time ), , "addPoint( F32 value, F32 time )" ) +DefineEngineMethod( SimResponseCurve, addPoint, void, ( F32 value, F32 time ), , "addPoint( F32 value, F32 time )" ) { object->addPoint( value, time ); } -DefineConsoleMethod( SimResponseCurve, getValue, F32, ( F32 time ), , "getValue( F32 time )" ) +DefineEngineMethod( SimResponseCurve, getValue, F32, ( F32 time ), , "getValue( F32 time )" ) { return object->getValue( time ); } -DefineConsoleMethod( SimResponseCurve, clear, void, (), , "clear()" ) +DefineEngineMethod( SimResponseCurve, clear, void, (), , "clear()" ) { object->clear(); } \ No newline at end of file diff --git a/Engine/source/scene/sceneObject.cpp b/Engine/source/scene/sceneObject.cpp index a6be00320..ff7b6496c 100644 --- a/Engine/source/scene/sceneObject.cpp +++ b/Engine/source/scene/sceneObject.cpp @@ -1517,7 +1517,7 @@ DefineEngineMethod( SceneObject, isGlobalBounds, bool, (),, return object->isGlobalBounds(); } -DefineConsoleMethod(SceneObject, setForwardVector, void, (VectorF newForward, VectorF upVector), (VectorF(0, 0, 0), VectorF(0, 0, 1)), +DefineEngineMethod(SceneObject, setForwardVector, void, (VectorF newForward, VectorF upVector), (VectorF(0, 0, 0), VectorF(0, 0, 1)), "Sets the forward vector of a scene object, making it face Y+ along the new vector.\n" "@param The new forward vector to set.\n" "@param (Optional) The up vector to use to help orient the rotation.") diff --git a/Engine/source/sfx/sfxSource.cpp b/Engine/source/sfx/sfxSource.cpp index e40dd5073..2beb34634 100644 --- a/Engine/source/sfx/sfxSource.cpp +++ b/Engine/source/sfx/sfxSource.cpp @@ -1569,7 +1569,7 @@ static ConsoleDocFragment _sSetTransform2( "void setTransform( Point3F position, Point3F direction )" ); -DefineConsoleMethod( SFXSource, setTransform, void, ( const char * position, const char * direction ), ( "" ), +DefineEngineMethod( SFXSource, setTransform, void, ( const char * position, const char * direction ), ( "" ), "( vector position [, vector direction ] ) " "Set the position and orientation of a 3D sound source.\n" "@hide" ) diff --git a/Engine/source/terrain/terrExport.cpp b/Engine/source/terrain/terrExport.cpp index 8941c8b26..78b63eeb1 100644 --- a/Engine/source/terrain/terrExport.cpp +++ b/Engine/source/terrain/terrExport.cpp @@ -137,7 +137,7 @@ bool TerrainBlock::exportLayerMaps( const UTF8 *filePrefix, const String &format return true; } -DefineConsoleMethod( TerrainBlock, exportHeightMap, bool, (const char * fileNameStr, const char * format), ( "png"), "(string filename, [string format]) - export the terrain block's heightmap to a bitmap file (default: png)" ) +DefineEngineMethod( TerrainBlock, exportHeightMap, bool, (const char * fileNameStr, const char * format), ( "png"), "(string filename, [string format]) - export the terrain block's heightmap to a bitmap file (default: png)" ) { UTF8 fileName[1024]; Con::expandScriptFilename( fileName, sizeof( fileName ), fileNameStr ); @@ -145,7 +145,7 @@ DefineConsoleMethod( TerrainBlock, exportHeightMap, bool, (const char * fileName return object->exportHeightMap( fileName, format ); } -DefineConsoleMethod( TerrainBlock, exportLayerMaps, bool, (const char * filePrefixStr, const char * format), ( "png"), "(string filePrefix, [string format]) - export the terrain block's layer maps to bitmap files (default: png)" ) +DefineEngineMethod( TerrainBlock, exportLayerMaps, bool, (const char * filePrefixStr, const char * format), ( "png"), "(string filePrefix, [string format]) - export the terrain block's layer maps to bitmap files (default: png)" ) { UTF8 filePrefix[1024]; Con::expandScriptFilename( filePrefix, sizeof( filePrefix ), filePrefixStr ); diff --git a/Engine/source/util/messaging/eventManager.cpp b/Engine/source/util/messaging/eventManager.cpp index 0edfa98fc..03b03228e 100644 --- a/Engine/source/util/messaging/eventManager.cpp +++ b/Engine/source/util/messaging/eventManager.cpp @@ -420,7 +420,7 @@ void EventManager::dumpSubscribers() //----------------------------------------------------------------------------- // Console Methods //----------------------------------------------------------------------------- -DefineConsoleMethod( EventManager, registerEvent, bool, ( const char * evt ), , "( String event )\n" +DefineEngineMethod( EventManager, registerEvent, bool, ( const char * evt ), , "( String event )\n" "Register an event with the event manager.\n" "@param event The event to register.\n" "@return Whether or not the event was registered successfully." ) @@ -428,14 +428,14 @@ DefineConsoleMethod( EventManager, registerEvent, bool, ( const char * evt ), , return object->registerEvent( evt ); } -DefineConsoleMethod( EventManager, unregisterEvent, void, ( const char * evt ), , "( String event )\n" +DefineEngineMethod( EventManager, unregisterEvent, void, ( const char * evt ), , "( String event )\n" "Remove an event from the EventManager.\n" "@param event The event to remove.\n" ) { object->unregisterEvent( evt ); } -DefineConsoleMethod( EventManager, isRegisteredEvent, bool, ( const char * evt ), , "( String event )\n" +DefineEngineMethod( EventManager, isRegisteredEvent, bool, ( const char * evt ), , "( String event )\n" "Check if an event is registered or not.\n" "@param event The event to check.\n" "@return Whether or not the event exists." ) @@ -443,7 +443,7 @@ DefineConsoleMethod( EventManager, isRegisteredEvent, bool, ( const char * evt ) return object->isRegisteredEvent( evt ); } -DefineConsoleMethod( EventManager, postEvent, bool, ( const char * evt, const char * data ), (""), "( String event, String data )\n" +DefineEngineMethod( EventManager, postEvent, bool, ( const char * evt, const char * data ), (""), "( String event, String data )\n" "~Trigger an event.\n" "@param event The event to trigger.\n" "@param data The data associated with the event.\n" @@ -458,7 +458,7 @@ DefineConsoleMethod( EventManager, postEvent, bool, ( const char * evt, const ch return object->postEvent( evt, data ); } -DefineConsoleMethod( EventManager, subscribe, bool, ( const char * listenerName, const char * evt, const char * callback ), (""), "( SimObject listener, String event, String callback )\n\n" +DefineEngineMethod( EventManager, subscribe, bool, ( const char * listenerName, const char * evt, const char * callback ), (""), "( SimObject listener, String event, String callback )\n\n" "Subscribe a listener to an event.\n" "@param listener The listener to subscribe.\n" "@param event The event to subscribe to.\n" @@ -476,7 +476,7 @@ DefineConsoleMethod( EventManager, subscribe, bool, ( const char * listenerName, return object->subscribe( cbObj, evt, callback ); } -DefineConsoleMethod( EventManager, remove, void, ( const char * listenerName, const char * evt), , "( SimObject listener, String event )\n\n" +DefineEngineMethod( EventManager, remove, void, ( const char * listenerName, const char * evt), , "( SimObject listener, String event )\n\n" "Remove a listener from an event.\n" "@param listener The listener to remove.\n" "@param event The event to be removed from.\n") @@ -487,7 +487,7 @@ DefineConsoleMethod( EventManager, remove, void, ( const char * listenerName, co object->remove( listener, evt ); } -DefineConsoleMethod( EventManager, removeAll, void, ( const char * listenerName ), , "( SimObject listener )\n\n" +DefineEngineMethod( EventManager, removeAll, void, ( const char * listenerName ), , "( SimObject listener )\n\n" "Remove a listener from all events.\n" "@param listener The listener to remove.\n") { @@ -498,13 +498,13 @@ DefineConsoleMethod( EventManager, removeAll, void, ( const char * listenerName object->removeAll( listener ); } -DefineConsoleMethod( EventManager, dumpEvents, void, (), , "()\n\n" +DefineEngineMethod( EventManager, dumpEvents, void, (), , "()\n\n" "Print all registered events to the console." ) { object->dumpEvents(); } -DefineConsoleMethod( EventManager, dumpSubscribers, void, ( const char * listenerName ), (""), "( String event )\n\n" +DefineEngineMethod( EventManager, dumpSubscribers, void, ( const char * listenerName ), (""), "( String event )\n\n" "Print all subscribers to an event to the console.\n" "@param event The event whose subscribers are to be printed. If this parameter isn't specified, all events will be dumped." ) { diff --git a/Engine/source/util/messaging/message.cpp b/Engine/source/util/messaging/message.cpp index 7e2b7af08..137242c56 100644 --- a/Engine/source/util/messaging/message.cpp +++ b/Engine/source/util/messaging/message.cpp @@ -155,19 +155,19 @@ const char *Message::getType() // Console Methods //----------------------------------------------------------------------------- -DefineConsoleMethod(Message, getType, const char *, (), , "() Get message type (script class name or C++ class name if no script defined class)") +DefineEngineMethod(Message, getType, const char *, (), , "() Get message type (script class name or C++ class name if no script defined class)") { return object->getType(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(Message, addReference, void, (), , "() Increment the reference count for this message") +DefineEngineMethod(Message, addReference, void, (), , "() Increment the reference count for this message") { object->addReference(); } -DefineConsoleMethod(Message, freeReference, void, (), , "() Decrement the reference count for this message") +DefineEngineMethod(Message, freeReference, void, (), , "() Decrement the reference count for this message") { object->freeReference(); } diff --git a/Engine/source/util/settings.cpp b/Engine/source/util/settings.cpp index b57b77bb4..60f58966e 100644 --- a/Engine/source/util/settings.cpp +++ b/Engine/source/util/settings.cpp @@ -482,12 +482,12 @@ const char* Settings::findNextValue() } // make sure to replace the strings -DefineConsoleMethod(Settings, findFirstValue, const char*, ( const char* pattern, bool deepSearch, bool includeDefaults ), ("", false, false), "settingObj.findFirstValue();") +DefineEngineMethod(Settings, findFirstValue, const char*, ( const char* pattern, bool deepSearch, bool includeDefaults ), ("", false, false), "settingObj.findFirstValue();") { return object->findFirstValue( pattern, deepSearch, includeDefaults ); } -DefineConsoleMethod(Settings, findNextValue, const char*, (), , "settingObj.findNextValue();") +DefineEngineMethod(Settings, findNextValue, const char*, (), , "settingObj.findNextValue();") { return object->findNextValue(); } @@ -644,7 +644,7 @@ void SettingSaveNode::buildDocument(SimXMLDocument *document, bool skipWrite) document->popElement(); } -DefineConsoleMethod(Settings, setValue, void, (const char * settingName, const char * value), (""), "settingObj.setValue(settingName, value);") +DefineEngineMethod(Settings, setValue, void, (const char * settingName, const char * value), (""), "settingObj.setValue(settingName, value);") { StringTableEntry fieldName = StringTable->insert( settingName ); @@ -654,13 +654,13 @@ DefineConsoleMethod(Settings, setValue, void, (const char * settingName, const c object->setValue( fieldName ); } -DefineConsoleMethod(Settings, setDefaultValue, void, (const char * settingName, const char * value), , "settingObj.setDefaultValue(settingName, value);") +DefineEngineMethod(Settings, setDefaultValue, void, (const char * settingName, const char * value), , "settingObj.setDefaultValue(settingName, value);") { StringTableEntry fieldName = StringTable->insert( settingName ); object->setDefaultValue( fieldName, value ); } -DefineConsoleMethod(Settings, value, const char*, (const char * settingName, const char * defaultValue), (""), "settingObj.value(settingName, defaultValue);") +DefineEngineMethod(Settings, value, const char*, (const char * settingName, const char * defaultValue), (""), "settingObj.value(settingName, defaultValue);") { StringTableEntry fieldName = StringTable->insert( settingName ); @@ -672,7 +672,7 @@ DefineConsoleMethod(Settings, value, const char*, (const char * settingName, con return ""; } -DefineConsoleMethod(Settings, remove, void, (const char * settingName, bool includeDefaults), (false), "settingObj.remove(settingName, includeDefaults = false);") +DefineEngineMethod(Settings, remove, void, (const char * settingName, bool includeDefaults), (false), "settingObj.remove(settingName, includeDefaults = false);") { // there's a problem with some fields not being removed properly, but works if you run it twice, // a temporary solution for now is simply to call the remove twice @@ -687,27 +687,27 @@ ConsoleMethod(Settings, write, bool, 2, 2, "%success = settingObj.write();") return object->write(); } -DefineConsoleMethod(Settings, read, bool, (), , "%success = settingObj.read();") +DefineEngineMethod(Settings, read, bool, (), , "%success = settingObj.read();") { return object->read(); } -DefineConsoleMethod(Settings, beginGroup, void, (const char * groupName, bool includeDefaults), (false), "settingObj.beginGroup(groupName, fromStart = false);") +DefineEngineMethod(Settings, beginGroup, void, (const char * groupName, bool includeDefaults), (false), "settingObj.beginGroup(groupName, fromStart = false);") { object->beginGroup( groupName, includeDefaults ); } -DefineConsoleMethod(Settings, endGroup, void, (), , "settingObj.endGroup();") +DefineEngineMethod(Settings, endGroup, void, (), , "settingObj.endGroup();") { object->endGroup(); } -DefineConsoleMethod(Settings, clearGroups, void, (), , "settingObj.clearGroups();") +DefineEngineMethod(Settings, clearGroups, void, (), , "settingObj.clearGroups();") { object->clearGroups(); } -DefineConsoleMethod(Settings, getCurrentGroups, const char*, (), , "settingObj.getCurrentGroups();") +DefineEngineMethod(Settings, getCurrentGroups, const char*, (), , "settingObj.getCurrentGroups();") { return object->getCurrentGroups(); } \ No newline at end of file diff --git a/Engine/source/util/undo.cpp b/Engine/source/util/undo.cpp index 7ea0acc8c..ae6163774 100644 --- a/Engine/source/util/undo.cpp +++ b/Engine/source/util/undo.cpp @@ -145,7 +145,7 @@ void CompoundUndoAction::onDeleteNotify( SimObject* object ) Parent::onDeleteNotify( object ); } -DefineConsoleMethod( CompoundUndoAction, addAction, void, (const char * objName), , "addAction( UndoAction )" ) +DefineEngineMethod( CompoundUndoAction, addAction, void, (const char * objName), , "addAction( UndoAction )" ) { UndoAction *action; if ( Sim::findObject( objName, action ) ) @@ -206,7 +206,7 @@ UndoManager& UndoManager::getDefaultManager() return *defaultMan; } -DefineConsoleMethod(UndoManager, clearAll, void, (),, "Clears the undo manager.") +DefineEngineMethod(UndoManager, clearAll, void, (),, "Clears the undo manager.") { object->clearAll(); } @@ -344,7 +344,7 @@ void UndoManager::redo() (*react).redo(); } -DefineConsoleMethod(UndoManager, getUndoCount, S32, (),, "") +DefineEngineMethod(UndoManager, getUndoCount, S32, (),, "") { return object->getUndoCount(); } @@ -354,7 +354,7 @@ S32 UndoManager::getUndoCount() return mUndoStack.size(); } -DefineConsoleMethod(UndoManager, getUndoName, const char*, (S32 index), , "(index)") +DefineEngineMethod(UndoManager, getUndoName, const char*, (S32 index), , "(index)") { return object->getUndoName(index); } @@ -367,7 +367,7 @@ const char* UndoManager::getUndoName(S32 index) return NULL; } -DefineConsoleMethod(UndoManager, getUndoAction, S32, (S32 index), , "(index)") +DefineEngineMethod(UndoManager, getUndoAction, S32, (S32 index), , "(index)") { UndoAction * action = object->getUndoAction(index); if ( !action ) @@ -386,7 +386,7 @@ UndoAction* UndoManager::getUndoAction(S32 index) return NULL; } -DefineConsoleMethod(UndoManager, getRedoCount, S32, (),, "") +DefineEngineMethod(UndoManager, getRedoCount, S32, (),, "") { return object->getRedoCount(); } @@ -396,7 +396,7 @@ S32 UndoManager::getRedoCount() return mRedoStack.size(); } -DefineConsoleMethod(UndoManager, getRedoName, const char*, (S32 index), , "(index)") +DefineEngineMethod(UndoManager, getRedoName, const char*, (S32 index), , "(index)") { return object->getRedoName(index); } @@ -409,7 +409,7 @@ const char* UndoManager::getRedoName(S32 index) return NULL; } -DefineConsoleMethod(UndoManager, getRedoAction, S32, (S32 index), , "(index)") +DefineEngineMethod(UndoManager, getRedoAction, S32, (S32 index), , "(index)") { UndoAction * action = object->getRedoAction(index); @@ -501,7 +501,7 @@ void UndoManager::popCompound( bool discard ) } //----------------------------------------------------------------------------- -DefineConsoleMethod(UndoAction, addToManager, void, (const char * undoManager), (""), "action.addToManager([undoManager])") +DefineEngineMethod(UndoAction, addToManager, void, (const char * undoManager), (""), "action.addToManager([undoManager])") { UndoManager *theMan = NULL; if (!String::isEmpty(undoManager)) @@ -515,32 +515,32 @@ DefineConsoleMethod(UndoAction, addToManager, void, (const char * undoManager), //----------------------------------------------------------------------------- -DefineConsoleMethod( UndoAction, undo, void, (),, "() - Undo action contained in undo." ) +DefineEngineMethod( UndoAction, undo, void, (),, "() - Undo action contained in undo." ) { object->undo(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( UndoAction, redo, void, (),, "() - Reo action contained in undo." ) +DefineEngineMethod( UndoAction, redo, void, (),, "() - Reo action contained in undo." ) { object->redo(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(UndoManager, undo, void, (),, "UndoManager.undo();") +DefineEngineMethod(UndoManager, undo, void, (),, "UndoManager.undo();") { object->undo(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(UndoManager, redo, void, (),, "UndoManager.redo();") +DefineEngineMethod(UndoManager, redo, void, (),, "UndoManager.redo();") { object->redo(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(UndoManager, getNextUndoName, const char *, (),, "UndoManager.getNextUndoName();") +DefineEngineMethod(UndoManager, getNextUndoName, const char *, (),, "UndoManager.getNextUndoName();") { const char *name = object->getNextUndoName(); if(!name) @@ -552,7 +552,7 @@ DefineConsoleMethod(UndoManager, getNextUndoName, const char *, (),, "UndoManage } //----------------------------------------------------------------------------- -DefineConsoleMethod(UndoManager, getNextRedoName, const char *, (),, "UndoManager.getNextRedoName();") +DefineEngineMethod(UndoManager, getNextRedoName, const char *, (),, "UndoManager.getNextRedoName();") { const char *name = object->getNextRedoName(); if(!name) @@ -565,7 +565,7 @@ DefineConsoleMethod(UndoManager, getNextRedoName, const char *, (),, "UndoManage //----------------------------------------------------------------------------- -DefineConsoleMethod( UndoManager, pushCompound, const char*, ( String name ), ("\"\""), "( string name=\"\" ) - Push a CompoundUndoAction onto the compound stack for assembly." ) +DefineEngineMethod( UndoManager, pushCompound, const char*, ( String name ), ("\"\""), "( string name=\"\" ) - Push a CompoundUndoAction onto the compound stack for assembly." ) { CompoundUndoAction* action = object->pushCompound( name ); @@ -580,7 +580,7 @@ DefineConsoleMethod( UndoManager, pushCompound, const char*, ( String name ), (" //----------------------------------------------------------------------------- -DefineConsoleMethod( UndoManager, popCompound, void, ( bool discard ), (false), "( bool discard=false ) - Pop the current CompoundUndoAction off the stack." ) +DefineEngineMethod( UndoManager, popCompound, void, ( bool discard ), (false), "( bool discard=false ) - Pop the current CompoundUndoAction off the stack." ) { if( !object->getCompoundStackDepth() ) { From cdfd4f973513669c6eff2de61f8eaee955a3442c Mon Sep 17 00:00:00 2001 From: Lukas Joergensen Date: Tue, 17 Apr 2018 21:03:16 +0200 Subject: [PATCH 3/7] Eliminate DefineConsoleStaticMethod --- Engine/source/console/engineAPI.h | 54 ------------------------------- Engine/source/gfx/gfxInit.cpp | 2 +- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index ca7ca8a1d..6d0484171 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -855,60 +855,6 @@ public: ); \ static inline returnType _fn ## className ## name ## impl args - -// Convenience macros to allow defining functions that use the new marshalling features -// while being only visible in the console interop. When we drop the console system, -// these macros can be removed and all definitions that make use of them can be removed -// as well. - -#define DefineEngineMethod( className, name, returnType, args, defaultArgs, usage ) \ - struct _ ## className ## name ## frame \ - { \ - typedef className ObjectType; \ - className* object; \ - inline returnType _exec args const; \ - }; \ - static _EngineFunctionDefaultArguments< _EngineMethodTrampoline< _ ## className ## name ## frame, void args >::FunctionType > \ - _fn ## className ## name ## DefaultArgs defaultArgs; \ - static _EngineConsoleThunkType< returnType >::ReturnType _ ## className ## name ## caster( SimObject* object, S32 argc, ConsoleValueRef *argv ) \ - { \ - _ ## className ## name ## frame frame; \ - frame.object = static_cast< className* >( object ); \ - return _EngineConsoleThunkType< returnType >::ReturnType( _EngineConsoleThunk< 2, returnType args >::thunk( \ - argc, argv, &_ ## className ## name ## frame::_exec, &frame, _fn ## className ## name ## DefaultArgs \ - ) ); \ - } \ - static ConsoleFunctionHeader _ ## className ## name ## header \ - ( #returnType, #args, #defaultArgs ); \ - static ConsoleConstructor \ - className ## name ## obj( #className, #name, \ - _EngineConsoleThunkType< returnType >::CallbackType( _ ## className ## name ## caster ), usage, \ - _EngineConsoleThunk< 2, returnType args >::NUM_ARGS - _EngineConsoleThunkCountArgs() defaultArgs, \ - _EngineConsoleThunk< 2, returnType args >::NUM_ARGS, \ - false, &_ ## className ## name ## header \ - ); \ - returnType _ ## className ## name ## frame::_exec args const - -#define DefineConsoleStaticMethod( className, name, returnType, args, defaultArgs, usage ) \ - static inline returnType _fn ## className ## name ## impl args; \ - static _EngineFunctionDefaultArguments< void args > _fn ## className ## name ## DefaultArgs defaultArgs; \ - static _EngineConsoleThunkType< returnType >::ReturnType _ ## className ## name ## caster( SimObject*, S32 argc, ConsoleValueRef *argv )\ - { \ - return _EngineConsoleThunkType< returnType >::ReturnType( _EngineConsoleThunk< 1, returnType args >::thunk( \ - argc, argv, &_fn ## className ## name ## impl, _fn ## className ## name ## DefaultArgs \ - ) ); \ - } \ - static ConsoleFunctionHeader _ ## className ## name ## header \ - ( #returnType, #args, #defaultArgs, true ); \ - static ConsoleConstructor \ - _ ## className ## name ## obj( #className, #name, _EngineConsoleThunkType< returnType >::CallbackType( _ ## className ## name ## caster ), usage, \ - _EngineConsoleThunk< 1, returnType args >::NUM_ARGS - _EngineConsoleThunkCountArgs() defaultArgs, \ - _EngineConsoleThunk< 1, returnType args >::NUM_ARGS, \ - false, &_ ## className ## name ## header \ - ); \ - static inline returnType _fn ## className ## name ## impl args - - // The following three macros are only temporary. They allow to define engineAPI functions using the framework // here in this file while being visible only in the new API. When the console interop is removed, these macros // can be removed and all their uses be replaced with their corresponding versions that now still include support diff --git a/Engine/source/gfx/gfxInit.cpp b/Engine/source/gfx/gfxInit.cpp index 21572b957..cc7f897bb 100644 --- a/Engine/source/gfx/gfxInit.cpp +++ b/Engine/source/gfx/gfxInit.cpp @@ -536,7 +536,7 @@ DefineEngineStaticMethod( GFXInit, getAdapterModeCount, S32, ( S32 index ),, return adapters[index]->mAvailableModes.size(); } -DefineConsoleStaticMethod( GFXInit, getAdapterMode, String, ( S32 index, S32 modeIndex ),, +DefineEngineStaticMethod( GFXInit, getAdapterMode, String, ( S32 index, S32 modeIndex ),, "Gets the details of the specified adapter mode.\n\n" "@param index Index of the adapter to query.\n" "@param modeIndex Index of the mode to get data from.\n" From 00758d380fa1fa198f46d6fc9c976f12f36dd2d2 Mon Sep 17 00:00:00 2001 From: Lukas Joergensen Date: Tue, 17 Apr 2018 21:41:29 +0200 Subject: [PATCH 4/7] Eliminate unnecessary uses of ConsoleFunction --- Engine/source/T3D/gameBase/gameConnection.cpp | 30 ++++---- Engine/source/afx/arcaneFX.cpp | 70 +++++-------------- Engine/source/app/game.cpp | 6 +- Engine/source/console/consoleFunctions.cpp | 25 +++---- Engine/source/console/scriptFilename.cpp | 30 ++++---- Engine/source/core/color.cpp | 59 ++++++---------- Engine/source/core/frameAllocator.cpp | 4 +- Engine/source/core/resourceManager.cpp | 11 ++- Engine/source/gfx/gl/gfxGLDevice.cpp | 2 +- Engine/source/i18n/lang.cpp | 6 +- Engine/source/platform/platformAssert.cpp | 8 +-- Engine/source/platformSDL/sdlInput.cpp | 10 +-- 12 files changed, 103 insertions(+), 158 deletions(-) diff --git a/Engine/source/T3D/gameBase/gameConnection.cpp b/Engine/source/T3D/gameBase/gameConnection.cpp index cfe87de6d..7c5effdc5 100644 --- a/Engine/source/T3D/gameBase/gameConnection.cpp +++ b/Engine/source/T3D/gameBase/gameConnection.cpp @@ -2722,33 +2722,32 @@ void GameConnection::resetDatablockCache() afx_saved_db_cache_CRC = 0xffffffff; } -ConsoleFunction(resetDatablockCache, void, 1, 1, "resetDatablockCache()") +DefineEngineFunction(resetDatablockCache, void, (),,"") { GameConnection::resetDatablockCache(); } -ConsoleFunction(isDatablockCacheSaved, bool, 1, 1, "resetDatablockCache()") +DefineEngineFunction(isDatablockCacheSaved, bool, (),,"") { return afx_saved_db_cache; } -ConsoleFunction(getDatablockCacheCRC, S32, 1, 1, "getDatablockCacheCRC()") +DefineEngineFunction(getDatablockCacheCRC, S32, (),,"") { return (S32)afx_saved_db_cache_CRC; } -ConsoleFunction(extractDatablockCacheCRC, S32, 2, 2, "extractDatablockCacheCRC(filename)") +DefineEngineFunction(extractDatablockCacheCRC, S32, (const char* fileName),,"") { FileStream f_stream; - const char* fileName = argv[1]; - if(!f_stream.open(fileName, Torque::FS::File::Read)) + if (!f_stream.open(fileName, Torque::FS::File::Read)) { Con::errorf("Failed to open file '%s'.", fileName); return -1; } U32 stream_sz = f_stream.getStreamSize(); - if (stream_sz < 4*32) + if (stream_sz < 4 * 32) { Con::errorf("File '%s' is not a valid datablock cache.", fileName); f_stream.close(); @@ -2777,17 +2776,16 @@ ConsoleFunction(extractDatablockCacheCRC, S32, 2, 2, "extractDatablockCacheCRC(f return (S32)crc_code; } -ConsoleFunction(setDatablockCacheCRC, void, 2, 2, "setDatablockCacheCRC(crc)") +DefineEngineFunction(setDatablockCacheCRC, void, (U32 crc), , "") { GameConnection *conn = GameConnection::getConnectionToServer(); - if(!conn) + if (!conn) return; - U32 crc_u = (U32)dAtoi(argv[1]); - conn->setServerCacheCRC(crc_u); + conn->setServerCacheCRC(crc); } -ConsoleMethod( GameConnection, saveDatablockCache, void, 2, 2, "saveDatablockCache()") +DefineEngineMethod(GameConnection, saveDatablockCache, void, (),, "") { if (GameConnection::serverCacheEnabled() && !afx_saved_db_cache) { @@ -2802,14 +2800,14 @@ ConsoleMethod( GameConnection, saveDatablockCache, void, 2, 2, "saveDatablockCac Con::expandScriptFilename(filename_buffer, sizeof(filename_buffer), filename.c_str()); Torque::Path givenPath(Torque::Path::CompressPath(filename_buffer)); Torque::FS::FileNodeRef fileRef = Torque::FS::GetFileNode(givenPath); - if ( fileRef == NULL ) + if (fileRef == NULL) Con::errorf("saveDatablockCache() failed to get CRC for file '%s'.", filename.c_str()); else afx_saved_db_cache_CRC = (S32)fileRef->getChecksum(); } } -ConsoleMethod( GameConnection, loadDatablockCache, void, 2, 2, "loadDatablockCache()") +DefineEngineMethod(GameConnection, loadDatablockCache, void, (),, "") { if (GameConnection::clientCacheEnabled()) { @@ -2817,7 +2815,7 @@ ConsoleMethod( GameConnection, loadDatablockCache, void, 2, 2, "loadDatablockCac } } -ConsoleMethod( GameConnection, loadDatablockCache_Begin, bool, 2, 2, "loadDatablockCache_Begin()") +DefineEngineMethod(GameConnection, loadDatablockCache_Begin, bool, (),, "") { if (GameConnection::clientCacheEnabled()) { @@ -2827,7 +2825,7 @@ ConsoleMethod( GameConnection, loadDatablockCache_Begin, bool, 2, 2, "loadDatabl return false; } -ConsoleMethod( GameConnection, loadDatablockCache_Continue, bool, 2, 2, "loadDatablockCache_Continue()") +DefineEngineMethod(GameConnection, loadDatablockCache_Continue, bool, (),, "") { if (GameConnection::clientCacheEnabled()) { diff --git a/Engine/source/afx/arcaneFX.cpp b/Engine/source/afx/arcaneFX.cpp index cec0c870a..4252183c1 100644 --- a/Engine/source/afx/arcaneFX.cpp +++ b/Engine/source/afx/arcaneFX.cpp @@ -584,69 +584,33 @@ DefineEngineFunction(getRandomDir, Point3F, (Point3F axis, float thetaMin, float return MathUtils::randomDir(axis, thetaMin, thetaMax, phiMin, phiMax); } -ConsoleFunction( MatrixInverseMulVector, const char*, 3, 3, "(MatrixF xfrm, Point3F vector)" - "@brief Multiply the vector by the affine inverse of the transform.\n\n" - "@ingroup AFX") +DefineEngineFunction(MatrixInverseMulVector, Point3F, (MatrixF xfrm, Point3F vector),, + "@brief Multiply the vector by the affine inverse of the transform.\n\n" + "@ingroup AFX") { - Point3F pos1(0.0f,0.0f,0.0f); - AngAxisF aa1(Point3F(0.0f,0.0f,0.0f),0.0f); - dSscanf(argv[1], "%g %g %g %g %g %g %g", &pos1.x, &pos1.y, &pos1.z, &aa1.axis.x, &aa1.axis.y, &aa1.axis.z, &aa1.angle); - - MatrixF temp1(true); - aa1.setMatrix(&temp1); - temp1.setColumn(3, pos1); - - Point3F vec1(0.0f,0.0f,0.0f); - dSscanf(argv[2], "%g %g %g", &vec1.x, &vec1.y, &vec1.z); - - temp1.affineInverse(); + xfrm.affineInverse(); Point3F result; - temp1.mulV(vec1, &result); + xfrm.mulV(vector, &result); - char* ret = Con::getReturnBuffer(256); - dSprintf(ret, 255, "%g %g %g", result.x, result.y, result.z); - return ret; + return result; } -ConsoleFunction(moveTransformAbs, const char*, 3, 3, "(MatrixF xfrm, Point3F pos)" - "@brief Move the transform to the new absolute position.\n\n" - "@ingroup AFX") +DefineEngineFunction(moveTransformAbs, MatrixF, (MatrixF xfrm, Point3F pos),, + "@brief Move the transform to the new absolute position.\n\n" + "@ingroup AFX") { - Point3F pos1(0.0f,0.0f,0.0f); - AngAxisF aa1(Point3F(0.0f,0.0f,0.0f),0.0f); - dSscanf(argv[1], "%g %g %g %g %g %g %g", &pos1.x, &pos1.y, &pos1.z, &aa1.axis.x, &aa1.axis.y, &aa1.axis.z, &aa1.angle); - - Point3F pos2(0.0f,0.0f,0.0f); - dSscanf(argv[2], "%g %g %g", &pos2.x, &pos2.y, &pos2.z); - - char* returnBuffer = Con::getReturnBuffer(256); - dSprintf(returnBuffer, 255, "%g %g %g %g %g %g %g", - pos2.x, pos2.y, pos2.z, - aa1.axis.x, aa1.axis.y, aa1.axis.z, - aa1.angle); - return returnBuffer; + xfrm.setPosition(pos); + return xfrm; } -ConsoleFunction(moveTransformRel, const char*, 3, 3, "(MatrixF xfrm, Point3F pos)" - "@brief Move the transform to the new relative position.\n\n" - "@ingroup AFX") +DefineEngineFunction(moveTransformRel, MatrixF, (MatrixF xfrm, Point3F pos),, + "@brief Move the transform to the new relative position.\n\n" + "@ingroup AFX") { - Point3F pos1(0.0f,0.0f,0.0f); - AngAxisF aa1(Point3F(0.0f,0.0f,0.0f),0.0f); - dSscanf(argv[1], "%g %g %g %g %g %g %g", &pos1.x, &pos1.y, &pos1.z, &aa1.axis.x, &aa1.axis.y, &aa1.axis.z, &aa1.angle); - - Point3F pos2(0.0f,0.0f,0.0f); - dSscanf(argv[2], "%g %g %g", &pos2.x, &pos2.y, &pos2.z); - - pos2 += pos1; - - char* returnBuffer = Con::getReturnBuffer(256); - dSprintf(returnBuffer, 255, "%g %g %g %g %g %g %g", - pos2.x, pos2.y, pos2.z, - aa1.axis.x, aa1.axis.y, aa1.axis.z, - aa1.angle); - return returnBuffer; + pos += xfrm.getPosition(); + xfrm.setPosition(pos); + return xfrm; } DefineEngineFunction(getFreeTargetPosition, Point3F, (),, diff --git a/Engine/source/app/game.cpp b/Engine/source/app/game.cpp index d7a3377f6..5878accd6 100644 --- a/Engine/source/app/game.cpp +++ b/Engine/source/app/game.cpp @@ -218,8 +218,10 @@ DefineEngineFunction( getRealTime, S32, (), , "()" return Platform::getRealMilliseconds(); } -ConsoleFunction( getLocalTime, const char *, 1, 1, "Return the current local time as: weekday month day year hour min sec.\n\n" - "Local time is platform defined.") +DefineEngineFunction(getLocalTime, const char*, (),, + "@brief Return the current local time as: weekday month day year hour min sec.\n\n" + "Local time is platform defined." + "@ingroup Platform") { Platform::LocalTime lt; Platform::getLocalTime(lt); diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index 258f7911f..565c79206 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -2646,26 +2646,23 @@ DefineEngineFunction( getPrefsPath, const char *, ( const char* relativeFileName //----------------------------------------------------------------------------- -ConsoleFunction( execPrefs, bool, 2, 4, "( string relativeFileName, bool noCalls=false, bool journalScript=false )" - "@brief Manually execute a special script file that contains game or editor preferences\n\n" - "@param relativeFileName Name and path to file from project folder\n" - "@param noCalls Deprecated\n" - "@param journalScript Deprecated\n" - "@return True if script was successfully executed\n" - "@note Appears to be useless in Torque 3D, should be deprecated\n" - "@ingroup Scripting") +DefineEngineFunction(execPrefs, bool, (const char* relativeFileName, bool noCalls, bool journalScript),(false, false), + "@brief Manually execute a special script file that contains game or editor preferences\n\n" + "@param relativeFileName Name and path to file from project folder\n" + "@param noCalls Deprecated\n" + "@param journalScript Deprecated\n" + "@return True if script was successfully executed\n" + "@note Appears to be useless in Torque 3D, should be deprecated\n" + "@ingroup Scripting") { - const char *filename = Platform::getPrefsPath(argv[1]); - if(filename == NULL || *filename == 0) + if (relativeFileName == NULL || *relativeFileName == 0) return false; // Scripts do this a lot, so we may as well help them out - if(! Platform::isFile(filename) && ! Torque::FS::IsFile(filename)) + if (!Platform::isFile(relativeFileName) && !Torque::FS::IsFile(relativeFileName)) return true; - argv[0] = "exec"; - argv[1] = filename; - return dAtob(Con::execute(argc, argv)); + return Con::executeFile(relativeFileName, noCalls, journalScript); } //----------------------------------------------------------------------------- diff --git a/Engine/source/console/scriptFilename.cpp b/Engine/source/console/scriptFilename.cpp index 332f01d26..b0cacf2bc 100644 --- a/Engine/source/console/scriptFilename.cpp +++ b/Engine/source/console/scriptFilename.cpp @@ -27,7 +27,7 @@ #include "core/tSimpleHashTable.h" #include "core/strings/stringFunctions.h" #include "core/stringTable.h" -#include "console/console.h" +#include "console/engineAPI.h" #include "console/compiler.h" @@ -342,28 +342,26 @@ bool collapseScriptFilename(char *filename, U32 size, const char *src) // Console Functions //----------------------------------------------------------------------------- -ConsoleFunction(expandFilename, const char*, 2, 2, "(string filename)" - "@brief Grabs the full path of a specified file\n\n" - "@param filename Name of the local file to locate\n" - "@return String containing the full filepath on disk\n" - "@ingroup FileSystem") +DefineEngineFunction(expandFilename, const char*, (const char* filename),, + "@brief Grabs the full path of a specified file\n\n" + "@param filename Name of the local file to locate\n" + "@return String containing the full filepath on disk\n" + "@ingroup FileSystem") { - TORQUE_UNUSED(argc); static const U32 bufSize = 1024; - char* ret = Con::getReturnBuffer( bufSize ); - Con::expandScriptFilename(ret, bufSize, argv[1]); + char* ret = Con::getReturnBuffer(bufSize); + Con::expandScriptFilename(ret, bufSize, filename); return ret; } -ConsoleFunction(expandOldFilename, const char*, 2, 2, "(string filename)" - "@brief Retrofits a filepath that uses old Torque style\n\n" - "@return String containing filepath with new formatting\n" - "@ingroup FileSystem") +DefineEngineFunction(expandOldFilename, const char*, (const char* filename),, + "@brief Retrofits a filepath that uses old Torque style\n\n" + "@return String containing filepath with new formatting\n" + "@ingroup FileSystem") { - TORQUE_UNUSED(argc); static const U32 bufSize = 1024; - char* ret = Con::getReturnBuffer( bufSize ); - Con::expandOldScriptFilename(ret, bufSize, argv[1]); + char* ret = Con::getReturnBuffer(bufSize); + Con::expandOldScriptFilename(ret, bufSize, filename); return ret; } diff --git a/Engine/source/core/color.cpp b/Engine/source/core/color.cpp index 273a2a658..1fea8cfec 100644 --- a/Engine/source/core/color.cpp +++ b/Engine/source/core/color.cpp @@ -536,80 +536,67 @@ float LinearColorF::sSrgbToLinear[256] = #endif //----------------------------------------------------------------------------- -ConsoleFunction( getStockColorCount, S32, 1, 1, "() - Gets a count of available stock colors.\n" - "@return A count of available stock colors." ) +DefineEngineFunction(getStockColorCount, S32, (),, + "@brief Gets a count of available stock colors.\n" + "@return A count of available stock colors.") { return StockColor::getCount(); } //----------------------------------------------------------------------------- -ConsoleFunction( getStockColorName, const char*, 2, 2, "(stockColorIndex) - Gets the stock color name at the specified index.\n" +DefineEngineFunction(getStockColorName, const char*, (S32 stockColorIndex),, + "@brief Gets the stock color name at the specified index.\n" "@param stockColorIndex The zero-based index of the stock color name to retrieve.\n" - "@return The stock color name at the specified index or nothing if the string is invalid." ) + "@return The stock color name at the specified index or nothing if the string is invalid.") { - // Fetch stock color index. - const S32 stockColorIndex = dAtoi(argv[1]); - // Fetch the color item. - const StockColorItem* pColorItem = StockColor::getColorItem( stockColorIndex ); + const StockColorItem* pColorItem = StockColor::getColorItem(stockColorIndex); return pColorItem == NULL ? NULL : pColorItem->getColorName(); } //----------------------------------------------------------------------------- -ConsoleFunction( isStockColor, bool, 2, 2, "(stockColorName) - Gets whether the specified name is a stock color or not.\n" +DefineEngineFunction(isStockColor, bool, (const char* stockColorName),, + "@brief Gets whether the specified name is a stock color or not.\n" "@param stockColorName - The stock color name to test for.\n" - "@return Whether the specified name is a stock color or not.\n" ) + "@return Whether the specified name is a stock color or not.\n") { - // Fetch stock color name. - const char* pStockColorName = argv[1]; - // Return whether this is a stock color name or not. - return StockColor::isColor( pStockColorName ); + return StockColor::isColor(stockColorName); } //----------------------------------------------------------------------------- -ConsoleFunction( getStockColorF, const char*, 2, 2, "(stockColorName) - Gets a floating-point-based stock color by name.\n" +DefineEngineFunction(getStockColorF, LinearColorF, (const char* stockColorName),, + "@brief Gets a floating-point-based stock color by name.\n" "@param stockColorName - The stock color name to retrieve.\n" - "@return The stock color that matches the specified color name. Returns nothing if the color name is not found.\n" ) + "@return The stock color that matches the specified color name. Returns nothing if the color name is not found.\n") { - // Fetch stock color name. - const char* pStockColorName = argv[1]; - // Return nothing if stock color name is invalid. - if ( !StockColor::isColor( pStockColorName ) ) + if (!StockColor::isColor(stockColorName)) return StringTable->EmptyString(); // Fetch stock color. - const LinearColorF& color = StockColor::colorF( pStockColorName ); + const LinearColorF& color = StockColor::colorF(stockColorName); - // Format stock color. - char* returnBuffer = Con::getReturnBuffer(256); - dSprintf(returnBuffer, 256, "%g %g %g %g", color.red, color.green, color.blue, color.alpha); - return(returnBuffer); + return color; } //----------------------------------------------------------------------------- -ConsoleFunction( getStockColorI, const char*, 2, 2, "(stockColorName) - Gets a byte-based stock color by name.\n" +DefineEngineFunction(getStockColorI, ColorI, (const char* stockColorName),, + "@brief Gets a byte-based stock color by name.\n" "@param stockColorName - The stock color name to retrieve.\n" - "@return The stock color that matches the specified color name. Returns nothing if the color name is not found.\n" ) + "@return The stock color that matches the specified color name. Returns nothing if the color name is not found.\n") { - // Fetch stock color name. - const char* pStockColorName = argv[1]; - // Return nothing if stock color name is invalid. - if ( !StockColor::isColor( pStockColorName ) ) + if (!StockColor::isColor(stockColorName)) return StringTable->EmptyString(); // Fetch stock color. - const ColorI& color = StockColor::colorI( pStockColorName ); + const ColorI& color = StockColor::colorI(stockColorName); - // Format stock color. - char* returnBuffer = Con::getReturnBuffer(256); - dSprintf(returnBuffer, 256, "%d %d %d %d", color.red, color.green, color.blue, color.alpha); - return(returnBuffer); + return color; } \ No newline at end of file diff --git a/Engine/source/core/frameAllocator.cpp b/Engine/source/core/frameAllocator.cpp index 846328290..5c9530271 100644 --- a/Engine/source/core/frameAllocator.cpp +++ b/Engine/source/core/frameAllocator.cpp @@ -21,7 +21,7 @@ //----------------------------------------------------------------------------- #include "core/frameAllocator.h" -#include "console/console.h" +#include "console/engineAPI.h" U8* FrameAllocator::smBuffer = NULL; U32 FrameAllocator::smWaterMark = 0; @@ -30,7 +30,7 @@ U32 FrameAllocator::smHighWaterMark = 0; #ifdef TORQUE_DEBUG U32 FrameAllocator::smMaxFrameAllocation = 0; -ConsoleFunction(getMaxFrameAllocation, S32, 1,1, "getMaxFrameAllocation();") +DefineEngineFunction(getMaxFrameAllocation, S32, (),,"") { return FrameAllocator::getMaxFrameAllocation(); } diff --git a/Engine/source/core/resourceManager.cpp b/Engine/source/core/resourceManager.cpp index 09b889f95..c5b6e0fa6 100644 --- a/Engine/source/core/resourceManager.cpp +++ b/Engine/source/core/resourceManager.cpp @@ -222,18 +222,17 @@ ResourceBase ResourceManager::nextResource() ConsoleFunctionGroupBegin(ResourceManagerFunctions, "Resource management functions."); -ConsoleFunction(resourceDump, void, 1, 1, "()" - "@brief List the currently managed resources\n\n" - "Currently used by editors only, internal\n" - "@ingroup Editors\n" - "@internal") +DefineEngineFunction(resourceDump, void, (),, + "@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 } - DefineEngineFunction( reloadResource, void, ( const char* path ),, "Force the resource at specified input path to be reloaded\n" "@param path Path to the resource to be reloaded\n\n" diff --git a/Engine/source/gfx/gl/gfxGLDevice.cpp b/Engine/source/gfx/gl/gfxGLDevice.cpp index d2a1853ee..9eda76ebc 100644 --- a/Engine/source/gfx/gl/gfxGLDevice.cpp +++ b/Engine/source/gfx/gl/gfxGLDevice.cpp @@ -992,7 +992,7 @@ public: static GFXGLRegisterDevice pGLRegisterDevice; -ConsoleFunction(cycleResources, void, 1, 1, "") +DefineEngineFunction(cycleResources, void, (),, "") { static_cast(GFX)->zombify(); static_cast(GFX)->resurrect(); diff --git a/Engine/source/i18n/lang.cpp b/Engine/source/i18n/lang.cpp index b1fa76c6a..724d88abe 100644 --- a/Engine/source/i18n/lang.cpp +++ b/Engine/source/i18n/lang.cpp @@ -508,14 +508,15 @@ bool compiledFileNeedsUpdate(UTF8* filename) return false; } -ConsoleFunction(CompileLanguage, void, 2, 3, "(string inputFile, [bool createMap]) Compiles a LSO language file." +DefineEngineFunction(CompileLanguage, void, (const char* inputFile, bool createMap), (false), + "@brief Compiles a LSO language file." " if createIndex is true, will also create languageMap.cs with" " the global variables for each string index." " The input file must follow this example layout:" " TXT_HELLO_WORLD = Hello world in english!") { UTF8 scriptFilenameBuffer[1024]; - Con::expandScriptFilename((char*)scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]); + Con::expandScriptFilename((char*)scriptFilenameBuffer, sizeof(scriptFilenameBuffer), inputFile); if (!Torque::FS::IsFile(scriptFilenameBuffer)) { @@ -532,7 +533,6 @@ ConsoleFunction(CompileLanguage, void, 2, 3, "(string inputFile, [bool createMap if (compiledFileNeedsUpdate(scriptFilenameBuffer)) { - bool createMap = argc > 2 ? dAtob(argv[2]) : false; FileStream *mapStream = NULL; if (createMap) { diff --git a/Engine/source/platform/platformAssert.cpp b/Engine/source/platform/platformAssert.cpp index 5fe428fad..1a4b08694 100644 --- a/Engine/source/platform/platformAssert.cpp +++ b/Engine/source/platform/platformAssert.cpp @@ -23,7 +23,7 @@ #include #include "core/strings/stringFunctions.h" -#include "console/console.h" +#include "console/engineAPI.h" //-------------------------------------- STATIC Declaration @@ -167,8 +167,8 @@ const char* avar(const char *message, ...) //----------------------------------------------------------------------------- -ConsoleFunction( Assert, void, 3, 3, "(condition, message) - Fatal Script Assertion" ) +DefineEngineFunction(Assert, void, (bool condition, const char* message),, "Fatal Script Assertion") { - // Process Assertion. - AssertISV( dAtob(argv[1]), argv[2] ); + // Process Assertion. + AssertISV(condition, message); } diff --git a/Engine/source/platformSDL/sdlInput.cpp b/Engine/source/platformSDL/sdlInput.cpp index 69ef30b20..eb9e3dd8e 100644 --- a/Engine/source/platformSDL/sdlInput.cpp +++ b/Engine/source/platformSDL/sdlInput.cpp @@ -21,7 +21,7 @@ //----------------------------------------------------------------------------- #include "platform/platformInput.h" -#include "console/console.h" +#include "console/engineAPI.h" #include "core/util/journal/process.h" #include "windowManager/platformWindowMgr.h" @@ -97,16 +97,16 @@ void Input::init() } //------------------------------------------------------------------------------ -ConsoleFunction( isJoystickDetected, bool, 1, 1, "isJoystickDetected()" ) +DefineEngineFunction(isJoystickDetected, bool, (),, "") { - return( SDL_NumJoysticks() > 0 ); + return(SDL_NumJoysticks() > 0); } //------------------------------------------------------------------------------ -ConsoleFunction( getJoystickAxes, const char*, 2, 2, "getJoystickAxes( instance )" ) +DefineEngineFunction(getJoystickAxes, const char*, (const char* instance), , "") { // TODO SDL - return( "" ); + return(""); } //------------------------------------------------------------------------------ From 2e6133af4890088d6077d57042f084cb8dd474ea Mon Sep 17 00:00:00 2001 From: Lukas Joergensen Date: Tue, 17 Apr 2018 22:36:32 +0200 Subject: [PATCH 5/7] Eliminate unnecessary uses of ConsoleMethod --- Engine/source/T3D/assets/MaterialAsset.cpp | 2 +- .../camera/cameraComponent_ScriptBinding.h | 3 +- Engine/source/T3D/components/component.cpp | 41 ++++--- Engine/source/T3D/entity.cpp | 31 ++--- Engine/source/T3D/gameBase/gameConnection.cpp | 22 ++-- Engine/source/T3D/player.cpp | 20 ++-- Engine/source/afx/afxCamera.cpp | 110 ++++++++---------- Engine/source/gui/core/guiCanvas.cpp | 23 ++-- .../source/gui/editor/guiInspectorTypes.cpp | 13 +-- .../gui/editor/inspector/componentGroup.cpp | 9 +- .../gui/editor/inspector/entityGroup.cpp | 8 +- .../gui/editor/inspector/mountingGroup.cpp | 8 +- .../gui/worldEditor/worldEditorSelection.cpp | 45 +++---- Engine/source/navigation/guiNavEditorCtrl.cpp | 7 +- Engine/source/util/settings.cpp | 3 +- 15 files changed, 155 insertions(+), 190 deletions(-) diff --git a/Engine/source/T3D/assets/MaterialAsset.cpp b/Engine/source/T3D/assets/MaterialAsset.cpp index 697f21e37..6cf3561a1 100644 --- a/Engine/source/T3D/assets/MaterialAsset.cpp +++ b/Engine/source/T3D/assets/MaterialAsset.cpp @@ -157,7 +157,7 @@ void MaterialAsset::copyTo(SimObject* object) Parent::copyTo(object); } -ConsoleMethod(MaterialAsset, compileShader, void, 2, 2, "() - Compiles the material's generated shader, if any. Not yet implemented\n") +DefineEngineMethod(MaterialAsset, compileShader, void, (), , "Compiles the material's generated shader, if any. Not yet implemented\n") { object->compileShader(); } diff --git a/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h b/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h index d3b7f9883..412d8e5b6 100644 --- a/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h +++ b/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h @@ -24,7 +24,8 @@ #include "T3D/components/camera/cameraComponent.h" //Basically, this only exists for backwards compatibility for parts of the editors -ConsoleMethod(CameraComponent, getMode, const char*, 2, 2, "() - We get the first behavior of the requested type on our owner object.\n" +DefineEngineMethod(CameraComponent, getMode, const char*, (),, + "@brief We get the first behavior of the requested type on our owner object.\n" "@return (string name) The type of the behavior we're requesting") { return "fly"; diff --git a/Engine/source/T3D/components/component.cpp b/Engine/source/T3D/components/component.cpp index 83fc015f1..92c9dda44 100644 --- a/Engine/source/T3D/components/component.cpp +++ b/Engine/source/T3D/components/component.cpp @@ -605,8 +605,8 @@ void Component::addDependency(StringTableEntry name) ////////////////////////////////////////////////////////////////////////// // Console Methods ////////////////////////////////////////////////////////////////////////// -ConsoleMethod(Component, beginGroup, void, 3, 3, "(groupName)\n" - "Starts the grouping for following fields being added to be grouped into\n" +DefineEngineMethod(Component, beginGroup, void, (String groupName),, + "@brief Starts the grouping for following fields being added to be grouped into\n" "@param groupName The name of this group\n" "@param desc The Description of this field\n" "@param type The DataType for this field (default, int, float, Point2F, bool, enum, Object, keybind, color)\n" @@ -616,11 +616,11 @@ ConsoleMethod(Component, beginGroup, void, 3, 3, "(groupName)\n" "-object: the T2D object type that are valid choices for the field. The object types observe inheritance, so if you have a t2dSceneObject field you will be able to choose t2dStaticSrpites, t2dAnimatedSprites, etc.\n" "@return Nothing\n") { - object->beginFieldGroup(argv[2]); + object->beginFieldGroup(groupName); } -ConsoleMethod(Component, endGroup, void, 2, 2, "()\n" - "Ends the grouping for prior fields being added to be grouped into\n" +DefineEngineMethod(Component, endGroup, void, (),, + "@brief Ends the grouping for prior fields being added to be grouped into\n" "@param groupName The name of this group\n" "@param desc The Description of this field\n" "@param type The DataType for this field (default, int, float, Point2F, bool, enum, Object, keybind, color)\n" @@ -641,7 +641,8 @@ DefineEngineMethod(Component, addComponentField, void, (String fieldName, String object->addComponentField(fieldName, fieldDesc, fieldType, defValue, userData, hidden); } -ConsoleMethod(Component, getComponentFieldCount, S32, 2, 2, "() - Get the number of ComponentField's on this object\n" +DefineEngineMethod(Component, getComponentFieldCount, S32, (),, + "@brief Get the number of ComponentField's on this object\n" "@return Returns the number of BehaviorFields as a nonnegative integer\n") { return object->getComponentFieldCount(); @@ -650,11 +651,12 @@ ConsoleMethod(Component, getComponentFieldCount, S32, 2, 2, "() - Get the number // [tom, 1/12/2007] Field accessors split into multiple methods to allow space // for long descriptions and type data. -ConsoleMethod(Component, getComponentField, const char *, 3, 3, "(int index) - Gets a Tab-Delimited list of information about a ComponentField specified by Index\n" +DefineEngineMethod(Component, getComponentField, const char *, (S32 index),, + "@brief Gets a Tab-Delimited list of information about a ComponentField specified by Index\n" "@param index The index of the behavior\n" "@return FieldName, FieldType and FieldDefaultValue, each separated by a TAB character.\n") { - ComponentField *field = object->getComponentField(dAtoi(argv[2])); + ComponentField *field = object->getComponentField(index); if (field == NULL) return ""; @@ -664,11 +666,12 @@ ConsoleMethod(Component, getComponentField, const char *, 3, 3, "(int index) - G return buf; } -ConsoleMethod(Component, setComponentield, const char *, 3, 3, "(int index) - Gets a Tab-Delimited list of information about a ComponentField specified by Index\n" +DefineEngineMethod(Component, setComponentield, const char *, (S32 index),, + "@brief Gets a Tab-Delimited list of information about a ComponentField specified by Index\n" "@param index The index of the behavior\n" "@return FieldName, FieldType and FieldDefaultValue, each separated by a TAB character.\n") { - ComponentField *field = object->getComponentField(dAtoi(argv[2])); + ComponentField *field = object->getComponentField(index); if (field == NULL) return ""; @@ -689,36 +692,40 @@ DefineEngineMethod(Component, getComponentFieldType, const char *, (String field return field->mFieldTypeName;; } -ConsoleMethod(Component, getBehaviorFieldUserData, const char *, 3, 3, "(int index) - Gets the UserData associated with a field by index in the field list\n" +DefineEngineMethod(Component, getBehaviorFieldUserData, const char *, (S32 index),, + "@brief Gets the UserData associated with a field by index in the field list\n" "@param index The index of the behavior\n" "@return Returns a string representing the user data of this field\n") { - ComponentField *field = object->getComponentField(dAtoi(argv[2])); + ComponentField *field = object->getComponentField(index); if (field == NULL) return ""; return field->mUserData; } -ConsoleMethod(Component, getComponentFieldDescription, const char *, 3, 3, "(int index) - Gets a field description by index\n" +DefineEngineMethod(Component, getComponentFieldDescription, const char *, (S32 index),, + "@brief Gets a field description by index\n" "@param index The index of the behavior\n" "@return Returns a string representing the description of this field\n") { - ComponentField *field = object->getComponentField(dAtoi(argv[2])); + ComponentField *field = object->getComponentField(index); if (field == NULL) return ""; return field->mFieldDescription ? field->mFieldDescription : ""; } -ConsoleMethod(Component, addDependency, void, 3, 3, "(string behaviorName) - Gets a field description by index\n" +DefineEngineMethod(Component, addDependency, void, (String behaviorName),, + "@brief Gets a field description by index\n" "@param index The index of the behavior\n" "@return Returns a string representing the description of this field\n") { - object->addDependency(argv[2]); + object->addDependency(behaviorName); } -ConsoleMethod(Component, setDirty, void, 2, 2, "() - Gets a field description by index\n" +DefineEngineMethod(Component, setDirty, void, (),, + "@brief Gets a field description by index\n" "@param index The index of the behavior\n" "@return Returns a string representing the description of this field\n") { diff --git a/Engine/source/T3D/entity.cpp b/Engine/source/T3D/entity.cpp index 587eb145b..c13eb61fa 100644 --- a/Engine/source/T3D/entity.cpp +++ b/Engine/source/T3D/entity.cpp @@ -1823,12 +1823,11 @@ ConsoleMethod(Entity, addComponents, void, 2, 2, "() - Add all fielded behaviors object->addComponents(); }*/ -ConsoleMethod(Entity, addComponent, bool, 3, 3, "(ComponentInstance bi) - Add a behavior to the object\n" +DefineEngineMethod(Entity, addComponent, bool, (Component* comp),, + "@brief Add a behavior to the object\n" "@param bi The behavior instance to add" "@return (bool success) Whether or not the behavior was successfully added") { - Component *comp = dynamic_cast(Sim::findObject(argv[2])); - if (comp != NULL) { bool success = object->addComponent(comp); @@ -1848,40 +1847,33 @@ ConsoleMethod(Entity, addComponent, bool, 3, 3, "(ComponentInstance bi) - Add a return false; } -ConsoleMethod(Entity, removeComponent, bool, 3, 4, "(ComponentInstance bi, [bool deleteBehavior = true])\n" +DefineEngineMethod(Entity, removeComponent, bool, (Component* comp, bool deleteComponent), (true), "@param bi The behavior instance to remove\n" "@param deleteBehavior Whether or not to delete the behavior\n" "@return (bool success) Whether the behavior was successfully removed") { - bool deleteComponent = true; - if (argc > 3) - deleteComponent = dAtob(argv[3]); - - return object->removeComponent(dynamic_cast(Sim::findObject(argv[2])), deleteComponent); + return object->removeComponent(comp, deleteComponent); } -ConsoleMethod(Entity, clearComponents, void, 2, 2, "() - Clear all behavior instances\n" +DefineEngineMethod(Entity, clearComponents, void, (),, "Clear all behavior instances\n" "@return No return value") { object->clearComponents(); } -ConsoleMethod(Entity, getComponentByIndex, S32, 3, 3, "(int index) - Gets a particular behavior\n" +DefineEngineMethod(Entity, getComponentByIndex, Component*, (S32 index),, + "@brief Gets a particular behavior\n" "@param index The index of the behavior to get\n" "@return (ComponentInstance bi) The behavior instance you requested") { - Component *comp = object->getComponent(dAtoi(argv[2])); - - return (comp != NULL) ? comp->getId() : 0; + return object->getComponent(index); } -DefineEngineMethod(Entity, getComponent, S32, (String componentName), (""), +DefineEngineMethod(Entity, getComponent, Component*, (String componentName), (""), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { - Component *comp = object->getComponent(componentName); - - return (comp != NULL) ? comp->getId() : 0; + return object->getComponent(componentName); } /*ConsoleMethod(Entity, getBehaviorByType, S32, 3, 3, "(string BehaviorTemplateName) - gets a behavior\n" @@ -1910,7 +1902,8 @@ DefineEngineMethod(Entity, getComponent, S32, (String componentName), (""), return object->reOrder(inst, idx); }*/ -ConsoleMethod(Entity, getComponentCount, S32, 2, 2, "() - Get the count of behaviors on an object\n" +DefineEngineMethod(Entity, getComponentCount, S32, (),, + "@brief Get the count of behaviors on an object\n" "@return (int count) The number of behaviors on an object") { return object->getComponentCount(); diff --git a/Engine/source/T3D/gameBase/gameConnection.cpp b/Engine/source/T3D/gameBase/gameConnection.cpp index 7c5effdc5..2376e7180 100644 --- a/Engine/source/T3D/gameBase/gameConnection.cpp +++ b/Engine/source/T3D/gameBase/gameConnection.cpp @@ -2451,41 +2451,37 @@ DefineEngineMethod( GameConnection, getVisibleGhostDistance, F32, (),, // Object Selection in Torque by Dave Myers // http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7335 -ConsoleMethod(GameConnection, setSelectedObj, bool, 3, 4, "(object, [propagate_to_client])") +DefineEngineMethod(GameConnection, setSelectedObj, bool, (SceneObject* obj, bool propagate_to_client), (false), "") { - SceneObject* pending_selection; - if (!Sim::findObject(argv[2], pending_selection)) + if (!obj) return false; - bool propagate_to_client = (argc > 3) ? dAtob(argv[3]) : false; - object->setSelectedObj(pending_selection, propagate_to_client); + object->setSelectedObj(obj, propagate_to_client); return true; } -ConsoleMethod(GameConnection, getSelectedObj, S32, 2, 2, "()") +DefineEngineMethod(GameConnection, getSelectedObj, SimObject*, (),, "") { - SimObject* selected = object->getSelectedObj(); - return (selected) ? selected->getId(): -1; + return object->getSelectedObj(); } -ConsoleMethod(GameConnection, clearSelectedObj, void, 2, 3, "([propagate_to_client])") +DefineEngineMethod(GameConnection, clearSelectedObj, void, (bool propagate_to_client), (false), "") { - bool propagate_to_client = (argc > 2) ? dAtob(argv[2]) : false; object->setSelectedObj(NULL, propagate_to_client); } -ConsoleMethod(GameConnection, setPreSelectedObjFromRollover, void, 2, 2, "()") +DefineEngineMethod(GameConnection, setPreSelectedObjFromRollover, void, (),, "") { object->setPreSelectedObjFromRollover(); } -ConsoleMethod(GameConnection, clearPreSelectedObj, void, 2, 2, "()") +DefineEngineMethod(GameConnection, clearPreSelectedObj, void, (),, "") { object->clearPreSelectedObj(); } -ConsoleMethod(GameConnection, setSelectedObjFromPreSelected, void, 2, 2, "()") +DefineEngineMethod(GameConnection, setSelectedObjFromPreSelected, void, (),, "") { object->setSelectedObjFromPreSelected(); } diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 15b57046a..fa43394ca 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -7517,7 +7517,7 @@ U32 Player::lockAnimation() return last_anim_lock_tag; } -ConsoleMethod(Player, isAnimationLocked, bool, 2, 2, "isAnimationLocked()") +DefineEngineMethod(Player, isAnimationLocked, bool, (),, "") { return object->isAnimationLocked(); } @@ -7533,14 +7533,13 @@ void Player::setLookAnimationOverride(bool flag) #endif } -ConsoleMethod(Player, setLookAnimationOverride, void, 3, 3, "setLookAnimationOverride(flag)") +DefineEngineMethod(Player, setLookAnimationOverride, void, (bool flag),, "") { - object->setLookAnimationOverride(dAtob(argv[2])); + object->setLookAnimationOverride(flag); } -ConsoleMethod(Player, copyHeadRotation, void, 3, 3, "copyHeadRotation(other_player)") +DefineEngineMethod(Player, copyHeadRotation, void, (Player* other_player),, "") { - Player* other_player = dynamic_cast(Sim::findObject(argv[2])); if (other_player) object->copyHeadRotation(other_player); } @@ -7609,9 +7608,9 @@ void Player::restoreMovement(U32 tag) } } -ConsoleMethod(Player, setMovementSpeedBias, void, 3, 3, "setMovementSpeedBias(F32 bias)") +DefineEngineMethod(Player, setMovementSpeedBias, void, (F32 bias),, "setMovementSpeedBias(F32 bias)") { - object->setMovementSpeedBias(dAtof(argv[2])); + object->setMovementSpeedBias(bias); } void Player::overrideFootfallFX(bool decals, bool sounds, bool dust) @@ -7642,12 +7641,11 @@ void Player::setControllers(Vector controllerList) mControllers[1] = controllerList.size() > 1 ? controllerList[1] : NULL; } -ConsoleMethod(Player, setVRControllers, void, 4, 4, "") +DefineEngineMethod(Player, setVRControllers, void, (OpenVRTrackedObject* controllerL, OpenVRTrackedObject* controllerR,, "") { - OpenVRTrackedObject *controllerL, *controllerR; Vector list; - if (Sim::findObject(argv[2], controllerL)) + if (controllerL) { list.push_back(controllerL); } @@ -7656,7 +7654,7 @@ ConsoleMethod(Player, setVRControllers, void, 4, 4, "") list.push_back(NULL); } - if (Sim::findObject(argv[3], controllerR)) + if (controllerR) { list.push_back(controllerR); } diff --git a/Engine/source/afx/afxCamera.cpp b/Engine/source/afx/afxCamera.cpp index 63ad635ac..1aad5f455 100644 --- a/Engine/source/afx/afxCamera.cpp +++ b/Engine/source/afx/afxCamera.cpp @@ -483,105 +483,91 @@ ConsoleMethod(afxCamera, setOrbitMode, void, 7, 8, object->setOrbitMode(orbitObject, pos, aa, minDis, maxDis, curDis, (argc == 8) ? dAtob(argv[7]) : false); } -ConsoleMethod( afxCamera, setFlyMode, void, 2, 2, "()" "Set the camera to be able to fly freely.") +DefineEngineMethod(afxCamera, setFlyMode, void, (),, + "@brief Set the camera to be able to fly freely.") { - object->setFlyMode(); + object->setFlyMode(); } -ConsoleMethod( afxCamera, getPosition, const char *, 2, 2, "()" - "Get the position of the camera.\n\n" - "@returns A string of form \"x y z\".") -{ - Point3F& pos = object->getPosition(); - dSprintf(buffer, sizeof(buffer),"%f %f %f",pos.x,pos.y,pos.z); - return buffer; +DefineEngineMethod(afxCamera, getPosition, Point3F, (),, + "@brief Get the position of the camera.\n\n" + "@returns The position of the camera.") +{ + return object->getPosition(); } -ConsoleMethod(afxCamera, setCameraSubject, bool, 3, 3, "") -{ - SceneObject* subject; - if (!Sim::findObject(argv[2], subject)) - { - Con::errorf("Camera subject \"%s\" not found.", argv[2].getStringValue()); - return false; - } - - object->setCameraSubject(subject); - - return true; +DefineEngineMethod(afxCamera, setCameraSubject, bool, (SceneObject* subject),, "") +{ + if (!subject) + { + Con::errorf("Camera subject not found."); + return false; + } + + object->setCameraSubject(subject); + + return true; } -ConsoleMethod(afxCamera, setThirdPersonDistance, bool, 3, 3, "") -{ - F32 distance; - dSscanf(argv[2], "%f", &distance); +DefineEngineMethod(afxCamera, setThirdPersonDistance, bool, (F32 distance),, "") +{ + object->setThirdPersonDistance(distance); - object->setThirdPersonDistance(distance); - - return true; + return true; } -ConsoleMethod(afxCamera, getThirdPersonDistance, F32, 2, 2, "") +DefineEngineMethod(afxCamera, getThirdPersonDistance, F32, (),, "") { return object->getThirdPersonDistance(); } -ConsoleMethod(afxCamera, setThirdPersonAngle, bool, 3, 3, "") -{ - F32 angle; - dSscanf(argv[2], "%f", &angle); +DefineEngineMethod(afxCamera, setThirdPersonAngle, bool, (F32 distance),, "") +{ + object->setThirdPersonAngle(distance); - object->setThirdPersonAngle(angle); - - return true; + return true; } -ConsoleMethod(afxCamera, getThirdPersonAngle, F32, 2, 2, "") +DefineEngineMethod(afxCamera, getThirdPersonAngle, F32, (),, "") { return object->getThirdPersonAngle(); } -ConsoleMethod(afxCamera, setThirdPersonOffset, void, 3, 4, "(Point3F offset [, Point3F coi_offset])") +DefineEngineMethod(afxCamera, setThirdPersonOffset, void, (Point3F offset, Point3F coi_offset), (Point3F::Max), "") { - Point3F offset; - dSscanf(argv[2], "%f %f %f", &offset.x, &offset.y, &offset.z); - if (argc > 3) - { - Point3F coi_offset; - dSscanf(argv[3], "%f %f %f", &coi_offset.x, &coi_offset.y, &coi_offset.z); - object->setThirdPersonOffset(offset, coi_offset); - } - else - object->setThirdPersonOffset(offset); + if (coi_offset == Point3F::Max) + { + object->setThirdPersonOffset(offset); + } + else + { + object->setThirdPersonOffset(offset, coi_offset); + } } -ConsoleMethod(afxCamera, getThirdPersonOffset, const char *, 2, 2, "()") +DefineEngineMethod(afxCamera, getThirdPersonOffset, Point3F, (),, "") { - const Point3F& pos = object->getThirdPersonOffset(); - dSprintf(buffer, sizeof(buffer),"%f %f %f",pos.x,pos.y,pos.z); - return buffer; + return object->getThirdPersonOffset(); } -ConsoleMethod(afxCamera, getThirdPersonCOIOffset, const char *, 2, 2, "()") +DefineEngineMethod(afxCamera, getThirdPersonCOIOffset, Point3F, (),, "") { - const Point3F& pos = object->getThirdPersonCOIOffset(); - dSprintf(buffer, sizeof(buffer),"%f %f %f",pos.x,pos.y,pos.z); - return buffer; + return object->getThirdPersonCOIOffset(); } -ConsoleMethod(afxCamera, setThirdPersonMode, void, 2, 2, "()") +DefineEngineMethod(afxCamera, setThirdPersonMode, void, (),, "") { - object->setThirdPersonMode(); + object->setThirdPersonMode(); } -ConsoleMethod(afxCamera, setThirdPersonSnap, void, 2, 2, "()") +DefineEngineMethod(afxCamera, setThirdPersonSnap, void, (),, "") { - object->setThirdPersonSnap(); + object->setThirdPersonSnap(); } -ConsoleMethod(afxCamera, getMode, const char *, 2, 2, "()") +DefineEngineMethod(afxCamera, getMode, const char*, (),, "") { - return object->getMode(); + return object->getMode(); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index 885d157a0..5b5ca637b 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -2812,7 +2812,7 @@ DefineEngineMethod( GuiCanvas, setVideoMode, void, Con::setVariable( "$pref::Video::mode", vm.toString() ); } -ConsoleMethod( GuiCanvas, showWindow, void, 2, 2, "" ) +DefineEngineMethod(GuiCanvas, showWindow, void, (),, "") { if (!object->getPlatformWindow()) return; @@ -2822,7 +2822,7 @@ ConsoleMethod( GuiCanvas, showWindow, void, 2, 2, "" ) object->getPlatformWindow()->setDisplayWindow(true); } -ConsoleMethod( GuiCanvas, hideWindow, void, 2, 2, "" ) +DefineEngineMethod(GuiCanvas, hideWindow, void, (),, "") { if (!object->getPlatformWindow()) return; @@ -2832,30 +2832,29 @@ ConsoleMethod( GuiCanvas, hideWindow, void, 2, 2, "" ) object->getPlatformWindow()->setDisplayWindow(false); } -ConsoleMethod( GuiCanvas, cursorClick, void, 4, 4, "button, isDown" ) +DefineEngineMethod(GuiCanvas, cursorClick, void, (S32 buttonId, bool isDown), , "") { - const S32 buttonId = dAtoi(argv[2]); - const bool isDown = dAtob(argv[3]); - object->cursorClick(buttonId, isDown); } -ConsoleMethod( GuiCanvas, cursorNudge, void, 4, 4, "x, y" ) +DefineEngineMethod(GuiCanvas, cursorNudge, void, (F32 x, F32 y), , "") { - object->cursorNudge(dAtof(argv[2]), dAtof(argv[3])); + object->cursorNudge(x, y); } + // This function allows resetting of the video-mode from script. It was motivated by // the need to temporarily disable vsync during datablock cache load to avoid a // significant slowdown. bool AFX_forceVideoReset = false; -ConsoleMethod( GuiCanvas, resetVideoMode, void, 2,2, "()") + +DefineEngineMethod(GuiCanvas, resetVideoMode, void, (), , "") { PlatformWindow* window = object->getPlatformWindow(); - if( window ) + if (window) { - GFXWindowTarget* gfx_target = window->getGFXTarget(); - if ( gfx_target ) + GFXWindowTarget* gfx_target = window->getGFXTarget(); + if (gfx_target) { AFX_forceVideoReset = true; gfx_target->resetMode(); diff --git a/Engine/source/gui/editor/guiInspectorTypes.cpp b/Engine/source/gui/editor/guiInspectorTypes.cpp index f31d4facd..4c07f4959 100644 --- a/Engine/source/gui/editor/guiInspectorTypes.cpp +++ b/Engine/source/gui/editor/guiInspectorTypes.cpp @@ -601,13 +601,12 @@ void GuiInspectorTypeFileName::updateValue() } } -ConsoleMethod( GuiInspectorTypeFileName, apply, void, 3,3, "apply(newValue);" ) +DefineEngineMethod(GuiInspectorTypeFileName, apply, void, (String path), , "") { - String path( (const char*)argv[2] ); - if ( path.isNotEmpty() ) - path = Platform::makeRelativePathName( path, Platform::getMainDotCsDir() ); - - object->setData( path.c_str() ); + if (path.isNotEmpty()) + path = Platform::makeRelativePathName(path, Platform::getMainDotCsDir()); + + object->setData(path.c_str()); } @@ -1502,7 +1501,7 @@ void GuiInspectorTypeBitMask32::updateData() setData( data ); } -ConsoleMethod( GuiInspectorTypeBitMask32, applyBit, void, 2,2, "apply();" ) +DefineEngineMethod( GuiInspectorTypeBitMask32, applyBit, void, (),, "" ) { object->updateData(); } diff --git a/Engine/source/gui/editor/inspector/componentGroup.cpp b/Engine/source/gui/editor/inspector/componentGroup.cpp index 27aec03fa..e81eec63d 100644 --- a/Engine/source/gui/editor/inspector/componentGroup.cpp +++ b/Engine/source/gui/editor/inspector/componentGroup.cpp @@ -469,7 +469,7 @@ void GuiInspectorComponentGroup::onRightMouseUp(const GuiEvent &event) Con::executef(this, "onRightMouseUp", event.mousePoint); } -ConsoleMethod(GuiInspectorComponentGroup, inspectGroup, bool, 2, 2, "Refreshes the dynamic fields in the inspector.") +DefineEngineMethod(GuiInspectorComponentGroup, inspectGroup, bool, (),, "Refreshes the dynamic fields in the inspector.") { return object->inspectGroup(); } @@ -515,16 +515,17 @@ AbstractClassRep::Field* GuiInspectorComponentGroup::findObjectBehaviorField(Com } return NULL; } -ConsoleMethod(GuiInspectorComponentGroup, addDynamicField, void, 2, 2, "obj.addDynamicField();") + +DefineEngineMethod(GuiInspectorComponentGroup, addDynamicField, void, (), , "obj.addDynamicField();") { object->addDynamicField(); } -ConsoleMethod(GuiInspectorComponentGroup, removeDynamicField, void, 3, 3, "") +DefineEngineMethod(GuiInspectorComponentGroup, removeDynamicField, void, (), , "") { } -DefineEngineMethod(GuiInspectorComponentGroup, getComponent, S32, (), ,"") +DefineEngineMethod(GuiInspectorComponentGroup, getComponent, S32, (), , "") { return object->getComponent()->getId(); } diff --git a/Engine/source/gui/editor/inspector/entityGroup.cpp b/Engine/source/gui/editor/inspector/entityGroup.cpp index 7b7559833..de4897165 100644 --- a/Engine/source/gui/editor/inspector/entityGroup.cpp +++ b/Engine/source/gui/editor/inspector/entityGroup.cpp @@ -87,7 +87,8 @@ void GuiInspectorEntityGroup::onMouseMove(const GuiEvent &event) { //mParent->mOverDivider = false; } -ConsoleMethod(GuiInspectorEntityGroup, inspectGroup, bool, 2, 2, "Refreshes the dynamic fields in the inspector.") + +DefineEngineMethod(GuiInspectorEntityGroup, inspectGroup, bool, (),, "Refreshes the dynamic fields in the inspector.") { return object->inspectGroup(); } @@ -128,11 +129,12 @@ AbstractClassRep::Field* GuiInspectorEntityGroup::findObjectBehaviorField(Compon } return NULL; } -ConsoleMethod(GuiInspectorEntityGroup, addDynamicField, void, 2, 2, "obj.addDynamicField();") + +DefineEngineMethod(GuiInspectorEntityGroup, addDynamicField, void, (), , "obj.addDynamicField();") { object->addDynamicField(); } -ConsoleMethod(GuiInspectorEntityGroup, removeDynamicField, void, 3, 3, "") +DefineEngineMethod(GuiInspectorEntityGroup, removeDynamicField, void, (), , "") { } diff --git a/Engine/source/gui/editor/inspector/mountingGroup.cpp b/Engine/source/gui/editor/inspector/mountingGroup.cpp index 7afa53105..759139658 100644 --- a/Engine/source/gui/editor/inspector/mountingGroup.cpp +++ b/Engine/source/gui/editor/inspector/mountingGroup.cpp @@ -242,7 +242,8 @@ void GuiInspectorMountingGroup::onMouseMove(const GuiEvent &event) //mParent->mOverDivider = false; bool test = false; } -ConsoleMethod(GuiInspectorMountingGroup, inspectGroup, bool, 2, 2, "Refreshes the dynamic fields in the inspector.") + +DefineEngineMethod(GuiInspectorMountingGroup, inspectGroup, bool, (),, "Refreshes the dynamic fields in the inspector.") { return object->inspectGroup(); } @@ -319,12 +320,13 @@ AbstractClassRep::Field* GuiInspectorMountingGroup::findObjectComponentField(Com } return NULL; } -ConsoleMethod( GuiInspectorMountingGroup, addDynamicField, void, 2, 2, "obj.addDynamicField();" ) + +DefineEngineMethod(GuiInspectorMountingGroup, addDynamicField, void, (), , "obj.addDynamicField();") { object->addDynamicField(); } -ConsoleMethod( GuiInspectorMountingGroup, removeDynamicField, void, 3, 3, "" ) +DefineEngineMethod(GuiInspectorMountingGroup, removeDynamicField, void, (), , "") { } diff --git a/Engine/source/gui/worldEditor/worldEditorSelection.cpp b/Engine/source/gui/worldEditor/worldEditorSelection.cpp index 00311adea..472ac46ef 100644 --- a/Engine/source/gui/worldEditor/worldEditorSelection.cpp +++ b/Engine/source/gui/worldEditor/worldEditorSelection.cpp @@ -657,58 +657,42 @@ void WorldEditorSelection::setSize(const VectorF & newsize) //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, containsGlobalBounds, bool, 2, 2, "() - True if an object with global bounds is contained in the selection." ) +DefineEngineMethod( WorldEditorSelection, containsGlobalBounds, bool, (),, "True if an object with global bounds is contained in the selection." ) { return object->containsGlobalBounds(); } //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, getCentroid, const char*, 2, 2, "() - Return the median of all object positions in the selection." ) +DefineEngineMethod( WorldEditorSelection, getCentroid, Point3F, (),, "Return the median of all object positions in the selection." ) { - static const U32 bufSize = 256; - char* buffer = Con::getReturnBuffer( bufSize ); const Point3F& centroid = object->getCentroid(); - - dSprintf( buffer, bufSize, "%g %g %g", centroid.x, centroid.y, centroid.z ); - return buffer; + return centroid; } //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, getBoxCentroid, const char*, 2, 2, "() - Return the center of the bounding box around the selection." ) +DefineEngineMethod( WorldEditorSelection, getBoxCentroid, Point3F, (),, "Return the center of the bounding box around the selection." ) { - static const U32 bufSize = 256; - char* buffer = Con::getReturnBuffer( bufSize ); const Point3F& boxCentroid = object->getBoxCentroid(); - - dSprintf( buffer, bufSize, "%g %g %g", boxCentroid.x, boxCentroid.y, boxCentroid.z ); - return buffer; + return boxCentroid; } //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, offset, void, 3, 4, "( vector delta, float gridSnap=0 ) - Move all objects in the selection by the given delta." ) -{ - F32 x, y, z; - dSscanf( argv[ 3 ], "%g %g %g", &x, &y, &z ); - - F32 gridSnap = 0.f; - if( argc > 3 ) - gridSnap = dAtof( argv[ 3 ] ); - - object->offset( Point3F( x, y, z ), gridSnap ); +DefineEngineMethod(WorldEditorSelection, offset, void, (Point3F delta, F32 gridSnap), (0.0f), "Move all objects in the selection by the given delta.") +{ + object->offset( delta, gridSnap ); WorldEditor::updateClientTransforms( object ); } //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, union, void, 3, 3, "( SimSet set ) - Add all objects in the given set to this selection." ) +DefineEngineMethod( WorldEditorSelection, union, void, (SimSet* selection),, "Add all objects in the given set to this selection." ) { - SimSet* selection; - if( !Sim::findObject( argv[ 2 ], selection ) ) + if( !selection) { - Con::errorf( "WorldEditorSelection::union - no SimSet '%s'", (const char*)argv[ 2 ] ); + Con::errorf( "WorldEditorSelection::union - no SimSet"); return; } @@ -719,12 +703,11 @@ ConsoleMethod( WorldEditorSelection, union, void, 3, 3, "( SimSet set ) - Add al //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, subtract, void, 3, 3, "( SimSet ) - Remove all objects in the given set from this selection." ) +DefineEngineMethod( WorldEditorSelection, subtract, void, (SimSet* selection),, "Remove all objects in the given set from this selection." ) { - SimSet* selection; - if( !Sim::findObject( argv[ 2 ], selection ) ) + if( !selection ) { - Con::errorf( "WorldEditorSelection::subtract - no SimSet '%s'", (const char*)argv[ 2 ] ); + Con::errorf( "WorldEditorSelection::subtract - no SimSet" ); return; } diff --git a/Engine/source/navigation/guiNavEditorCtrl.cpp b/Engine/source/navigation/guiNavEditorCtrl.cpp index bc605c054..7ef0fb87e 100644 --- a/Engine/source/navigation/guiNavEditorCtrl.cpp +++ b/Engine/source/navigation/guiNavEditorCtrl.cpp @@ -627,13 +627,12 @@ void GuiNavEditorCtrl::_prepRenderImage(SceneManager* sceneGraph, const SceneRen }*/ } -ConsoleMethod(GuiNavEditorCtrl, getMode, const char*, 2, 2, "") +DefineEngineMethod(GuiNavEditorCtrl, getMode, const char*, (), , "") { return object->getMode(); } -ConsoleMethod(GuiNavEditorCtrl, setMode, void, 3, 3, "setMode(String mode)") +DefineEngineMethod(GuiNavEditorCtrl, setMode, void, (String mode),, "setMode(String mode)") { - String newMode = (argv[2]); - object->setMode(newMode); + object->setMode(mode); } diff --git a/Engine/source/util/settings.cpp b/Engine/source/util/settings.cpp index 60f58966e..96fd2d5c8 100644 --- a/Engine/source/util/settings.cpp +++ b/Engine/source/util/settings.cpp @@ -681,9 +681,8 @@ DefineEngineMethod(Settings, remove, void, (const char * settingName, bool inclu object->remove( settingName, includeDefaults ); } -ConsoleMethod(Settings, write, bool, 2, 2, "%success = settingObj.write();") +DefineEngineMethod(Settings, write, bool, (),, "%success = settingObj.write();") { - TORQUE_UNUSED(argc); TORQUE_UNUSED(argv); return object->write(); } From 323206a7965791478b827866ff646a9ea5e63a44 Mon Sep 17 00:00:00 2001 From: Lukas Joergensen Date: Wed, 18 Apr 2018 14:19:07 +0200 Subject: [PATCH 6/7] Eliminate ConsoleStaticMethod --- Engine/source/console/console.h | 18 --------- .../gui/worldEditor/editorIconRegistry.cpp | 35 +++++++--------- .../gui/worldEditor/editorIconRegistry.h | 3 ++ Engine/source/postFx/postEffectVis.cpp | 25 ++++++------ Engine/source/postFx/postEffectVis.h | 5 +++ Engine/source/terrain/terrImport.cpp | 40 ++++++------------- 6 files changed, 47 insertions(+), 79 deletions(-) diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index a734cefbf..358b738f9 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -1220,15 +1220,6 @@ public: ConsoleConstructor cc_##className##_##name##_obj(#className,#name,cm_##className##_##name##_caster,usage1,minArgs,maxArgs); \ inline returnType cm_##className##_##name(className *object, S32 argc, ConsoleValueRef *argv) -# define ConsoleStaticMethod(className,name,returnType,minArgs,maxArgs,usage1) \ - inline returnType cm_##className##_##name(S32, ConsoleValueRef *); \ - returnType cm_##className##_##name##_caster(SimObject *object, S32 argc, ConsoleValueRef *argv) { \ - conmethod_return_##returnType ) cm_##className##_##name(argc,argv); \ - }; \ - ConsoleConstructor \ - cc_##className##_##name##_obj(#className,#name,cm_##className##_##name##_caster,usage1,minArgs,maxArgs); \ - inline returnType cm_##className##_##name(S32 argc, ConsoleValueRef *argv) - # define ConsoleMethodGroupEnd(className, groupName) \ static ConsoleConstructor cc_##className##_##groupName##_GroupEnd(#className,#groupName,NULL) @@ -1268,15 +1259,6 @@ public: className##name##obj(#className,#name,c##className##name##caster,"",minArgs,maxArgs); \ static inline returnType c##className##name(className *object, S32 argc, ConsoleValueRef *argv) -# define ConsoleStaticMethod(className,name,returnType,minArgs,maxArgs,usage1) \ - static inline returnType c##className##name(S32, ConsoleValueRef*); \ - static returnType c##className##name##caster(SimObject *object, S32 argc, ConsoleValueRef *argv) { \ - conmethod_return_##returnType ) c##className##name(argc,argv); \ - }; \ - static ConsoleConstructor \ - className##name##obj(#className,#name,c##className##name##caster,"",minArgs,maxArgs); \ - static inline returnType c##className##name(S32 argc, ConsoleValueRef *argv) - #define ConsoleDoc( text ) #endif diff --git a/Engine/source/gui/worldEditor/editorIconRegistry.cpp b/Engine/source/gui/worldEditor/editorIconRegistry.cpp index 8507d2ad2..b75a28335 100644 --- a/Engine/source/gui/worldEditor/editorIconRegistry.cpp +++ b/Engine/source/gui/worldEditor/editorIconRegistry.cpp @@ -23,7 +23,7 @@ #include "platform/platform.h" #include "gui/worldEditor/editorIconRegistry.h" -#include "console/console.h" +#include "console/engineAPI.h" #include "console/simBase.h" @@ -36,6 +36,8 @@ ConsoleDoc( "@internal" ); +IMPLEMENT_STATIC_CLASS(EditorIconRegistry,, ""); + EditorIconRegistry::EditorIconRegistry() { } @@ -168,51 +170,42 @@ void EditorIconRegistry::clear() mDefaultIcon.free(); } -ConsoleStaticMethod( EditorIconRegistry, add, void, 3, 4, "( String className, String imageFile [, bool overwrite = true] )" +DefineEngineStaticMethod( EditorIconRegistry, add, void, (String className, String imageFile, bool overwrite), (true), "@internal") { - bool overwrite = true; - if ( argc > 3 ) - overwrite = dAtob( argv[3] ); - - gEditorIcons.add( argv[1], argv[2], overwrite ); + gEditorIcons.add( className, imageFile, overwrite ); } -ConsoleStaticMethod( EditorIconRegistry, loadFromPath, void, 2, 3, "( String imagePath [, bool overwrite = true] )" +DefineEngineStaticMethod( EditorIconRegistry, loadFromPath, void, (String imagePath, bool overwrite), (true), "@internal") { - bool overwrite = true; - if ( argc > 2 ) - overwrite = dAtob( argv[2] ); - - gEditorIcons.loadFromPath( argv[1], overwrite ); + gEditorIcons.loadFromPath( imagePath, overwrite ); } -ConsoleStaticMethod( EditorIconRegistry, clear, void, 1, 1, "" +DefineEngineStaticMethod( EditorIconRegistry, clear, void, (),, "@internal") { gEditorIcons.clear(); } -ConsoleStaticMethod( EditorIconRegistry, findIconByClassName, const char*, 2, 2, "( String className )\n" - "Returns the file path to the icon file if found." +DefineEngineStaticMethod( EditorIconRegistry, findIconByClassName, const char*, (String className),, + "@brief Returns the file path to the icon file if found." "@internal") { - GFXTexHandle icon = gEditorIcons.findIcon( argv[1] ); + GFXTexHandle icon = gEditorIcons.findIcon( className ); if ( icon.isNull() ) return NULL; return icon->mPath; } -ConsoleStaticMethod( EditorIconRegistry, findIconBySimObject, const char*, 2, 2, "( SimObject )\n" +DefineEngineStaticMethod( EditorIconRegistry, findIconBySimObject, const char*, (SimObject* obj),, "Returns the file path to the icon file if found." "@internal") { - SimObject *obj = NULL; - if ( !Sim::findObject( argv[1], obj ) ) + if ( !obj ) { - Con::warnf( "EditorIconRegistry::findIcon, parameter %d was not a SimObject!", (const char*)argv[1] ); + Con::warnf( "EditorIconRegistry::findIcon, parameter was not a SimObject!"); return NULL; } diff --git a/Engine/source/gui/worldEditor/editorIconRegistry.h b/Engine/source/gui/worldEditor/editorIconRegistry.h index 35580d74c..a058b7ae7 100644 --- a/Engine/source/gui/worldEditor/editorIconRegistry.h +++ b/Engine/source/gui/worldEditor/editorIconRegistry.h @@ -30,6 +30,8 @@ #include "core/util/tDictionary.h" #endif +#include "console/engineAPI.h" + class SimObject; class AbstractClassRep; @@ -40,6 +42,7 @@ class AbstractClassRep; class EditorIconRegistry { public: + DECLARE_STATIC_CLASS(EditorIconRegistry); EditorIconRegistry(); ~EditorIconRegistry(); diff --git a/Engine/source/postFx/postEffectVis.cpp b/Engine/source/postFx/postEffectVis.cpp index bf507e162..b00ee55ae 100644 --- a/Engine/source/postFx/postEffectVis.cpp +++ b/Engine/source/postFx/postEffectVis.cpp @@ -41,6 +41,8 @@ ConsoleDoc( "@ingroup GFX\n" ); +IMPLEMENT_STATIC_CLASS(PfxVis, , "") + MODULE_BEGIN( PostEffectVis ) MODULE_INIT @@ -374,7 +376,8 @@ static ConsoleDocFragment _PfxVisclear( "PfxVis", "void clear();" ); -ConsoleStaticMethod( PfxVis, clear, void, 1, 1, "()" + +DefineEngineStaticMethod( PfxVis, clear, void, (),, "@hide") { PFXVIS->clear(); @@ -391,16 +394,15 @@ static ConsoleDocFragment _PfxVisopen( "PfxVis", "void open(PostEffect effect, bool clear);" ); -ConsoleStaticMethod( PfxVis, open, void, 2, 3, "( PostEffect, [bool clear = false] )" +DefineEngineStaticMethod( PfxVis, open, void, (PostEffect* pfx, bool clear), (false), "( PostEffect, [bool clear = false] )" "@hide") { - if ( argc == 3 && dAtob( argv[2] ) ) + if ( clear ) PFXVIS->clear(); - PostEffect *pfx; - if ( !Sim::findObject( argv[1], pfx ) ) + if ( !pfx ) { - Con::errorf( "PfxVis::add, argument %s was not a PostEffect", (const char*)argv[1] ); + Con::errorf( "PfxVis::add, argument was not a PostEffect"); return; } @@ -415,7 +417,7 @@ static ConsoleDocFragment _PfxVishide( "PfxVis", "void hide();" ); -ConsoleStaticMethod( PfxVis, hide, void, 1, 1, "()" +DefineEngineStaticMethod( PfxVis, hide, void, (),, "@hide") { PFXVIS->setVisible( false ); @@ -429,7 +431,7 @@ static ConsoleDocFragment _PfxVisshow( "PfxVis", "void show();" ); -ConsoleStaticMethod( PfxVis, show, void, 1, 1, "()" +DefineEngineStaticMethod( PfxVis, show, void, (),, "@hide") { PFXVIS->setVisible( true ); @@ -444,13 +446,12 @@ static ConsoleDocFragment _PfxVisonWindowClosed( "PfxVis", "void onWindowClosed(GuiWindowCtrl *ctrl);" ); -ConsoleStaticMethod( PfxVis, onWindowClosed, void, 2, 2, "( GuiWindowCtrl )" +DefineEngineStaticMethod( PfxVis, onWindowClosed, void, (GuiWindowCtrl* ctrl),, "@hide") { - GuiWindowCtrl *ctrl; - if ( !Sim::findObject( argv[1], ctrl ) ) + if ( !ctrl ) { - Con::errorf( "PfxVis::onWindowClosed, argument %s was not a GuiWindowCtrl", (const char*)argv[1] ); + Con::errorf( "PfxVis::onWindowClosed, argument was not a GuiWindowCtrl"); return; } diff --git a/Engine/source/postFx/postEffectVis.h b/Engine/source/postFx/postEffectVis.h index 972a7ea78..0ef807a58 100644 --- a/Engine/source/postFx/postEffectVis.h +++ b/Engine/source/postFx/postEffectVis.h @@ -104,6 +104,11 @@ public: static const char* getSingletonName() { return "PostEffectVis"; } }; +class PfxVis +{ + DECLARE_STATIC_CLASS(PfxVis) +}; + /// Returns the PostEffectVis singleton. #define PFXVIS ManagedSingleton::instance() diff --git a/Engine/source/terrain/terrImport.cpp b/Engine/source/terrain/terrImport.cpp index ad9a8d98b..063a80c93 100644 --- a/Engine/source/terrain/terrImport.cpp +++ b/Engine/source/terrain/terrImport.cpp @@ -33,15 +33,9 @@ using namespace Torque; -ConsoleStaticMethod( TerrainBlock, createNew, S32, 5, 5, - "TerrainBlock.create( String terrainName, U32 resolution, String materialName, bool genNoise )\n" +DefineEngineStaticMethod( TerrainBlock, createNew, S32, (String terrainName, U32 resolution, String materialName, bool genNoise),, "" ) { - const UTF8 *terrainName = argv[1]; - U32 resolution = dAtoi( argv[2] ); - const UTF8 *materialName = argv[3]; - bool genNoise = dAtob( argv[4] ); - Vector materials; materials.push_back( materialName ); @@ -82,17 +76,17 @@ ConsoleStaticMethod( TerrainBlock, createNew, S32, 5, 5, noise.setSeed( 134208587 ); // Set up some defaults. - F32 octaves = 3.0f; - U32 freq = 4; - F32 roughness = 0.0f; + const F32 octaves = 3.0f; + const U32 freq = 4; + const F32 roughness = 0.0f; noise.fBm( &floatHeights, blockSize, freq, 1.0f - roughness, octaves ); F32 height = 0; F32 omax, omin; noise.getMinMax( &floatHeights, &omin, &omax, blockSize ); - - F32 terrscale = 300.0f / (omax - omin); + + const F32 terrscale = 300.0f / (omax - omin); for ( S32 y = 0; y < blockSize; y++ ) { for ( S32 x = 0; x < blockSize; x++ ) @@ -111,7 +105,7 @@ ConsoleStaticMethod( TerrainBlock, createNew, S32, 5, 5, terrain->updateGridMaterials( Point2I::Zero, Point2I( blockSize, blockSize ) ); } - terrain->registerObject( terrainName ); + terrain->registerObject( terrainName.c_str() ); // Add to mission group! SimGroup *missionGroup; @@ -121,21 +115,11 @@ ConsoleStaticMethod( TerrainBlock, createNew, S32, 5, 5, return terrain->getId(); } -ConsoleStaticMethod( TerrainBlock, import, S32, 7, 8, - "( String terrainName, String heightMap, F32 metersPerPixel, F32 heightScale, String materials, String opacityLayers[, bool flipYAxis=true] )\n" +DefineEngineStaticMethod( TerrainBlock, import, S32, (String terrainName, String heightMapFile, F32 metersPerPixel, F32 heightScale, String opacityLayerFiles, String materialsStr, bool flipYAxis), (true), "" ) { - // Get the parameters. - const UTF8 *terrainName = argv[1]; - const UTF8 *hmap = argv[2]; - F32 metersPerPixel = dAtof(argv[3]); - F32 heightScale = dAtof(argv[4]); - const UTF8 *opacityFiles = argv[5]; - const UTF8 *materialsStr = argv[6]; - bool flipYAxis = argc == 8? dAtob(argv[7]) : true; - // First load the height map and validate it. - Resource heightmap = GBitmap::load( hmap ); + Resource heightmap = GBitmap::load(heightMapFile); if ( !heightmap ) { Con::errorf( "Heightmap failed to load!" ); @@ -155,7 +139,7 @@ ConsoleStaticMethod( TerrainBlock, import, S32, 7, 8, return 0; } - U32 fileCount = StringUnit::getUnitCount( opacityFiles, "\n" ); + U32 fileCount = StringUnit::getUnitCount(opacityLayerFiles, "\n" ); Vector layerMap; layerMap.setSize( terrSize * terrSize ); { @@ -163,7 +147,7 @@ ConsoleStaticMethod( TerrainBlock, import, S32, 7, 8, for ( U32 i = 0; i < fileCount; i++ ) { - String fileNameWithChannel = StringUnit::getUnit( opacityFiles, i, "\n" ); + String fileNameWithChannel = StringUnit::getUnit(opacityLayerFiles, i, "\n" ); String fileName = StringUnit::getUnit( fileNameWithChannel, 0, "\t" ); String channel = StringUnit::getUnit( fileNameWithChannel, 1, "\t" ); @@ -251,7 +235,7 @@ ConsoleStaticMethod( TerrainBlock, import, S32, 7, 8, } // Do we have an existing terrain with that name... then update it! - TerrainBlock *terrain = dynamic_cast( Sim::findObject( terrainName ) ); + TerrainBlock *terrain = dynamic_cast( Sim::findObject( terrainName.c_str() ) ); if ( terrain ) terrain->import( (*heightmap), heightScale, metersPerPixel, layerMap, materials, flipYAxis ); else From bc435a3b33b0123191850780881d24e9cadf524d Mon Sep 17 00:00:00 2001 From: Lukas Joergensen Date: Fri, 20 Apr 2018 22:09:58 +0200 Subject: [PATCH 7/7] Eliminate ConsoleFunction and ConsoleMethod, replace with DefineEngineStringlyVariadic --- Engine/source/T3D/aiConnection.cpp | 2 +- Engine/source/T3D/gameBase/gameConnection.cpp | 2 +- Engine/source/afx/afxCamera.cpp | 2 +- Engine/source/afx/afxMagicSpell.cpp | 44 +++++++------- Engine/source/afx/arcaneFX.cpp | 14 ++--- Engine/source/app/net/net.cpp | 6 +- Engine/source/cinterface/c_scripting.cpp | 2 +- Engine/source/console/console.h | 14 ----- Engine/source/console/consoleFunctions.cpp | 10 ++-- Engine/source/console/engineAPI.h | 58 +++++++++++++++++++ Engine/source/console/sim.cpp | 2 +- Engine/source/console/simObject.cpp | 4 +- Engine/source/console/simSet.cpp | 24 ++------ Engine/source/gui/editor/guiFilterCtrl.cpp | 2 +- Engine/source/gui/editor/guiGraphCtrl.cpp | 2 +- Engine/source/gui/worldEditor/worldEditor.cpp | 2 +- Engine/source/platformWin32/winMath.cpp | 2 +- Engine/source/sim/actionMap.cpp | 4 +- 18 files changed, 112 insertions(+), 84 deletions(-) diff --git a/Engine/source/T3D/aiConnection.cpp b/Engine/source/T3D/aiConnection.cpp index 21564d5eb..42ed1dff3 100644 --- a/Engine/source/T3D/aiConnection.cpp +++ b/Engine/source/T3D/aiConnection.cpp @@ -130,7 +130,7 @@ static inline F32 moveClamp(F32 v) //----------------------------------------------------------------------------- /// Construct and connect an AI connection object -ConsoleFunction(aiConnect, S32 , 2, 20, "(...)" +DefineEngineStringlyVariadicFunction(aiConnect, S32 , 2, 20, "(...)" "@brief Creates a new AIConnection, and passes arguments to its onConnect script callback.\n\n" "@returns The newly created AIConnection\n" "@see GameConnection for parameter information\n" diff --git a/Engine/source/T3D/gameBase/gameConnection.cpp b/Engine/source/T3D/gameBase/gameConnection.cpp index 2376e7180..dc5f69367 100644 --- a/Engine/source/T3D/gameBase/gameConnection.cpp +++ b/Engine/source/T3D/gameBase/gameConnection.cpp @@ -326,7 +326,7 @@ DefineEngineMethod( GameConnection, setJoinPassword, void, (const char* password object->setJoinPassword(password); } -ConsoleMethod(GameConnection, setConnectArgs, void, 3, 17, +DefineEngineStringlyVariadicMethod(GameConnection, setConnectArgs, void, 3, 17, "(const char* args) @brief On the client, pass along a variable set of parameters to the server.\n\n" "Once the connection is established with the server, the server calls its onConnect() method " diff --git a/Engine/source/afx/afxCamera.cpp b/Engine/source/afx/afxCamera.cpp index 1aad5f455..3c460dad8 100644 --- a/Engine/source/afx/afxCamera.cpp +++ b/Engine/source/afx/afxCamera.cpp @@ -452,7 +452,7 @@ const char* afxCamera::getMode() static char buffer[100]; -ConsoleMethod(afxCamera, setOrbitMode, void, 7, 8, +DefineEngineStringlyVariadicMethod(afxCamera, setOrbitMode, void, 7, 8, "(GameBase orbitObject, TransformF mat, float minDistance, float maxDistance, float curDistance, bool ownClientObject)" "Set the camera to orbit around some given object.\n\n" "@param orbitObject Object we want to orbit.\n" diff --git a/Engine/source/afx/afxMagicSpell.cpp b/Engine/source/afx/afxMagicSpell.cpp index 7aeb93da8..b7f2714ea 100644 --- a/Engine/source/afx/afxMagicSpell.cpp +++ b/Engine/source/afx/afxMagicSpell.cpp @@ -2633,29 +2633,29 @@ DefineEngineMethod(afxMagicSpell, getImpactedObject, S32, (),, return (imp_obj) ? imp_obj->getId() : -1; } -ConsoleMethod(afxMagicSpell, setTimeFactor, void, 3, 4, "(F32 factor) or (string phase, F32 factor)" - "Sets the time-factor for the spell, either overall or for a specific phrase.\n\n" - "@ingroup AFX") +DefineEngineStringlyVariadicMethod(afxMagicSpell, setTimeFactor, void, 3, 4, "(F32 factor) or (string phase, F32 factor)" + "Sets the time-factor for the spell, either overall or for a specific phrase.\n\n" + "@ingroup AFX") { - if (argc == 3) - object->setTimeFactor(dAtof(argv[2])); - else - { - if (dStricmp(argv[2], "overall") == 0) - object->setTimeFactor(dAtof(argv[3])); - else if (dStricmp(argv[2], "casting") == 0) - object->setTimeFactor(afxMagicSpell::CASTING_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "launch") == 0) - object->setTimeFactor(afxMagicSpell::LAUNCH_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "delivery") == 0) - object->setTimeFactor(afxMagicSpell::DELIVERY_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "impact") == 0) - object->setTimeFactor(afxMagicSpell::IMPACT_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "linger") == 0) - object->setTimeFactor(afxMagicSpell::LINGER_PHRASE, dAtof(argv[3])); - else - Con::errorf("afxMagicSpell::setTimeFactor() -- unknown spell phrase [%s].", argv[2].getStringValue()); - } + if (argc == 3) + object->setTimeFactor(dAtof(argv[2])); + else + { + if (dStricmp(argv[2], "overall") == 0) + object->setTimeFactor(dAtof(argv[3])); + else if (dStricmp(argv[2], "casting") == 0) + object->setTimeFactor(afxMagicSpell::CASTING_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "launch") == 0) + object->setTimeFactor(afxMagicSpell::LAUNCH_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "delivery") == 0) + object->setTimeFactor(afxMagicSpell::DELIVERY_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "impact") == 0) + object->setTimeFactor(afxMagicSpell::IMPACT_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "linger") == 0) + object->setTimeFactor(afxMagicSpell::LINGER_PHRASE, dAtof(argv[3])); + else + Con::errorf("afxMagicSpell::setTimeFactor() -- unknown spell phrase [%s].", argv[2].getStringValue()); + } } DefineEngineMethod(afxMagicSpell, interruptStage, void, (),, diff --git a/Engine/source/afx/arcaneFX.cpp b/Engine/source/afx/arcaneFX.cpp index 4252183c1..385c056f6 100644 --- a/Engine/source/afx/arcaneFX.cpp +++ b/Engine/source/afx/arcaneFX.cpp @@ -860,18 +860,18 @@ DefineEngineFunction(getMaxF, F32, (float a, float b),, return getMax(a, b); } -ConsoleFunction(echoThru, const char*, 2, 0, "(string passthru, string text...)" - "Like echo(), but first argument is returned.\n" - "@ingroup AFX") +DefineEngineStringlyVariadicFunction(echoThru, const char*, 2, 0, "(string passthru, string text...)" + "Like echo(), but first argument is returned.\n" + "@ingroup AFX") { U32 len = 0; S32 i; - for(i = 2; i < argc; i++) + for (i = 2; i < argc; i++) len += dStrlen(argv[i]); char *ret = Con::getReturnBuffer(len + 1); ret[0] = 0; - for(i = 2; i < argc; i++) + for (i = 2; i < argc; i++) dStrcat(ret, argv[i], len + 1); Con::printf("%s -- [%s]", ret, argv[1].getStringValue()); @@ -880,7 +880,7 @@ ConsoleFunction(echoThru, const char*, 2, 0, "(string passthru, string text...)" return argv[1]; } -ConsoleFunction(warnThru, const char*, 2, 0, "(string passthru, string text...)" +DefineEngineStringlyVariadicFunction(warnThru, const char*, 2, 0, "(string passthru, string text...)" "Like warn(), but first argument is returned.\n" "@ingroup AFX") { @@ -900,7 +900,7 @@ ConsoleFunction(warnThru, const char*, 2, 0, "(string passthru, string text...)" return argv[1]; } -ConsoleFunction(errorThru, const char*, 2, 0, "(string passthru, string text...)" +DefineEngineStringlyVariadicFunction(errorThru, const char*, 2, 0, "(string passthru, string text...)" "Like error(), but first argument is returned.\n" "@ingroup AFX") { diff --git a/Engine/source/app/net/net.cpp b/Engine/source/app/net/net.cpp index c5f1be189..abec3ccc1 100644 --- a/Engine/source/app/net/net.cpp +++ b/Engine/source/app/net/net.cpp @@ -212,7 +212,7 @@ ConsoleDocClass( RemoteCommandEvent, ConsoleFunctionGroupBegin( Net, "Functions for use with the network; tagged strings and remote commands."); -ConsoleFunction( commandToServer, void, 2, RemoteCommandEvent::MaxRemoteCommandArgs + 1, "(string func, ...)" +DefineEngineStringlyVariadicFunction( commandToServer, void, 2, RemoteCommandEvent::MaxRemoteCommandArgs + 1, "(string func, ...)" "@brief Send a command to the server.\n\n" "@param func Name of the server command being called\n" @@ -255,7 +255,7 @@ ConsoleFunction( commandToServer, void, 2, RemoteCommandEvent::MaxRemoteCommandA RemoteCommandEvent::sendRemoteCommand(conn, args.count(), args); } -ConsoleFunction( commandToClient, void, 3, RemoteCommandEvent::MaxRemoteCommandArgs + 2, "(NetConnection client, string func, ...)" +DefineEngineStringlyVariadicFunction( commandToClient, void, 3, RemoteCommandEvent::MaxRemoteCommandArgs + 2, "(NetConnection client, string func, ...)" "@brief Send a command from the server to the client\n\n" "@param client The numeric ID of a client GameConnection\n" @@ -349,7 +349,7 @@ DefineEngineFunction(getTaggedString, const char* , (const char *tag), (""), -ConsoleFunction( buildTaggedString, const char*, 2, 11, "(string format, ...)" +DefineEngineStringlyVariadicFunction( buildTaggedString, const char*, 2, 11, "(string format, ...)" "@brief Build a string using the specified tagged string format.\n\n" "This function takes an already tagged string (passed in as a tagged string ID) and one " diff --git a/Engine/source/cinterface/c_scripting.cpp b/Engine/source/cinterface/c_scripting.cpp index 1138cbc1c..f10effde2 100644 --- a/Engine/source/cinterface/c_scripting.cpp +++ b/Engine/source/cinterface/c_scripting.cpp @@ -420,7 +420,7 @@ extern "C" { } -ConsoleFunction(TestFunction2Args, const char *, 3, 3, "testFunction(arg1, arg2)") +DefineEngineStringlyVariadicFunction(TestFunction2Args, const char *, 3, 3, "testFunction(arg1, arg2)") { return "Return Value"; } diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index 358b738f9..dfa3cd5a8 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -1191,11 +1191,6 @@ public: # define ConsoleFunctionGroupBegin(groupName, usage) \ static ConsoleConstructor cfg_ConsoleFunctionGroup_##groupName##_GroupBegin(NULL,#groupName,usage) -# define ConsoleFunction(name,returnType,minArgs,maxArgs,usage1) \ - returnType cf_##name(SimObject *, S32, ConsoleValueRef *argv); \ - ConsoleConstructor cc_##name##_obj(NULL,#name,cf_##name,usage1,minArgs,maxArgs); \ - returnType cf_##name(SimObject *, S32 argc, ConsoleValueRef *argv) - # define ConsoleToolFunction(name,returnType,minArgs,maxArgs,usage1) \ returnType ctf_##name(SimObject *, S32, ConsoleValueRef *argv); \ ConsoleConstructor cc_##name##_obj(NULL,#name,ctf_##name,usage1,minArgs,maxArgs, true); \ @@ -1211,15 +1206,6 @@ public: # define ConsoleMethodGroupBegin(className, groupName, usage) \ static ConsoleConstructor cc_##className##_##groupName##_GroupBegin(#className,#groupName,usage) -# define ConsoleMethod(className,name,returnType,minArgs,maxArgs,usage1) \ - inline returnType cm_##className##_##name(className *, S32, ConsoleValueRef *argv); \ - returnType cm_##className##_##name##_caster(SimObject *object, S32 argc, ConsoleValueRef *argv) { \ - AssertFatal( dynamic_cast( object ), "Object passed to " #name " is not a " #className "!" ); \ - conmethod_return_##returnType ) cm_##className##_##name(static_cast(object),argc,argv); \ - }; \ - ConsoleConstructor cc_##className##_##name##_obj(#className,#name,cm_##className##_##name##_caster,usage1,minArgs,maxArgs); \ - inline returnType cm_##className##_##name(className *object, S32 argc, ConsoleValueRef *argv) - # define ConsoleMethodGroupEnd(className, groupName) \ static ConsoleConstructor cc_##className##_##groupName##_GroupEnd(#className,#groupName,NULL) diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index 565c79206..33c1c9a5f 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -1200,7 +1200,7 @@ DefineEngineFunction( isValidIP, bool, ( const char* str),, // Torque won't normally add another string if it already exists with another casing, // so this forces the addition. It should be called once near the start, such as in main.cs. -ConsoleFunction(addCaseSensitiveStrings,void,2,0,"[string1, string2, ...]" +DefineEngineStringlyVariadicFunction(addCaseSensitiveStrings,void,2,0,"[string1, string2, ...]" "Adds case sensitive strings to the StringTable.") { for(int i = 1; i < argc; i++) @@ -1879,7 +1879,7 @@ DefineEngineFunction( getTag, const char*, ( const char* textTagString ), , "( s //----------------------------------------------------------------------------- -ConsoleFunction( echo, void, 2, 0, "( string message... ) " +DefineEngineStringlyVariadicFunction( echo, void, 2, 0, "( string message... ) " "@brief Logs a message to the console.\n\n" "Concatenates all given arguments to a single string and prints the string to the console. " "A newline is added automatically after the text.\n\n" @@ -1902,7 +1902,7 @@ ConsoleFunction( echo, void, 2, 0, "( string message... ) " //----------------------------------------------------------------------------- -ConsoleFunction( warn, void, 2, 0, "( string message... ) " +DefineEngineStringlyVariadicFunction( warn, void, 2, 0, "( string message... ) " "@brief Logs a warning message to the console.\n\n" "Concatenates all given arguments to a single string and prints the string to the console as a warning " "message (in the in-game console, these will show up using a turquoise font by default). " @@ -1926,7 +1926,7 @@ ConsoleFunction( warn, void, 2, 0, "( string message... ) " //----------------------------------------------------------------------------- -ConsoleFunction( error, void, 2, 0, "( string message... ) " +DefineEngineStringlyVariadicFunction( error, void, 2, 0, "( string message... ) " "@brief Logs an error message to the console.\n\n" "Concatenates all given arguments to a single string and prints the string to the console as an error " "message (in the in-game console, these will show up using a red font by default). " @@ -2236,7 +2236,7 @@ DefineEngineFunction( generateUUID, Torque::UUID, (),, //----------------------------------------------------------------------------- -ConsoleFunction( call, const char *, 2, 0, "( string functionName, string args... ) " +DefineEngineStringlyVariadicFunction( call, const char *, 2, 0, "( string functionName, string args... ) " "Apply the given arguments to the specified global function and return the result of the call.\n\n" "@param functionName The name of the function to call. This function must be in the global namespace, i.e. " "you cannot call a function in a namespace through #call. Use eval() for that.\n" diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index 6d0484171..ab1717745 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -855,6 +855,64 @@ public: ); \ static inline returnType _fn ## className ## name ## impl args +# define DefineEngineStringlyVariadicFunction(name,returnType,minArgs,maxArgs,usage) \ + static inline returnType _fn ## name ## impl (SimObject *, S32 argc, ConsoleValueRef *argv); \ + TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## name \ + (S32 argc, const char** argv) \ + { \ + _CHECK_ENGINE_INITIALIZED( name, returnType ); \ + StringStackConsoleWrapper args(argc, argv); \ + return EngineTypeTraits< returnType >::ReturnValue( \ + _fn ## name ## impl(NULL, args.count(), args) \ + ); \ + } \ + static _EngineFunctionDefaultArguments< void (S32 argc, const char** argv) > _fn ## name ## DefaultArgs; \ + static EngineFunctionInfo _fn ## name ## FunctionInfo( \ + #name, \ + &_SCOPE<>()(), \ + usage, \ + #returnType " " #name "(S32 argc, const char** argv)", \ + "fn" #name, \ + TYPE< returnType (S32 argc, const char** argv) >(), \ + &_fn ## name ## DefaultArgs, \ + ( void* ) &fn ## name, \ + 0 \ + ); \ + ConsoleConstructor cc_##name##_obj(NULL,#name,_fn ## name ## impl,usage,minArgs,maxArgs); \ + returnType _fn ## name ## impl(SimObject *, S32 argc, ConsoleValueRef *argv) + +# define DefineEngineStringlyVariadicMethod(className, name,returnType,minArgs,maxArgs,usage) \ + static inline returnType _fn ## className ## _ ## name ## impl (className* object, S32 argc, ConsoleValueRef* argv); \ + TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## className ## _ ## name \ + (className* object, S32 argc, const char** argv) \ + { \ + _CHECK_ENGINE_INITIALIZED( name, returnType ); \ + StringStackConsoleWrapper args(argc, argv); \ + return EngineTypeTraits< returnType >::ReturnValue( \ + _fn ## className ## _ ## name ## impl(object, args.count(), args) \ + ); \ + } \ + static _EngineFunctionDefaultArguments< void (className* object, S32 argc, const char** argv) > _fn ## className ## _ ## name ## DefaultArgs; \ + static EngineFunctionInfo _fn ## className ## _ ## name ## FunctionInfo( \ + #name, \ + &_SCOPE<>()(), \ + usage, \ + #returnType " " #name "(SimObject* object, S32 argc, const char** argv)", \ + "fn" #className "_" #name, \ + TYPE< returnType (SimObject* object, S32 argc, const char** argv) >(), \ + &_fn ## className ## _ ## name ## DefaultArgs, \ + ( void* ) &fn ## className ## _ ## name, \ + 0 \ + ); \ + returnType cm_##className##_##name##_caster(SimObject* object, S32 argc, ConsoleValueRef* argv) { \ + AssertFatal( dynamic_cast( object ), "Object passed to " #name " is not a " #className "!" ); \ + conmethod_return_##returnType ) _fn ## className ## _ ## name ## impl(static_cast(object),argc,argv); \ + }; \ + ConsoleConstructor cc_##className##_##name##_obj(#className,#name,cm_##className##_##name##_caster,usage,minArgs,maxArgs); \ + static inline returnType _fn ## className ## _ ## name ## impl(className *object, S32 argc, ConsoleValueRef *argv) + + + // The following three macros are only temporary. They allow to define engineAPI functions using the framework // here in this file while being visible only in the new API. When the console interop is removed, these macros // can be removed and all their uses be replaced with their corresponding versions that now still include support diff --git a/Engine/source/console/sim.cpp b/Engine/source/console/sim.cpp index 6bb194db3..1fbcdd748 100644 --- a/Engine/source/console/sim.cpp +++ b/Engine/source/console/sim.cpp @@ -181,7 +181,7 @@ DefineEngineFunction( getTimeSinceStart, S32, (S32 scheduleId), ,"getTimeSinceSt return ret; } -ConsoleFunction(schedule, S32, 4, 0, "schedule(time, refobject|0, command, )") +DefineEngineStringlyVariadicFunction(schedule, S32, 4, 0, "schedule(time, refobject|0, command, )") { U32 timeDelta = U32(dAtof(argv[1])); SimObject *refObject = Sim::findObject(argv[2]); diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 62ac25fd1..02d7eec40 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -2945,7 +2945,7 @@ DefineEngineMethod( SimObject, setFieldType, void, ( const char* fieldName, cons //----------------------------------------------------------------------------- -ConsoleMethod( SimObject, call, const char*, 3, 0, "( string method, string args... ) Dynamically call a method on an object.\n" +DefineEngineStringlyVariadicMethod( SimObject, call, const char*, 3, 0, "( string method, string args... ) Dynamically call a method on an object.\n" "@param method Name of method to call.\n" "@param args Zero or more arguments for the method.\n" "@return The result of the method call." ) @@ -3047,7 +3047,7 @@ DefineEngineMethod( SimObject, delete, void, (),, //----------------------------------------------------------------------------- -ConsoleMethod( SimObject,schedule, S32, 4, 0, "( float time, string method, string args... ) Delay an invocation of a method.\n" +DefineEngineStringlyVariadicMethod( SimObject,schedule, S32, 4, 0, "( float time, string method, string args... ) Delay an invocation of a method.\n" "@param time The number of milliseconds after which to invoke the method. This is a soft limit.\n" "@param method The method to call.\n" "@param args The arguments with which to call the method.\n" diff --git a/Engine/source/console/simSet.cpp b/Engine/source/console/simSet.cpp index 545c411b7..e04416d30 100644 --- a/Engine/source/console/simSet.cpp +++ b/Engine/source/console/simSet.cpp @@ -895,15 +895,7 @@ DefineEngineMethod( SimSet, listObjects, void, (),, //----------------------------------------------------------------------------- -DEFINE_CALLIN( fnSimSet_add, add, SimSet, void, ( SimSet* set, SimObject* object ),,, - "Add the given object to the set.\n" - "@param object An object." ) -{ - if( object ) - set->addObject( object ); -} - -ConsoleMethod( SimSet, add, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, add, void, 3, 0, "( SimObject objects... ) Add the given objects to the set.\n" "@param objects The objects to add to the set." ) { @@ -919,15 +911,7 @@ ConsoleMethod( SimSet, add, void, 3, 0, //----------------------------------------------------------------------------- -DEFINE_CALLIN( fnSimSet_remove, remove, SimSet, void, ( SimSet* set, SimObject* object ),,, - "Remove the given object from the set.\n" - "@param object An object." ) -{ - if( object ) - set->removeObject( object ); -} - -ConsoleMethod( SimSet, remove, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, remove, void, 3, 0, "( SimObject objects... ) Remove the given objects from the set.\n" "@param objects The objects to remove from the set." ) { @@ -970,7 +954,7 @@ DefineEngineMethod( SimSet, getRandom, SimObject*, (),, //----------------------------------------------------------------------------- -ConsoleMethod( SimSet, callOnChildren, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, callOnChildren, void, 3, 0, "( string method, string args... ) Call a method on all objects contained in the set.\n\n" "@param method The name of the method to call.\n" "@param args The arguments to the method.\n\n" @@ -982,7 +966,7 @@ ConsoleMethod( SimSet, callOnChildren, void, 3, 0, //----------------------------------------------------------------------------- -ConsoleMethod( SimSet, callOnChildrenNoRecurse, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, callOnChildrenNoRecurse, void, 3, 0, "( string method, string args... ) Call a method on all objects contained in the set.\n\n" "@param method The name of the method to call.\n" "@param args The arguments to the method.\n\n" diff --git a/Engine/source/gui/editor/guiFilterCtrl.cpp b/Engine/source/gui/editor/guiFilterCtrl.cpp index c0d9c2a72..7870abe24 100644 --- a/Engine/source/gui/editor/guiFilterCtrl.cpp +++ b/Engine/source/gui/editor/guiFilterCtrl.cpp @@ -77,7 +77,7 @@ DefineEngineMethod( GuiFilterCtrl, getValue, const char*, (), , "Return a tuple return buffer; } -ConsoleMethod( GuiFilterCtrl, setValue, void, 3, 20, "(f1, f2, ...)" +DefineEngineStringlyVariadicMethod( GuiFilterCtrl, setValue, void, 3, 20, "(f1, f2, ...)" "Reset the filter to use the specified points, spread equidistantly across the domain." "@internal") { diff --git a/Engine/source/gui/editor/guiGraphCtrl.cpp b/Engine/source/gui/editor/guiGraphCtrl.cpp index 8b1c14108..343f56e24 100644 --- a/Engine/source/gui/editor/guiGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiGraphCtrl.cpp @@ -407,7 +407,7 @@ DefineEngineMethod( GuiGraphCtrl, setGraphType, void, ( S32 plotId, GuiGraphType //----------------------------------------------------------------------------- -ConsoleMethod( GuiGraphCtrl, matchScale, void, 3, GuiGraphCtrl::MaxPlots + 2, "( int plotID1, int plotID2, ... ) " +DefineEngineStringlyVariadicMethod( GuiGraphCtrl, matchScale, void, 3, GuiGraphCtrl::MaxPlots + 2, "( int plotID1, int plotID2, ... ) " "Set the scale of all specified plots to the maximum scale among them.\n\n" "@param plotID1 Index of plotting curve.\n" "@param plotID2 Index of plotting curve." ) diff --git a/Engine/source/gui/worldEditor/worldEditor.cpp b/Engine/source/gui/worldEditor/worldEditor.cpp index 24e710091..1f95b6376 100644 --- a/Engine/source/gui/worldEditor/worldEditor.cpp +++ b/Engine/source/gui/worldEditor/worldEditor.cpp @@ -3225,7 +3225,7 @@ void WorldEditor::setEditorTool(EditorTool* newTool) //------------------------------------------------------------------------------ -ConsoleMethod( WorldEditor, ignoreObjClass, void, 3, 0, "(string class_name, ...)") +DefineEngineStringlyVariadicMethod( WorldEditor, ignoreObjClass, void, 3, 0, "(string class_name, ...)") { object->ignoreObjClass(argc, argv); } diff --git a/Engine/source/platformWin32/winMath.cpp b/Engine/source/platformWin32/winMath.cpp index 50e5fdbc6..3b6e3ec15 100644 --- a/Engine/source/platformWin32/winMath.cpp +++ b/Engine/source/platformWin32/winMath.cpp @@ -33,7 +33,7 @@ extern void mInstall_AMD_Math(); extern void mInstall_Library_SSE(); //-------------------------------------- -ConsoleFunction( mathInit, void, 1, 10, "( ... )" +DefineEngineStringlyVariadicFunction( mathInit, void, 1, 10, "( ... )" "@brief Install the math library with specified extensions.\n\n" "Possible parameters are:\n\n" " - 'DETECT' Autodetect math lib settings.\n\n" diff --git a/Engine/source/sim/actionMap.cpp b/Engine/source/sim/actionMap.cpp index ca2932e84..a69ec4bea 100644 --- a/Engine/source/sim/actionMap.cpp +++ b/Engine/source/sim/actionMap.cpp @@ -2077,7 +2077,7 @@ static ConsoleDocFragment _ActionMapbind2( "ActionMap", "bool bind( string device, string action, string flag, string deadZone, string scale, string command );"); -ConsoleMethod( ActionMap, bind, bool, 5, 10, "actionMap.bind( device, action, [modifier, spec, mod...], command )" +DefineEngineStringlyVariadicMethod( ActionMap, bind, bool, 5, 10, "actionMap.bind( device, action, [modifier, spec, mod...], command )" "@hide") { StringStackWrapper args(argc - 2, argv + 2); @@ -2126,7 +2126,7 @@ static ConsoleDocFragment _ActionMapbindObj2( "ActionMap", "bool bindObj( string device, string action, string flag, string deadZone, string scale, string command, SimObjectID object );"); -ConsoleMethod( ActionMap, bindObj, bool, 6, 11, "(device, action, [modifier, spec, mod...], command, object)" +DefineEngineStringlyVariadicMethod( ActionMap, bindObj, bool, 6, 11, "(device, action, [modifier, spec, mod...], command, object)" "@hide") { SimObject* simObject = Sim::findObject(argv[argc - 1]);