From 0458228e1c404190d5dfb43e93eecf34e21945a8 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Sat, 14 Dec 2024 18:58:31 +0000 Subject: [PATCH] Update processedMaterial.cpp revert console spam --- Engine/source/materials/processedMaterial.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Engine/source/materials/processedMaterial.cpp b/Engine/source/materials/processedMaterial.cpp index 1b951751e..a4841ac6d 100644 --- a/Engine/source/materials/processedMaterial.cpp +++ b/Engine/source/materials/processedMaterial.cpp @@ -398,10 +398,9 @@ void ProcessedMaterial::_setStageData() if (!mStages[i].getTex(MFT_DiffuseMap)) { // If we start with a #, we're probably actually attempting to hit a named target and it may not get a hit on the first pass. - if (String(mMaterial->mDiffuseMapAsset[i]->getImageFileName()).startsWith("#") || String(mMaterial->mDiffuseMapAsset[i]->getImageFileName()).startsWith("$")) - { - mMaterial->logError("Named Target not ready %s for stage %i", mMaterial->mDiffuseMapAsset[i]->getImageFileName(), i); - } + if (!String(mMaterial->mDiffuseMapAsset[i]->getImageFileName()).startsWith("#") && !String(mMaterial->mDiffuseMapAsset[i]->getImageFileName()).startsWith("$")) + mMaterial->logError("Failed to load diffuse map %s for stage %i", mMaterial->mDiffuseMapAsset[i]->getImageFileName(), i); + mStages[i].setTex(MFT_DiffuseMap, _createTexture(GFXTextureManager::getMissingTexturePath().c_str(), &GFXStaticTextureSRGBProfile)); } } @@ -410,12 +409,10 @@ void ProcessedMaterial::_setStageData() mStages[i].setTex(MFT_DiffuseMap, _createTexture(mMaterial->mDiffuseMapName[i], &GFXStaticTextureSRGBProfile)); if (!mStages[i].getTex(MFT_DiffuseMap)) { - //If we start with a #, we're probably actually attempting to hit a named target and it may not get a hit on the first pass. So we'll - //pass on the error rather than spamming the console - if (String(mMaterial->mDiffuseMapName[i]).startsWith("#") || String(mMaterial->mDiffuseMapName[i]).startsWith("$")) - { - mMaterial->logError("Named Target not ready %s for stage %i", mMaterial->mDiffuseMapName[i], i); - } + //If we start with a #, we're probably actually attempting to hit a named target and it may not get a hit on the first pass. + if (!String(mMaterial->mDiffuseMapName[i]).startsWith("#") && !String(mMaterial->mDiffuseMapName[i]).startsWith("$")) + mMaterial->logError("Failed to load diffuse map %s for stage %i", mMaterial->mDiffuseMapName[i], i); + // Load a debug texture to make it clear to the user // that the texture for this stage was missing. mStages[i].setTex(MFT_DiffuseMap, _createTexture(GFXTextureManager::getMissingTexturePath().c_str(), &GFXStaticTextureSRGBProfile));