Various misc. tweaks and fixes based on static code analysis to minimize/fix memleaks, crashes, or other performance impacting code.

This commit is contained in:
Areloch 2020-09-19 18:25:10 -05:00
parent d76c73c252
commit 8956559bfd
44 changed files with 124 additions and 258 deletions

View file

@ -502,11 +502,6 @@ void Material::initPersistFields()
endGroup( "Behavioral" );
addProtectedField("customShaderFeature", TypeRealString, NULL, &protectedSetCustomShaderFeature, &defaultProtectedGetFn,
"Do not modify, for internal use.", AbstractClassRep::FIELD_HideInInspectors);
addProtectedField("CustomShaderFeatureUniforms", TypeRealString, NULL, &protectedSetCustomShaderFeatureUniforms, &defaultProtectedGetFn,
"Do not modify, for internal use.", AbstractClassRep::FIELD_HideInInspectors);
Parent::initPersistFields();
}
@ -524,36 +519,6 @@ bool Material::writeField( StringTableEntry fieldname, const char *value )
return Parent::writeField( fieldname, value );
}
bool Material::protectedSetCustomShaderFeature(void *object, const char *index, const char *data)
{
Material *material = static_cast< Material* >(object);
CustomShaderFeatureData* customFeature;
if (!Sim::findObject(data, customFeature))
return false;
material->mCustomShaderFeatures.push_back(customFeature);
return false;
}
bool Material::protectedSetCustomShaderFeatureUniforms(void *object, const char *index, const char *data)
{
Material *material = static_cast< Material* >(object);
if (index != NULL)
{
char featureName[256] = { 0 };
U32 id = 0;
dSscanf(index, "%s_%i", featureName, id);
String uniformName = data;
}
return false;
}
bool Material::onAdd()
{
if (Parent::onAdd() == false)