mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
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:
parent
d76c73c252
commit
8956559bfd
44 changed files with 124 additions and 258 deletions
|
|
@ -120,6 +120,7 @@ bool CustomMaterial::onAdd()
|
|||
}
|
||||
|
||||
const char* samplerDecl = "sampler";
|
||||
S32 samplerDeclLen = dStrlen(samplerDecl);
|
||||
S32 i = 0;
|
||||
for (SimFieldDictionaryIterator itr(getFieldDictionary()); *itr; ++itr)
|
||||
{
|
||||
|
|
@ -132,7 +133,7 @@ bool CustomMaterial::onAdd()
|
|||
return false;
|
||||
}
|
||||
|
||||
if (dStrlen(entry->slotName) == dStrlen(samplerDecl))
|
||||
if (dStrlen(entry->slotName) == samplerDeclLen)
|
||||
{
|
||||
logError("sampler declarations must have a sampler name, e.g. sampler[\"diffuseMap\"]");
|
||||
return false;
|
||||
|
|
@ -140,7 +141,7 @@ bool CustomMaterial::onAdd()
|
|||
|
||||
// Assert sampler names are defined on ShaderData
|
||||
S32 pos = -1;
|
||||
String samplerName = entry->slotName + dStrlen(samplerDecl);
|
||||
String samplerName = entry->slotName + samplerDeclLen;
|
||||
samplerName.insert(0, '$');
|
||||
mShaderData->hasSamplerDef(samplerName, pos);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue