mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-20 10:25:40 +00:00
Material lookup by name + minor fixes
This commit is contained in:
@@ -40,3 +40,10 @@ CMaterial* CMaterialSet::MaterialByName(const std::string &name)
|
||||
if ((*it)->Name() == name) return *it;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
u32 CMaterialSet::MaterialIndexByName(const std::string& name)
|
||||
{
|
||||
for (u32 iMat = 0; iMat < mMaterials.size(); iMat++)
|
||||
if (mMaterials[iMat]->Name() == name) return iMat;
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user