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

@ -24,6 +24,7 @@
#include "environment/editors/guiRoadEditorCtrl.h"
#include "console/consoleTypes.h"
#include "console/engineAPI.h"
#include "scene/sceneManager.h"
#include "collision/collision.h"
#include "math/util/frustum.h"
@ -1036,86 +1037,71 @@ void GuiRoadEditorCtrl::submitUndo( const UTF8 *name )
undoMan->addAction( action );
}
ConsoleMethod( GuiRoadEditorCtrl, deleteNode, void, 2, 2, "deleteNode()" )
DefineConsoleMethod( GuiRoadEditorCtrl, deleteNode, void, (), , "deleteNode()" )
{
object->deleteSelectedNode();
}
ConsoleMethod( GuiRoadEditorCtrl, getMode, const char*, 2, 2, "" )
DefineConsoleMethod( GuiRoadEditorCtrl, getMode, const char*, (), , "" )
{
return object->getMode();
}
ConsoleMethod( GuiRoadEditorCtrl, setMode, void, 3, 3, "setMode( String mode )" )
DefineConsoleMethod( GuiRoadEditorCtrl, setMode, void, ( const char * mode ), , "setMode( String mode )" )
{
String newMode = ( argv[2] );
String newMode = ( mode );
object->setMode( newMode );
}
ConsoleMethod( GuiRoadEditorCtrl, getNodeWidth, F32, 2, 2, "" )
DefineConsoleMethod( GuiRoadEditorCtrl, getNodeWidth, F32, (), , "" )
{
return object->getNodeWidth();
}
ConsoleMethod( GuiRoadEditorCtrl, setNodeWidth, void, 3, 3, "" )
DefineConsoleMethod( GuiRoadEditorCtrl, setNodeWidth, void, ( F32 width ), , "" )
{
object->setNodeWidth( dAtof(argv[2]) );
object->setNodeWidth( width );
}
ConsoleMethod( GuiRoadEditorCtrl, getNodePosition, const char*, 2, 2, "" )
DefineConsoleMethod( GuiRoadEditorCtrl, getNodePosition, Point3F, (), , "" )
{
static const U32 bufSize = 256;
char* returnBuffer = Con::getReturnBuffer(bufSize);
dSprintf(returnBuffer, bufSize, "%f %f %f",
object->getNodePosition().x, object->getNodePosition().y, object->getNodePosition().z);
return returnBuffer;
return object->getNodePosition();
}
ConsoleMethod( GuiRoadEditorCtrl, setNodePosition, void, 3, 3, "" )
DefineConsoleMethod( GuiRoadEditorCtrl, setNodePosition, void, ( Point3F pos ), , "" )
{
Point3F pos;
S32 count = dSscanf( argv[2], "%f %f %f",
&pos.x, &pos.y, &pos.z);
if ( (count != 3) )
{
Con::printf("Failed to parse node information \"px py pz\" from '%s'", (const char*)argv[3]);
return;
}
object->setNodePosition( pos );
}
ConsoleMethod( GuiRoadEditorCtrl, setSelectedRoad, void, 2, 3, "" )
DefineConsoleMethod( GuiRoadEditorCtrl, setSelectedRoad, void, ( const char * pathRoad ), (""), "" )
{
if ( argc == 2 )
if (dStrcmp( pathRoad,"")==0 )
object->setSelectedRoad(NULL);
else
{
DecalRoad *road = NULL;
if ( Sim::findObject( argv[2], road ) )
if ( Sim::findObject( pathRoad, road ) )
object->setSelectedRoad(road);
}
}
ConsoleMethod( GuiRoadEditorCtrl, getSelectedRoad, const char*, 2, 2, "" )
DefineConsoleMethod( GuiRoadEditorCtrl, getSelectedRoad, S32, (), , "" )
{
DecalRoad *road = object->getSelectedRoad();
if ( road )
return road->getIdString();
return road->getId();
return NULL;
}
ConsoleMethod( GuiRoadEditorCtrl, getSelectedNode, S32, 2, 2, "" )
DefineConsoleMethod( GuiRoadEditorCtrl, getSelectedNode, S32, (), , "" )
{
return object->getSelectedNode();
}
ConsoleMethod( GuiRoadEditorCtrl, deleteRoad, void, 2, 2, "" )
DefineConsoleMethod( GuiRoadEditorCtrl, deleteRoad, void, (), , "" )
{
object->deleteSelectedRoad();
}