Merge branch 'consolefuncrefactor' of https://github.com/jamesu/Torque3D into consolefuncrefactor

This commit is contained in:
DavidWyand-GG 2013-01-07 12:09:22 -05:00
commit 59aaaf1892
93 changed files with 1947 additions and 728 deletions

View file

@ -169,5 +169,5 @@ void GuiMaterialCtrl::onRender( Point2I offset, const RectI &updateRect )
ConsoleMethod( GuiMaterialCtrl, setMaterial, bool, 3, 3, "( string materialName )"
"Set the material to be displayed in the control." )
{
return object->setMaterial( argv[2] );
return object->setMaterial( (const char*)argv[2] );
}

View file

@ -431,7 +431,7 @@ ConsoleMethod( GuiPopUpMenuCtrl, setEnumContent, void, 4, 4, "(string class, str
// get it?
if(!classRep)
{
Con::warnf(ConsoleLogEntry::General, "failed to locate class rep for '%s'", argv[2]);
Con::warnf(ConsoleLogEntry::General, "failed to locate class rep for '%s'", (const char*)argv[2]);
return;
}
@ -444,7 +444,7 @@ ConsoleMethod( GuiPopUpMenuCtrl, setEnumContent, void, 4, 4, "(string class, str
// found it?
if(i == classRep->mFieldList.size())
{
Con::warnf(ConsoleLogEntry::General, "failed to locate field '%s' for class '%s'", argv[3], argv[2]);
Con::warnf(ConsoleLogEntry::General, "failed to locate field '%s' for class '%s'", (const char*)argv[3], (const char*)argv[2]);
return;
}
@ -454,7 +454,7 @@ ConsoleMethod( GuiPopUpMenuCtrl, setEnumContent, void, 4, 4, "(string class, str
// check the type
if( !conType->getEnumTable() )
{
Con::warnf(ConsoleLogEntry::General, "field '%s' is not an enumeration for class '%s'", argv[3], argv[2]);
Con::warnf(ConsoleLogEntry::General, "field '%s' is not an enumeration for class '%s'", (const char*)argv[3], (const char*)argv[2]);
return;
}

View file

@ -604,7 +604,7 @@ ConsoleMethod( GuiPopUpMenuCtrlEx, setEnumContent, void, 4, 4,
// get it?
if(!classRep)
{
Con::warnf(ConsoleLogEntry::General, "failed to locate class rep for '%s'", argv[2]);
Con::warnf(ConsoleLogEntry::General, "failed to locate class rep for '%s'", (const char*)argv[2]);
return;
}
@ -617,7 +617,7 @@ ConsoleMethod( GuiPopUpMenuCtrlEx, setEnumContent, void, 4, 4,
// found it?
if(i == classRep->mFieldList.size())
{
Con::warnf(ConsoleLogEntry::General, "failed to locate field '%s' for class '%s'", argv[3], argv[2]);
Con::warnf(ConsoleLogEntry::General, "failed to locate field '%s' for class '%s'", (const char*)argv[3], (const char*)argv[2]);
return;
}
@ -627,7 +627,7 @@ ConsoleMethod( GuiPopUpMenuCtrlEx, setEnumContent, void, 4, 4,
// check the type
if( !conType->getEnumTable() )
{
Con::warnf(ConsoleLogEntry::General, "field '%s' is not an enumeration for class '%s'", argv[3], argv[2]);
Con::warnf(ConsoleLogEntry::General, "field '%s' is not an enumeration for class '%s'", (const char*)argv[3], (const char*)argv[2]);
return;
}

View file

@ -4928,7 +4928,7 @@ ConsoleMethod( GuiTreeViewCtrl, setItemTooltip, void, 4, 4, "( int id, string te
return;
}
item->mTooltip = argv[ 3 ];
item->mTooltip = (const char*)argv[ 3 ];
}
ConsoleMethod( GuiTreeViewCtrl, setItemImages, void, 5, 5, "( int id, int normalImage, int expandedImage ) - Sets the normal and expanded images to show for the given item." )

View file

@ -2007,7 +2007,7 @@ ConsoleMethod( GuiCanvas, pushDialog, void, 3, 5, "(GuiControl ctrl, int layer=0
if (! Sim::findObject(argv[2], gui))
{
Con::printf("%s(): Invalid control: %s", argv[0], argv[2]);
Con::printf("%s(): Invalid control: %s", (const char*)argv[0], (const char*)argv[2]);
return;
}
@ -2052,7 +2052,7 @@ ConsoleMethod( GuiCanvas, popDialog, void, 2, 3, "(GuiControl ctrl=NULL)"
{
if (!Sim::findObject(argv[2], gui))
{
Con::printf("%s(): Invalid control: %s", argv[0], argv[2]);
Con::printf("%s(): Invalid control: %s", (const char*)argv[0], (const char*)argv[2]);
return;
}
}

View file

@ -308,7 +308,7 @@ void GuiControl::initPersistFields()
//-----------------------------------------------------------------------------
bool GuiControl::processArguments(S32 argc, const char **argv)
bool GuiControl::processArguments(S32 argc, ConsoleValueRef *argv)
{
// argv[0] - The GuiGroup to add this control to when it's created.
// this is an optional parameter that may be specified at

View file

@ -330,7 +330,7 @@ class GuiControl : public SimGroup
GuiControl();
virtual ~GuiControl();
virtual bool processArguments(S32 argc, const char **argv);
virtual bool processArguments(S32 argc, ConsoleValueRef *argv);
static void initPersistFields();
static void consoleInit();

View file

@ -2540,7 +2540,7 @@ ConsoleMethod( GuiEditCtrl, setCurrentAddSet, void, 3, 3, "(GuiControl ctrl)")
if (!Sim::findObject(argv[2], addSet))
{
Con::printf("%s(): Invalid control: %s", argv[0], argv[2]);
Con::printf("%s(): Invalid control: %s", (const char*)argv[0], (const char*)argv[2]);
return;
}
object->setCurrentAddSet(addSet);
@ -2700,7 +2700,7 @@ ConsoleMethod( GuiEditCtrl, readGuides, void, 3, 4, "( GuiControl ctrl [, int ax
GuiControl* ctrl;
if( !Sim::findObject( argv[ 2 ], ctrl ) )
{
Con::errorf( "GuiEditCtrl::readGuides - no control '%s'", argv[ 2 ] );
Con::errorf( "GuiEditCtrl::readGuides - no control '%s'", (const char*)argv[ 2 ] );
return;
}
@ -2711,7 +2711,7 @@ ConsoleMethod( GuiEditCtrl, readGuides, void, 3, 4, "( GuiControl ctrl [, int ax
S32 axis = dAtoi( argv[ 3 ] );
if( axis < 0 || axis > 1 )
{
Con::errorf( "GuiEditCtrl::readGuides - invalid axis '%s'", argv[ 3 ] );
Con::errorf( "GuiEditCtrl::readGuides - invalid axis '%s'", (const char*)argv[ 3 ] );
return;
}
@ -2733,7 +2733,7 @@ ConsoleMethod( GuiEditCtrl, writeGuides, void, 3, 4, "( GuiControl ctrl [, int a
GuiControl* ctrl;
if( !Sim::findObject( argv[ 2 ], ctrl ) )
{
Con::errorf( "GuiEditCtrl::writeGuides - no control '%i'", argv[ 2 ] );
Con::errorf( "GuiEditCtrl::writeGuides - no control '%i'", (const char*)argv[ 2 ] );
return;
}
@ -2744,7 +2744,7 @@ ConsoleMethod( GuiEditCtrl, writeGuides, void, 3, 4, "( GuiControl ctrl [, int a
S32 axis = dAtoi( argv[ 3 ] );
if( axis < 0 || axis > 1 )
{
Con::errorf( "GuiEditCtrl::writeGuides - invalid axis '%s'", argv[ 3 ] );
Con::errorf( "GuiEditCtrl::writeGuides - invalid axis '%s'", (const char*)argv[ 3 ] );
return;
}

View file

@ -83,10 +83,9 @@ ConsoleMethod( GuiFilterCtrl, setValue, void, 3, 20, "(f1, f2, ...)"
{
Filter filter;
argc -= 2;
argv += 2;
StringStackWrapper args(argc - 2, argv + 2);
filter.set(argc, argv);
filter.set(args.count(), args);
object->set(filter);
}

View file

@ -777,7 +777,7 @@ ConsoleMethod( GuiInspector, inspect, void, 3, 3, "Inspect(Object)")
if(!target)
{
if(dAtoi(argv[2]) > 0)
Con::warnf("%s::inspect(): invalid object: %s", argv[0], argv[2]);
Con::warnf("%s::inspect(): invalid object: %s", (const char*)argv[0], (const char*)argv[2]);
object->clearInspectObjects();
return;
@ -793,7 +793,7 @@ ConsoleMethod( GuiInspector, addInspect, void, 3, 4, "( id object, (bool autoSyn
SimObject* obj;
if( !Sim::findObject( argv[ 2 ], obj ) )
{
Con::errorf( "%s::addInspect(): invalid object: %s", argv[ 0 ], argv[ 2 ] );
Con::errorf( "%s::addInspect(): invalid object: %s", (const char*)argv[ 0 ], (const char*)argv[ 2 ] );
return;
}
@ -810,7 +810,7 @@ ConsoleMethod( GuiInspector, removeInspect, void, 3, 3, "( id object ) - Remove
SimObject* obj;
if( !Sim::findObject( argv[ 2 ], obj ) )
{
Con::errorf( "%s::removeInspect(): invalid object: %s", argv[ 0 ], argv[ 2 ] );
Con::errorf( "%s::removeInspect(): invalid object: %s", (const char*)argv[ 0 ], (const char*)argv[ 2 ] );
return;
}

View file

@ -571,7 +571,7 @@ void GuiInspectorTypeFileName::updateValue()
ConsoleMethod( GuiInspectorTypeFileName, apply, void, 3,3, "apply(newValue);" )
{
String path( argv[2] );
String path( (const char*)argv[2] );
if ( path.isNotEmpty() )
path = Platform::makeRelativePathName( path, Platform::getMainDotCsDir() );

View file

@ -264,7 +264,7 @@ ConsoleMethod( CreatorTree, fileNameMatch, bool, 5, 5, "(string world, string ty
if(dToupper(argv[4][0]) != dToupper(argv[2][0]))
return(false);
return(!dStrnicmp(argv[4]+1, argv[3], typeLen));
return(!dStrnicmp(((const char*)argv[4])+1, argv[3], typeLen));
}
ConsoleMethod( CreatorTree, getSelected, S32, 2, 2, "Return a handle to the currently selected item.")

View file

@ -212,7 +212,7 @@ ConsoleStaticMethod( EditorIconRegistry, findIconBySimObject, const char*, 2, 2,
SimObject *obj = NULL;
if ( !Sim::findObject( argv[1], obj ) )
{
Con::warnf( "EditorIconRegistry::findIcon, parameter %d was not a SimObject!", argv[1] );
Con::warnf( "EditorIconRegistry::findIcon, parameter %d was not a SimObject!", (const char*)argv[1] );
return NULL;
}

View file

@ -792,7 +792,7 @@ ConsoleMethod( GuiDecalEditorCtrl, deleteSelectedDecal, void, 2, 2, "deleteSelec
ConsoleMethod( GuiDecalEditorCtrl, deleteDecalDatablock, void, 3, 3, "deleteSelectedDecalDatablock( String datablock )" )
{
String lookupName( argv[2] );
String lookupName( (const char*)argv[2] );
if( lookupName == String::EmptyString )
return;
@ -801,7 +801,7 @@ ConsoleMethod( GuiDecalEditorCtrl, deleteDecalDatablock, void, 3, 3, "deleteSele
ConsoleMethod( GuiDecalEditorCtrl, setMode, void, 3, 3, "setMode( String mode )()" )
{
String newMode = ( argv[2] );
String newMode = ( (const char*)argv[2] );
object->setMode( newMode );
}
@ -868,7 +868,7 @@ ConsoleMethod( GuiDecalEditorCtrl, editDecalDetails, void, 4, 4, "editDecalDetai
if ( (count != 7) )
{
Con::printf("Failed to parse decal information \"px py pz tx ty tz s\" from '%s'", argv[3]);
Con::printf("Failed to parse decal information \"px py pz tx ty tz s\" from '%s'", (const char*)argv[3]);
return;
}
@ -1253,4 +1253,4 @@ void DBRetargetUndoAction::redo()
if ( mEditor->isMethod( "rebuildInstanceTree" ) )
Con::executef( mEditor, "rebuildInstanceTree" );
}
#endif
#endif

View file

@ -2500,7 +2500,7 @@ ConsoleMethod( TerrainEditor, attachTerrain, void, 2, 3, "(TerrainBlock terrain)
terrains.push_back(terrBlock);
if(terrains.size() == 0)
Con::errorf(ConsoleLogEntry::Script, "TerrainEditor::attach: failed to attach to object '%s'", argv[2]);
Con::errorf(ConsoleLogEntry::Script, "TerrainEditor::attach: failed to attach to object '%s'", (const char*)argv[2]);
}
if (terrains.size() > 0)

View file

@ -2758,7 +2758,7 @@ void WorldEditor::initPersistFields()
//------------------------------------------------------------------------------
// These methods are needed for the console interfaces.
void WorldEditor::ignoreObjClass( U32 argc, const char **argv )
void WorldEditor::ignoreObjClass( U32 argc, ConsoleValueRef *argv )
{
for(S32 i = 2; i < argc; i++)
{
@ -3207,7 +3207,7 @@ ConsoleMethod( WorldEditor, setActiveSelection, void, 3, 3, "( id set ) - Set th
WorldEditorSelection* selection;
if( !Sim::findObject( argv[ 2 ], selection ) )
{
Con::errorf( "WorldEditor::setActiveSelectionSet - no selection set '%s'", argv[ 2 ] );
Con::errorf( "WorldEditor::setActiveSelectionSet - no selection set '%s'", (const char*)argv[ 2 ] );
return;
}
@ -3333,14 +3333,14 @@ ConsoleMethod( WorldEditor, alignByBounds, void, 3, 3, "(int boundsAxis)"
"Align all selected objects against the given bounds axis.")
{
if(!object->alignByBounds(dAtoi(argv[2])))
Con::warnf(ConsoleLogEntry::General, avar("worldEditor.alignByBounds: invalid bounds axis '%s'", argv[2]));
Con::warnf(ConsoleLogEntry::General, avar("worldEditor.alignByBounds: invalid bounds axis '%s'", (const char*)argv[2]));
}
ConsoleMethod( WorldEditor, alignByAxis, void, 3, 3, "(int axis)"
"Align all selected objects along the given axis.")
{
if(!object->alignByAxis(dAtoi(argv[2])))
Con::warnf(ConsoleLogEntry::General, avar("worldEditor.alignByAxis: invalid axis '%s'", argv[2]));
Con::warnf(ConsoleLogEntry::General, avar("worldEditor.alignByAxis: invalid axis '%s'", (const char*)argv[2]));
}
ConsoleMethod( WorldEditor, resetSelectedRotation, void, 2, 2, "")
@ -3545,7 +3545,7 @@ void WorldEditor::colladaExportSelection( const String &path )
ConsoleMethod( WorldEditor, colladaExportSelection, void, 3, 3,
"( String path ) - Export the combined geometry of all selected objects to the specified path in collada format." )
{
object->colladaExportSelection( argv[2] );
object->colladaExportSelection( (const char*)argv[2] );
}
void WorldEditor::makeSelectionPrefab( const char *filename )

View file

@ -76,7 +76,7 @@ class WorldEditor : public EditTSCtrl
Point3F p2;
};
void ignoreObjClass(U32 argc, const char** argv);
void ignoreObjClass(U32 argc, ConsoleValueRef* argv);
void clearIgnoreList();
static bool setObjectsUseBoxCenter( void *object, const char *index, const char *data ) { static_cast<WorldEditor*>(object)->setObjectsUseBoxCenter( dAtob( data ) ); return false; };

View file

@ -682,7 +682,7 @@ ConsoleMethod( WorldEditorSelection, union, void, 3, 3, "( SimSet set ) - Add al
SimSet* selection;
if( !Sim::findObject( argv[ 2 ], selection ) )
{
Con::errorf( "WorldEditorSelection::union - no SimSet '%s'", argv[ 2 ] );
Con::errorf( "WorldEditorSelection::union - no SimSet '%s'", (const char*)argv[ 2 ] );
return;
}
@ -698,7 +698,7 @@ ConsoleMethod( WorldEditorSelection, subtract, void, 3, 3, "( SimSet ) - Remove
SimSet* selection;
if( !Sim::findObject( argv[ 2 ], selection ) )
{
Con::errorf( "WorldEditorSelection::subtract - no SimSet '%s'", argv[ 2 ] );
Con::errorf( "WorldEditorSelection::subtract - no SimSet '%s'", (const char*)argv[ 2 ] );
return;
}