mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 14:44:36 +00:00
Replaced a ton of ConsoleMethods with the DefineConsoleMethod Macro.
This commit is contained in:
parent
378a933894
commit
acb192e2a5
133 changed files with 1716 additions and 2087 deletions
|
|
@ -23,7 +23,7 @@
|
|||
#include "platform/platform.h"
|
||||
#include "forest/editor/forestBrushElement.h"
|
||||
|
||||
#include "console/consoleTypes.h"
|
||||
#include "console/engineAPI.h"
|
||||
#include "forest/forestItem.h"
|
||||
|
||||
|
||||
|
|
@ -187,10 +187,10 @@ bool ForestBrush::containsItemData( const ForestItemData *inData )
|
|||
return false;
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestBrush, containsItemData, bool, 3, 3, "( ForestItemData obj )" )
|
||||
DefineConsoleMethod( ForestBrush, containsItemData, bool, ( const char * obj ), , "( ForestItemData obj )" )
|
||||
{
|
||||
ForestItemData *data = NULL;
|
||||
if ( !Sim::findObject( argv[2], data ) )
|
||||
if ( !Sim::findObject( obj, data ) )
|
||||
{
|
||||
Con::warnf( "ForestBrush::containsItemData - invalid object passed" );
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "gui/worldEditor/editTSCtrl.h"
|
||||
#include "console/consoleTypes.h"
|
||||
#include "console/engineAPI.h"
|
||||
#include "core/util/tVector.h"
|
||||
#include "gfx/gfxDrawUtil.h"
|
||||
#include "gui/core/guiCanvas.h"
|
||||
|
|
@ -681,7 +682,7 @@ bool ForestBrushTool::getGroundAt( const Point3F &worldPt, F32 *zValueOut, Vecto
|
|||
return true;
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestBrushTool, collectElements, void, 2, 2, "" )
|
||||
DefineConsoleMethod( ForestBrushTool, collectElements, void, (), , "" )
|
||||
{
|
||||
object->collectElements();
|
||||
}
|
||||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "forest/editor/forestBrushTool.h"
|
||||
#include "console/consoleTypes.h"
|
||||
#include "console/engineAPI.h"
|
||||
#include "gui/core/guiCanvas.h"
|
||||
#include "windowManager/platformCursorController.h"
|
||||
#include "forest/editor/forestUndo.h"
|
||||
|
|
@ -370,33 +371,33 @@ bool ForestEditorCtrl::isDirty()
|
|||
return foundDirty;
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestEditorCtrl, updateActiveForest, void, 2, 2, "()" )
|
||||
DefineConsoleMethod( ForestEditorCtrl, updateActiveForest, void, (), , "()" )
|
||||
{
|
||||
object->updateActiveForest( true );
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestEditorCtrl, setActiveTool, void, 3, 3, "( ForestTool tool )" )
|
||||
DefineConsoleMethod( ForestEditorCtrl, setActiveTool, void, ( const char * toolName ), , "( ForestTool tool )" )
|
||||
{
|
||||
ForestTool *tool = dynamic_cast<ForestTool*>( Sim::findObject( argv[2] ) );
|
||||
ForestTool *tool = dynamic_cast<ForestTool*>( Sim::findObject( toolName ) );
|
||||
object->setActiveTool( tool );
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestEditorCtrl, getActiveTool, S32, 2, 2, "()" )
|
||||
DefineConsoleMethod( ForestEditorCtrl, getActiveTool, S32, (), , "()" )
|
||||
{
|
||||
ForestTool *tool = object->getActiveTool();
|
||||
return tool ? tool->getId() : 0;
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestEditorCtrl, deleteMeshSafe, void, 3, 3, "( ForestItemData obj )" )
|
||||
DefineConsoleMethod( ForestEditorCtrl, deleteMeshSafe, void, ( const char * obj ), , "( ForestItemData obj )" )
|
||||
{
|
||||
ForestItemData *db;
|
||||
if ( !Sim::findObject( argv[2], db ) )
|
||||
if ( !Sim::findObject( obj, db ) )
|
||||
return;
|
||||
|
||||
object->deleteMeshSafe( db );
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestEditorCtrl, isDirty, bool, 2, 2, "" )
|
||||
DefineConsoleMethod( ForestEditorCtrl, isDirty, bool, (), , "" )
|
||||
{
|
||||
return object->isDirty();
|
||||
}
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
#include "gui/worldEditor/editTSCtrl.h"
|
||||
#include "gui/worldEditor/gizmo.h"
|
||||
#include "console/consoleTypes.h"
|
||||
#include "console/engineAPI.h"
|
||||
#include "core/util/tVector.h"
|
||||
#include "core/util/safeDelete.h"
|
||||
#include "gfx/gfxDrawUtil.h"
|
||||
|
|
@ -558,32 +559,32 @@ void ForestSelectionTool::onUndoAction()
|
|||
mBounds.intersect( mSelection[i].getWorldBox() );
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestSelectionTool, getSelectionCount, S32, 2, 2, "" )
|
||||
DefineConsoleMethod( ForestSelectionTool, getSelectionCount, S32, (), , "" )
|
||||
{
|
||||
return object->getSelectionCount();
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestSelectionTool, deleteSelection, void, 2, 2, "" )
|
||||
DefineConsoleMethod( ForestSelectionTool, deleteSelection, void, (), , "" )
|
||||
{
|
||||
object->deleteSelection();
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestSelectionTool, clearSelection, void, 2, 2, "" )
|
||||
DefineConsoleMethod( ForestSelectionTool, clearSelection, void, (), , "" )
|
||||
{
|
||||
object->clearSelection();
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestSelectionTool, cutSelection, void, 2, 2, "" )
|
||||
DefineConsoleMethod( ForestSelectionTool, cutSelection, void, (), , "" )
|
||||
{
|
||||
object->cutSelection();
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestSelectionTool, copySelection, void, 2, 2, "" )
|
||||
DefineConsoleMethod( ForestSelectionTool, copySelection, void, (), , "" )
|
||||
{
|
||||
object->copySelection();
|
||||
}
|
||||
|
||||
ConsoleMethod( ForestSelectionTool, pasteSelection, void, 2, 2, "" )
|
||||
DefineConsoleMethod( ForestSelectionTool, pasteSelection, void, (), , "" )
|
||||
{
|
||||
object->pasteSelection();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,8 +38,10 @@
|
|||
#include "environment/sun.h"
|
||||
#include "scene/sceneManager.h"
|
||||
#include "math/mathUtils.h"
|
||||
#include "math/mTransform.h"
|
||||
#include "T3D/physics/physicsBody.h"
|
||||
#include "forest/editor/forestBrushElement.h"
|
||||
#include "console/engineAPI.h"
|
||||
|
||||
/// For frame signal
|
||||
#include "gui/core/guiCanvas.h"
|
||||
|
|
@ -359,23 +361,22 @@ void Forest::saveDataFile( const char *path )
|
|||
mData->write( mDataFileName );
|
||||
}
|
||||
|
||||
ConsoleMethod( Forest, saveDataFile, bool, 2, 3, "saveDataFile( [path] )" )
|
||||
DefineConsoleMethod( Forest, saveDataFile, void, (const char * path), (""), "saveDataFile( [path] )" )
|
||||
{
|
||||
object->saveDataFile( argc == 3 ? (const char*)argv[2] : NULL );
|
||||
return true;
|
||||
object->saveDataFile( path );
|
||||
}
|
||||
|
||||
ConsoleMethod(Forest, isDirty, bool, 2, 2, "()")
|
||||
DefineConsoleMethod(Forest, isDirty, bool, (), , "()")
|
||||
{
|
||||
return object->getData() && object->getData()->isDirty();
|
||||
}
|
||||
|
||||
ConsoleMethod(Forest, regenCells, void, 2, 2, "()")
|
||||
DefineConsoleMethod(Forest, regenCells, void, (), , "()")
|
||||
{
|
||||
object->getData()->regenCells();
|
||||
}
|
||||
|
||||
ConsoleMethod(Forest, clear, void, 2, 2, "()" )
|
||||
DefineConsoleMethod(Forest, clear, void, (), , "()" )
|
||||
{
|
||||
object->clear();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue