use of get<some name> methods that already return nulls/false when attempting to load

in contexts where we would want to try first (pt2)
This commit is contained in:
AzaezelX 2025-05-28 17:45:02 -05:00
parent 40974dd14b
commit 8bd145d54f
7 changed files with 17 additions and 25 deletions

View file

@ -96,7 +96,7 @@ void TerrainBlock::_updateMaterials()
{
TerrainMaterial *mat = mFile->mMaterials[i];
if (mat->getDiffuseMapAsset().notNull())
if (mat->getDiffuseMap())
{
mBaseTextures[i] = mat->getDiffuseMap();
}
@ -104,11 +104,11 @@ void TerrainBlock::_updateMaterials()
mBaseTextures[ i ] = GFXTexHandle();
// Find the maximum detail distance.
if ( mat->getDetailMapAsset().notNull() &&
if ( mat->getDetailMap() &&
mat->getDetailDistance() > mMaxDetailDistance )
mMaxDetailDistance = mat->getDetailDistance();
if ( mat->getMacroMapAsset().notNull() &&
if ( mat->getMacroMap() &&
mat->getMacroDistance() > mMaxDetailDistance )
mMaxDetailDistance = mat->getMacroDistance();
}
@ -126,18 +126,18 @@ void TerrainBlock::_updateMaterials()
{
TerrainMaterial* mat = mFile->mMaterials[i];
if (mat->getDetailMapAsset().notNull())
if (mat->getDetailMap())
detailTexArray[i] = mat->getDetailMap();
if (mat->getMacroMapAsset().notNull())
if (mat->getMacroMap())
macroTexArray[i] = mat->getMacroMap();
if (mat->getNormalMapAsset().notNull())
if (mat->getNormalMap())
normalTexArray[i] = mat->getNormalMap();
//depending on creation method this may or may not have been shoved into srgb space eroneously
GFXTextureProfile* profile = &GFXStaticTextureProfile;
if (mat->getIsSRGB())
profile = &GFXStaticTextureSRGBProfile;
if (mat->getORMConfigMapAsset().notNull())
if (mat->getORMConfigMap())
ormTexArray[i] = mat->getORMConfigMapAsset()->getTexture(profile);
}