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/guiRiverEditorCtrl.h"
#include "console/consoleTypes.h"
#include "console/engineAPI.h"
#include "environment/river.h"
#include "renderInstance/renderPassManager.h"
#include "collision/collision.h"
@ -1392,118 +1393,87 @@ void GuiRiverEditorCtrl::_renderSelectedRiver( ObjectRenderInst *ri, SceneRender
}
}
ConsoleMethod( GuiRiverEditorCtrl, deleteNode, void, 2, 2, "deleteNode()" )
DefineConsoleMethod( GuiRiverEditorCtrl, deleteNode, void, (), , "deleteNode()" )
{
object->deleteSelectedNode();
}
ConsoleMethod( GuiRiverEditorCtrl, getMode, const char*, 2, 2, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, getMode, const char*, (), , "" )
{
return object->getMode();
}
ConsoleMethod( GuiRiverEditorCtrl, setMode, void, 3, 3, "setMode( String mode )" )
DefineConsoleMethod( GuiRiverEditorCtrl, setMode, void, ( const char * mode ), , "setMode( String mode )" )
{
String newMode = ( argv[2] );
String newMode = ( mode );
object->setMode( newMode );
}
ConsoleMethod( GuiRiverEditorCtrl, getNodeWidth, F32, 2, 2, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, getNodeWidth, F32, (), , "" )
{
return object->getNodeWidth();
}
ConsoleMethod( GuiRiverEditorCtrl, setNodeWidth, void, 3, 3, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, setNodeWidth, void, ( F32 width ), , "" )
{
object->setNodeWidth( dAtof(argv[2]) );
object->setNodeWidth( width );
}
ConsoleMethod( GuiRiverEditorCtrl, getNodeDepth, F32, 2, 2, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, getNodeDepth, F32, (), , "" )
{
return object->getNodeDepth();
}
ConsoleMethod( GuiRiverEditorCtrl, setNodeDepth, void, 3, 3, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, setNodeDepth, void, ( F32 depth ), , "" )
{
object->setNodeDepth( dAtof(argv[2]) );
object->setNodeDepth( depth );
}
ConsoleMethod( GuiRiverEditorCtrl, getNodePosition, const char*, 2, 2, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, 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( GuiRiverEditorCtrl, setNodePosition, void, 3, 3, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, 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( GuiRiverEditorCtrl, getNodeNormal, const char*, 2, 2, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, getNodeNormal, Point3F, (), , "" )
{
static const U32 bufSize = 256;
char* returnBuffer = Con::getReturnBuffer(bufSize);
dSprintf(returnBuffer, bufSize, "%f %f %f",
object->getNodeNormal().x, object->getNodeNormal().y, object->getNodeNormal().z);
return returnBuffer;
return object->getNodeNormal();
}
ConsoleMethod( GuiRiverEditorCtrl, setNodeNormal, void, 3, 3, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, setNodeNormal, void, (Point3F normal), , "" )
{
VectorF normal;
S32 count = dSscanf( argv[2], "%f %f %f",
&normal.x, &normal.y, &normal.z);
if ( (count != 3) )
{
Con::printf("Failed to parse node information \"px py pz\" from '%s'", (const char*)argv[3]);
return;
}
object->setNodeNormal( normal );
}
ConsoleMethod( GuiRiverEditorCtrl, setSelectedRiver, void, 2, 3, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, setSelectedRiver, void, (const char * objName), (""), "" )
{
if ( argc == 2 )
if (dStrcmp( objName,"" )==0)
object->setSelectedRiver(NULL);
else
{
River *river = NULL;
if ( Sim::findObject( argv[2], river ) )
if ( Sim::findObject( objName, river ) )
object->setSelectedRiver(river);
}
}
ConsoleMethod( GuiRiverEditorCtrl, getSelectedRiver, const char*, 2, 2, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, getSelectedRiver, S32, (), , "" )
{
River *river = object->getSelectedRiver();
if ( !river )
return NULL;
return river->getIdString();
return river->getId();
}
ConsoleMethod( GuiRiverEditorCtrl, regenerate, void, 2, 2, "" )
DefineConsoleMethod( GuiRiverEditorCtrl, regenerate, void, (), , "" )
{
River *river = object->getSelectedRiver();
if ( river )