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

@ -30,6 +30,7 @@
#include "shaderGen/shaderGen.h"
#include "core/module.h"
#include "console/consoleTypes.h"
#include "console/engineAPI.h"
MODULE_BEGIN( MaterialManager )
@ -450,14 +451,14 @@ bool MaterialManager::_handleGFXEvent( GFXDevice::GFXDeviceEventType event_ )
return true;
}
ConsoleFunction( reInitMaterials, void, 1, 1,
DefineConsoleFunction( reInitMaterials, void, (),,
"@brief Flushes all procedural shaders and re-initializes all active material instances.\n\n"
"@ingroup Materials")
{
MATMGR->flushAndReInitInstances();
}
ConsoleFunction( addMaterialMapping, void, 3, 3, "(string texName, string matName)\n"
DefineConsoleFunction( addMaterialMapping, void, (const char * texName, const char * matName), , "(string texName, string matName)\n"
"@brief Maps the given texture to the given material.\n\n"
"Generates a console warning before overwriting.\n\n"
"Material maps are used by terrain and interiors for triggering "
@ -465,27 +466,27 @@ ConsoleFunction( addMaterialMapping, void, 3, 3, "(string texName, string matNam
"block or interior surface using the associated texture.\n\n"
"@ingroup Materials")
{
MATMGR->mapMaterial(argv[1], argv[2]);
MATMGR->mapMaterial(texName, matName);
}
ConsoleFunction( getMaterialMapping, const char*, 2, 2, "(string texName)\n"
DefineConsoleFunction( getMaterialMapping, const char*, (const char * texName), , "(string texName)\n"
"@brief Returns the name of the material mapped to this texture.\n\n"
"If no materials are found, an empty string is returned.\n\n"
"@param texName Name of the texture\n\n"
"@ingroup Materials")
{
return MATMGR->getMapEntry(argv[1]).c_str();
return MATMGR->getMapEntry(texName).c_str();
}
ConsoleFunction( dumpMaterialInstances, void, 1, 1,
DefineConsoleFunction( dumpMaterialInstances, void, (), ,
"@brief Dumps a formatted list of currently allocated material instances to the console.\n\n"
"@ingroup Materials")
{
MATMGR->dumpMaterialInstances();
}
ConsoleFunction( getMapEntry, const char *, 2, 2,
DefineConsoleFunction( getMapEntry, const char*, (const char * texName), ,
"@hide")
{
return MATMGR->getMapEntry( argv[1] );
return MATMGR->getMapEntry( String(texName) );
}