Skip to content

Commit

Permalink
merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
marauder2k7 committed Dec 27, 2024
1 parent 355f40a commit 1814a76
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
21 changes: 10 additions & 11 deletions Engine/source/T3D/assets/ImageAsset.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@ public: \
\
const StringTableEntry get##name() const\
{\
if (m##name##Asset && (m##name##Asset->getImageFileName() != StringTable->EmptyString()))\
if (m##name##Asset->getImageFileName()[0] == '#' || m##name##Asset->getImageFileName()[0] == '$')\
return m##name##Asset->getImageFileName();\
if (m##name##Asset && (m##name##Asset->getImageFile() != StringTable->EmptyString()))\
if (m##name##Asset->getImageFile()[0] == '#' || m##name##Asset->getImageFile()[0] == '$')\
return m##name##Asset->getImageFile();\
else\
return Platform::makeRelativePathName(m##name##Asset->getImagePath(), Platform::getMainDotCsDir());\
return Platform::makeRelativePathName(m##name##Asset->getImageFile(), Platform::getMainDotCsDir());\
else if (m##name##AssetId != StringTable->EmptyString())\
return m##name##AssetId;\
else if (m##name##Name != StringTable->EmptyString())\
Expand All @@ -349,7 +349,7 @@ public: \
}\
GFXTexHandle get##name##Resource() \
{\
if (m##name##Asset && (m##name##Asset->getImageFileName() != StringTable->EmptyString()))\
if (m##name##Asset && (m##name##Asset->getImageFile() != StringTable->EmptyString()))\
return m##name##Asset->getTexture(m##name##Profile);\
return m##name;\
}\
Expand Down Expand Up @@ -456,7 +456,6 @@ public: \
}\
if (get##name(index) != StringTable->EmptyString() && m##name##Name[index] != StringTable->insert("texhandle"))\
{\
m##name##Asset[index]->getChangedSignal().notify(this, &className::changeFunc);\
if (get##name(index)[0] != '$' && get##name(index)[0] != '#')\
m##name[index].set(get##name(index), m##name##Profile[index], avar("%s() - mTextureObject (line %d)", __FUNCTION__, __LINE__));\
}\
Expand Down Expand Up @@ -485,11 +484,11 @@ public: \
\
const StringTableEntry get##name(const U32& index) const\
{\
if (m##name##Asset[index] && (m##name##Asset[index]->getImageFileName() != StringTable->EmptyString()))\
if (m##name##Asset[index]->getImageFileName()[0] == '#' || m##name##Asset[index]->getImageFileName()[0] == '$')\
return m##name##Asset[index]->getImageFileName();\
if (m##name##Asset[index] && (m##name##Asset[index]->getImageFile() != StringTable->EmptyString()))\
if (m##name##Asset[index]->getImageFile()[0] == '#' || m##name##Asset[index]->getImageFile()[0] == '$')\
return m##name##Asset[index]->getImageFile();\
else\
return Platform::makeRelativePathName(m##name##Asset[index]->getImagePath(), Platform::getMainDotCsDir());\
return Platform::makeRelativePathName(m##name##Asset[index]->getImageFile(), Platform::getMainDotCsDir());\
else if (m##name##AssetId[index] != StringTable->EmptyString())\
return m##name##AssetId[index];\
else if (m##name##Name[index] != StringTable->EmptyString())\
Expand All @@ -506,7 +505,7 @@ public: \
{\
if(index >= sm##name##Count || index < 0)\
return nullptr;\
if (m##name##Asset[index] && (m##name##Asset[index]->getImageFileName() != StringTable->EmptyString()))\
if (m##name##Asset[index] && (m##name##Asset[index]->getImageFile() != StringTable->EmptyString()))\
return m##name##Asset[index]->getTexture(m##name##Profile[index]);\
return m##name[index];\
}\
Expand Down
6 changes: 0 additions & 6 deletions Engine/source/materials/materialDefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,6 @@ Material::Material()
mReverbSoundOcclusion = 1.0;
}

void Material::onImageAssetChanged()
{
flush();
reload();
}

void Material::initPersistFields()
{
docsURL;
Expand Down
4 changes: 2 additions & 2 deletions Engine/source/materials/processedMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ 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("Failed to load diffuse map %s for stage %i", mMaterial->mDiffuseMapAsset[i]->getImageFileName(), i);
if (!String(mMaterial->getDiffuseMapAsset(i)->getImageFile()).startsWith("#") && !String(mMaterial->getDiffuseMapAsset(i)->getImageFile()).startsWith("$"))
mMaterial->logError("Failed to load diffuse map %s for stage %i", mMaterial->getDiffuseMapAsset(i)->getImageFile(), i);

mStages[i].setTex(MFT_DiffuseMap, _createTexture(GFXTextureManager::getMissingTexturePath().c_str(), &GFXStaticTextureSRGBProfile));
}
Expand Down

0 comments on commit 1814a76

Please sign in to comment.