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

@ -20,6 +20,7 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "console/engineAPI.h"
#include "platform/platform.h"
#include "ts/collada/colladaUtils.h"
@ -139,7 +140,7 @@ static void processNodeLights(AppNode* appNode, const MatrixF& offset, SimGroup*
}
// Load lights from a collada file and add to the scene.
ConsoleFunction( loadColladaLights, bool, 2, 4,
DefineConsoleFunction( 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"
@ -162,17 +163,17 @@ ConsoleFunction( loadColladaLights, bool, 2, 4,
"@ingroup Editors\n"
"@internal")
{
Torque::Path path((const char*)argv[1]);
Torque::Path path(filename);
// Optional group to add the lights to. Create if it does not exist, and use
// the MissionGroup if not specified.
SimGroup* missionGroup = dynamic_cast<SimGroup*>(Sim::findObject("MissionGroup"));
SimGroup* group = 0;
if ((argc > 2) && (argv[2][0])) {
if (!Sim::findObject(argv[2], group)) {
if ( parentGroup != "" ) {
if (!Sim::findObject(parentGroup, group)) {
// Create the group if it could not be found
group = new SimGroup;
if (group->registerObject((const char*)argv[2])) {
if (group->registerObject(parentGroup)) {
if (missionGroup)
missionGroup->addObject(group);
}
@ -187,9 +188,9 @@ ConsoleFunction( loadColladaLights, bool, 2, 4,
// Optional object to provide the base transform
MatrixF offset(true);
if (argc > 3) {
if (baseObject != "") {
SceneObject *obj;
if (Sim::findObject(argv[3], obj))
if (Sim::findObject(baseObject, obj))
offset = obj->getTransform();
}