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 "materials/materialDefinition.h"
#include "console/consoleTypes.h"
#include "console/engineAPI.h"
#include "math/mathTypes.h"
#include "materials/materialManager.h"
#include "sceneData.h"
@ -594,55 +595,55 @@ void Material::StageData::getFeatureSet( FeatureSet *outFeatures ) const
}
}
ConsoleMethod( Material, flush, void, 2, 2,
DefineConsoleMethod( Material, flush, void, (),,
"Flushes all material instances that use this material." )
{
object->flush();
}
ConsoleMethod( Material, reload, void, 2, 2,
DefineConsoleMethod( Material, reload, void, (),,
"Reloads all material instances that use this material." )
{
object->reload();
}
ConsoleMethod( Material, dumpInstances, void, 2, 2,
DefineConsoleMethod( Material, dumpInstances, void, (),,
"Dumps a formatted list of the currently allocated material instances for this material to the console." )
{
MATMGR->dumpMaterialInstances( object );
}
ConsoleMethod( Material, getAnimFlags, const char*, 3, 3, "" )
DefineConsoleMethod( Material, getAnimFlags, const char*, (U32 id), , "" )
{
char * animFlags = Con::getReturnBuffer(512);
if(object->mAnimFlags[ dAtoi(argv[2]) ] & Material::Scroll)
if(object->mAnimFlags[ id ] & Material::Scroll)
{
if(dStrcmp( animFlags, "" ) == 0)
dStrcpy( animFlags, "$Scroll" );
}
if(object->mAnimFlags[ dAtoi(argv[2]) ] & Material::Rotate)
if(object->mAnimFlags[ id ] & Material::Rotate)
{
if(dStrcmp( animFlags, "" ) == 0)
dStrcpy( animFlags, "$Rotate" );
else
dStrcat( animFlags, " | $Rotate");
}
if(object->mAnimFlags[ dAtoi(argv[2]) ] & Material::Wave)
if(object->mAnimFlags[ id ] & Material::Wave)
{
if(dStrcmp( animFlags, "" ) == 0)
dStrcpy( animFlags, "$Wave" );
else
dStrcat( animFlags, " | $Wave");
}
if(object->mAnimFlags[ dAtoi(argv[2]) ] & Material::Scale)
if(object->mAnimFlags[ id ] & Material::Scale)
{
if(dStrcmp( animFlags, "" ) == 0)
dStrcpy( animFlags, "$Scale" );
else
dStrcat( animFlags, " | $Scale");
}
if(object->mAnimFlags[ dAtoi(argv[2]) ] & Material::Sequence)
if(object->mAnimFlags[ id ] & Material::Sequence)
{
if(dStrcmp( animFlags, "" ) == 0)
dStrcpy( animFlags, "$Sequence" );
@ -653,20 +654,20 @@ ConsoleMethod( Material, getAnimFlags, const char*, 3, 3, "" )
return animFlags;
}
ConsoleMethod(Material, getFilename, const char*, 2, 2, "Get filename of material")
DefineConsoleMethod(Material, getFilename, const char*, (),, "Get filename of material")
{
SimObject *material = static_cast<SimObject *>(object);
return material->getFilename();
}
ConsoleMethod( Material, isAutoGenerated, bool, 2, 2,
DefineConsoleMethod( Material, isAutoGenerated, bool, (),,
"Returns true if this Material was automatically generated by MaterialList::mapMaterials()" )
{
return object->isAutoGenerated();
}
ConsoleMethod( Material, setAutoGenerated, void, 3, 3,
DefineConsoleMethod( Material, setAutoGenerated, void, (bool isAutoGenerated), ,
"setAutoGenerated(bool isAutoGenerated): Set whether or not the Material is autogenerated." )
{
object->setAutoGenerated(dAtob(argv[2]));
object->setAutoGenerated(isAutoGenerated);
}