Replaced a ton of ConsoleMethods with the DefineConsoleMethod Macro.

This commit is contained in:
Vincent Gee 2014-11-03 22:42:51 -05:00
parent 378a933894
commit acb192e2a5
133 changed files with 1716 additions and 2087 deletions

View file

@ -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;

View file

@ -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();
}

View file

@ -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();
}

View file

@ -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();
}

View file

@ -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();
}