mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Merge branch 'ModernEditorLayoutWIP' of https://github.com/Areloch/Torque3D into development
This commit is contained in:
commit
3697737498
148 changed files with 3463 additions and 547 deletions
|
|
@ -32,6 +32,7 @@
|
|||
#include "console/consoleTypes.h"
|
||||
#include "console/engineAPI.h"
|
||||
|
||||
#include "gui/controls/guiTreeViewCtrl.h"
|
||||
|
||||
MODULE_BEGIN( MaterialManager )
|
||||
|
||||
|
|
@ -397,6 +398,36 @@ void MaterialManager::dumpMaterialInstances( BaseMaterialDefinition *target ) co
|
|||
Con::printf( "---------------------- Dump complete ----------------------");
|
||||
}
|
||||
|
||||
void MaterialManager::getMaterialInstances(BaseMaterialDefinition* target, GuiTreeViewCtrl* materailInstanceTree)
|
||||
{
|
||||
if (!mMatInstanceList.size())
|
||||
return;
|
||||
|
||||
if (!target)
|
||||
{
|
||||
Con::errorf("Can't form a list without a specific MaterialDefinition");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!materailInstanceTree)
|
||||
{
|
||||
Con::errorf("Requires a valid GuiTreeViewCtrl object to populate data into!");
|
||||
return;
|
||||
}
|
||||
|
||||
U32 matItem = materailInstanceTree->insertItem(0, target->getName());
|
||||
|
||||
for (U32 i = 0; i < mMatInstanceList.size(); i++)
|
||||
{
|
||||
BaseMatInstance* inst = mMatInstanceList[i];
|
||||
|
||||
if (target && inst->getMaterial() != target)
|
||||
continue;
|
||||
|
||||
inst->getShaderInfo(materailInstanceTree, matItem);
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialManager::_track( MatInstance *matInstance )
|
||||
{
|
||||
mMatInstanceList.push_back( matInstance );
|
||||
|
|
@ -480,6 +511,16 @@ DefineEngineFunction( dumpMaterialInstances, void, (), ,
|
|||
MATMGR->dumpMaterialInstances();
|
||||
}
|
||||
|
||||
DefineEngineFunction(getMaterialInstances, void, (BaseMaterialDefinition* target, GuiTreeViewCtrl* tree), (nullAsType<BaseMaterialDefinition*>(), nullAsType<GuiTreeViewCtrl*>()),
|
||||
"@brief Dumps a formatted list of currently allocated material instances to the console.\n\n"
|
||||
"@ingroup Materials")
|
||||
{
|
||||
if (target == nullptr || tree == nullptr)
|
||||
return;
|
||||
|
||||
MATMGR->getMaterialInstances(target, tree);
|
||||
}
|
||||
|
||||
DefineEngineFunction( getMapEntry, const char*, (const char * texName), ,
|
||||
"@hide")
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue