diff --git a/Engine/source/T3D/fx/groundCover.cpp b/Engine/source/T3D/fx/groundCover.cpp index 3f4343184..9352deabf 100644 --- a/Engine/source/T3D/fx/groundCover.cpp +++ b/Engine/source/T3D/fx/groundCover.cpp @@ -974,8 +974,6 @@ void GroundCover::_initialize( U32 cellCount, U32 cellPlacementCount ) GFXTexHandle tex; if (mat->getDiffuseMap(0)) tex = mat->getDiffuseMap(0); - else if (mat->getDiffuseMapAsset(0).notNull()) - tex = mat->getDiffuseMap(0); if(tex.isValid()) { diff --git a/Engine/source/T3D/levelInfo.cpp b/Engine/source/T3D/levelInfo.cpp index 82d3b55c5..884fd7d17 100644 --- a/Engine/source/T3D/levelInfo.cpp +++ b/Engine/source/T3D/levelInfo.cpp @@ -367,7 +367,7 @@ void LevelInfo::_onLMActivate(const char *lm, bool enable) void LevelInfo::setLevelAccuTexture() { - if (isClientObject() && mAccuTextureAsset.notNull()) + if (isClientObject() && getAccuTexture()) { gLevelAccuMap = getAccuTexture(); } diff --git a/Engine/source/afx/ce/afxZodiac.cpp b/Engine/source/afx/ce/afxZodiac.cpp index 2df200230..e0d338c57 100644 --- a/Engine/source/afx/ce/afxZodiac.cpp +++ b/Engine/source/afx/ce/afxZodiac.cpp @@ -324,10 +324,7 @@ bool afxZodiacData::preload(bool server, String &errorStr) if (vert_range.x == 0.0f && vert_range.y == 0.0f) vert_range.x = vert_range.y = radius_xy; - if (mTextureAsset.notNull()) - { - getTexture(); - } + getTexture(); return true; } @@ -345,10 +342,7 @@ void afxZodiacData::onStaticModified(const char* slot, const char* newValue) void afxZodiacData::onPerformSubstitutions() { - if (mTextureAsset.notNull()) - { - getTexture(); - } + getTexture(); } F32 afxZodiacData::calcRotationAngle(F32 elapsed, F32 rate_factor) diff --git a/Engine/source/environment/basicClouds.cpp b/Engine/source/environment/basicClouds.cpp index 02286bccc..93cc8273a 100644 --- a/Engine/source/environment/basicClouds.cpp +++ b/Engine/source/environment/basicClouds.cpp @@ -332,7 +332,7 @@ void BasicClouds::_initTexture() { for ( U32 i = 0; i < TEX_COUNT; i++ ) { - if ( mLayerEnabled[i] && mTextureAsset[i].notNull()) + if ( mLayerEnabled[i]) { // load the resource. getTexture(i); diff --git a/Engine/source/environment/cloudLayer.cpp b/Engine/source/environment/cloudLayer.cpp index f65782c12..ebeeb75c9 100644 --- a/Engine/source/environment/cloudLayer.cpp +++ b/Engine/source/environment/cloudLayer.cpp @@ -239,7 +239,7 @@ U32 CloudLayer::packUpdate( NetConnection *conn, U32 mask, BitStream *stream ) { U32 retMask = Parent::packUpdate( conn, mask, stream ); - if (stream->writeFlag(mTextureAsset.notNull())) { + if (stream->writeFlag(getTexture())) { NetStringHandle assetIdStr = mTextureAsset.getAssetId(); conn->packNetStringHandleU(stream, assetIdStr); } diff --git a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp index 2eff0c0ab..44cb8e2b5 100644 --- a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp @@ -296,7 +296,7 @@ void GuiIconButtonCtrl::renderButton( Point2I &offset, const RectI& updateRect ) RectI iconRect( 0, 0, 0, 0 ); // Render the icon - if ( mBitmapAsset.notNull() && mIconLocation != GuiIconButtonCtrl::IconLocNone) + if ( getBitmap() && mIconLocation != GuiIconButtonCtrl::IconLocNone) { // Render the normal bitmap drawer->clearBitmapModulation(); @@ -380,7 +380,7 @@ void GuiIconButtonCtrl::renderButton( Point2I &offset, const RectI& updateRect ) if ( mTextLocation == TextLocRight ) { Point2I start( mTextMargin, ( getHeight() - mProfile->mFont->getHeight() ) / 2 ); - if (mBitmapAsset.notNull() && mIconLocation != IconLocNone) + if (getBitmap() && mIconLocation != IconLocNone) { start.x = getWidth() - (iconRect.extent.x + mButtonMargin.x + textWidth); } @@ -400,7 +400,7 @@ void GuiIconButtonCtrl::renderButton( Point2I &offset, const RectI& updateRect ) if ( mTextLocation == TextLocCenter ) { Point2I start; - if (mBitmapAsset.notNull() && mIconLocation == IconLocLeft ) + if (getBitmap() && mIconLocation == IconLocLeft ) { start.set( ( getWidth() - textWidth - iconRect.extent.x ) / 2 + iconRect.extent.x, ( getHeight() - mProfile->mFont->getHeight() ) / 2 ); diff --git a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp index a2b711956..39886a0b9 100644 --- a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp @@ -88,7 +88,7 @@ void GuiToolboxButtonCtrl::inspectPostApply() // set it's extent to be exactly the size of the normal bitmap (if present) Parent::inspectPostApply(); - if ((getWidth() == 0) && (getHeight() == 0) && mNormalBitmapAsset.notNull()) + if ((getWidth() == 0) && (getHeight() == 0) && getNormalBitmap()) { setExtent(getNormalBitmap()->getWidth(), getNormalBitmap()->getHeight()); } @@ -142,7 +142,7 @@ void GuiToolboxButtonCtrl::onRender(Point2I offset, const RectI& updateRect) } // Now render the image - if( mNormalBitmapAsset.notNull() ) + if(getNormalBitmap()) { renderButton(getNormalBitmap(), offset, updateRect ); return; diff --git a/Engine/source/gui/controls/guiBitmapCtrl.cpp b/Engine/source/gui/controls/guiBitmapCtrl.cpp index bcf667361..ae9e73eb1 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.cpp +++ b/Engine/source/gui/controls/guiBitmapCtrl.cpp @@ -101,7 +101,7 @@ void GuiBitmapCtrl::inspectPostApply() // set it's extent to be exactly the size of the bitmap (if present) Parent::inspectPostApply(); - if (!mWrap && (getExtent().x == 0) && (getExtent().y == 0) && mBitmapAsset.notNull()) + if (!mWrap && (getExtent().x == 0) && (getExtent().y == 0) && getBitmap()) { setExtent(mBitmap->getWidth(), mBitmap->getHeight()); } @@ -126,7 +126,7 @@ void GuiBitmapCtrl::setBitmap(const char* name, bool resize) mBitmap = mBitmapAsset->getTexture(&GFXDefaultGUIProfile); - if (mBitmapAsset.notNull() && resize) + if (getBitmap() && resize) { setExtent(mBitmap->getWidth(), mBitmap->getHeight()); @@ -212,7 +212,7 @@ void GuiBitmapCtrl::onRender(Point2I offset, const RectI& updateRect) void GuiBitmapCtrl::setValue(S32 x, S32 y) { - if (mBitmapAsset.notNull()) + if (getBitmap()) { x += mBitmapAsset->getTextureBitmapWidth() / 2; y += mBitmapAsset->getTextureBitmapHeight() / 2; diff --git a/Engine/source/gui/controls/guiGameSettingsCtrl.cpp b/Engine/source/gui/controls/guiGameSettingsCtrl.cpp index b782f3024..0b1e7ebea 100644 --- a/Engine/source/gui/controls/guiGameSettingsCtrl.cpp +++ b/Engine/source/gui/controls/guiGameSettingsCtrl.cpp @@ -184,7 +184,7 @@ void GuiGameSettingsCtrl::onRenderListOption(Point2I currentOffset) bool arrowOnR = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption < mOptions.size() - 1)); if (arrowOnL) { - if (mPreviousBitmapAsset.notNull()) + if (getPreviousBitmap()) { arrowOffset.x = currentOffset.x + mColumnSplit; arrowOffset.y = currentOffset.y + arrowOffsetY; @@ -205,7 +205,7 @@ void GuiGameSettingsCtrl::onRenderListOption(Point2I currentOffset) } if (arrowOnR) { - if (mNextBitmapAsset.notNull()) + if (getNextBitmap()) { arrowOffset.x = currentOffset.x + getWidth() - mRightPad - mArrowSize; arrowOffset.y = currentOffset.y + arrowOffsetY; @@ -369,7 +369,7 @@ void GuiGameSettingsCtrl::onRenderKeybindOption(Point2I currentOffset) buttonSize.x = height; buttonSize.y = height; - if (mKeybindBitmapAsset.notNull()) + if (getKeybindBitmap()) { RectI rect(button, buttonSize); drawer->clearBitmapModulation(); diff --git a/Engine/source/gui/controls/guiPopUpCtrl.cpp b/Engine/source/gui/controls/guiPopUpCtrl.cpp index 9ec981352..ee7bf8891 100644 --- a/Engine/source/gui/controls/guiPopUpCtrl.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrl.cpp @@ -891,13 +891,13 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) } // Draw a bitmap over the background? - if ( mBitmapAsset[Depressed].notNull() ) + if (getBitmap(Depressed)) { RectI rect(offset, mBitmapBounds); drawUtil->clearBitmapModulation(); drawUtil->drawBitmapStretch( getBitmap(Depressed), rect ); } - else if ( mBitmapAsset[Normal].notNull() ) + else if (getBitmap(Normal)) { RectI rect(offset, mBitmapBounds); drawUtil->clearBitmapModulation(); @@ -941,7 +941,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) } // Draw a bitmap over the background? - if ( mBitmapAsset[Normal].notNull() ) + if (getBitmap(Normal)) { RectI rect( offset, mBitmapBounds ); drawUtil->clearBitmapModulation(); @@ -977,7 +977,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) } // Draw a bitmap over the background? - if (mBitmapAsset[Normal].notNull()) + if (getBitmap(Normal)) { RectI rect(offset, mBitmapBounds); drawUtil->clearBitmapModulation(); diff --git a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp index 7e99f20d9..82c61b7cf 100644 --- a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp @@ -1090,13 +1090,13 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect) } // Draw a bitmap over the background? - if ( mBitmapAsset[Depressed].notNull() ) + if (getBitmap(Depressed)) { RectI rect(offset, mBitmapBounds); drawUtil->clearBitmapModulation(); drawUtil->drawBitmapStretch(getBitmap(Depressed), rect ); } - else if (mBitmapAsset[Normal].notNull()) + else if (getBitmap(Normal)) { RectI rect(offset, mBitmapBounds); drawUtil->clearBitmapModulation(); @@ -1134,7 +1134,7 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect) } // Draw a bitmap over the background? - if (mBitmapAsset[Normal].notNull()) + if (getBitmap(Normal)) { RectI rect( offset, mBitmapBounds ); drawUtil->clearBitmapModulation(); @@ -1164,7 +1164,7 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect) } // Draw a bitmap over the background? - if (mBitmapAsset[Normal].notNull()) + if (getBitmap(Normal)) { RectI rect(offset, mBitmapBounds); drawUtil->clearBitmapModulation(); diff --git a/Engine/source/gui/core/guiTypes.cpp b/Engine/source/gui/core/guiTypes.cpp index f9111407f..79d24b297 100644 --- a/Engine/source/gui/core/guiTypes.cpp +++ b/Engine/source/gui/core/guiTypes.cpp @@ -112,7 +112,7 @@ void GuiCursor::onRemove() void GuiCursor::render(const Point2I &pos) { - if (mBitmapAsset.notNull()) + if (getBitmap()) { mExtent.set(getBitmap()->getWidth(), getBitmap()->getHeight()); } diff --git a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp index b926205f9..cc63be371 100644 --- a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp @@ -155,7 +155,7 @@ void GuiChunkedBitmapCtrl::renderRegion(const Point2I &offset, const Point2I &ex void GuiChunkedBitmapCtrl::onRender(Point2I offset, const RectI &updateRect) { - if( mBitmapAsset.notNull() ) + if(getBitmap()) { RectI boundsRect( offset, getExtent()); GFX->getDrawUtil()->drawBitmapStretch(getBitmap(), boundsRect, GFXBitmapFlip_None, GFXTextureFilterLinear); diff --git a/Engine/source/materials/processedMaterial.cpp b/Engine/source/materials/processedMaterial.cpp index ffde35c24..c36a74f4e 100644 --- a/Engine/source/materials/processedMaterial.cpp +++ b/Engine/source/materials/processedMaterial.cpp @@ -393,7 +393,7 @@ void ProcessedMaterial::_setStageData() for (i = 0; i < Material::MAX_STAGES; i++) { // DiffuseMap - if (mMaterial->getDiffuseMapAsset(i).notNull()) + if (mMaterial->getDiffuseMap(i)) { mStages[i].setTex(MFT_DiffuseMap, mMaterial->getDiffuseMap(i)); if (!mStages[i].getTex(MFT_DiffuseMap)) @@ -406,7 +406,7 @@ void ProcessedMaterial::_setStageData() } } // OverlayMap - if (mMaterial->getOverlayMapAsset(i).notNull()) + if (mMaterial->getOverlayMap(i)) { mStages[i].setTex(MFT_OverlayMap, mMaterial->getOverlayMap(i)); if (!mStages[i].getTex(MFT_OverlayMap)) @@ -414,7 +414,7 @@ void ProcessedMaterial::_setStageData() } // LightMap - if (mMaterial->getLightMapAsset(i).notNull()) + if (mMaterial->getLightMap(i)) { mStages[i].setTex(MFT_LightMap, mMaterial->getLightMap(i)); if (!mStages[i].getTex(MFT_LightMap)) @@ -422,7 +422,7 @@ void ProcessedMaterial::_setStageData() } // ToneMap - if (mMaterial->getToneMapAsset(i).notNull()) + if (mMaterial->getToneMap(i)) { mStages[i].setTex(MFT_ToneMap, mMaterial->getToneMap(i)); if (!mStages[i].getTex(MFT_ToneMap)) @@ -430,7 +430,7 @@ void ProcessedMaterial::_setStageData() } // DetailMap - if (mMaterial->getDetailMapAsset(i).notNull()) + if (mMaterial->getDetailMap(i)) { mStages[i].setTex(MFT_DetailMap, mMaterial->getDetailMap(i)); if (!mStages[i].getTex(MFT_DetailMap)) @@ -438,7 +438,7 @@ void ProcessedMaterial::_setStageData() } // NormalMap - if (mMaterial->getNormalMapAsset(i).notNull()) + if (mMaterial->getNormalMap(i)) { mStages[i].setTex(MFT_NormalMap, mMaterial->getNormalMap(i)); if (!mStages[i].getTex(MFT_NormalMap)) @@ -450,7 +450,7 @@ void ProcessedMaterial::_setStageData() } // Detail Normal Map - if (mMaterial->getDetailNormalMapAsset(i).notNull()) + if (mMaterial->getDetailNormalMap(i)) { mStages[i].setTex(MFT_DetailNormalMap, mMaterial->getDetailNormalMap(i)); if (!mStages[i].getTex(MFT_DetailNormalMap)) @@ -463,7 +463,7 @@ void ProcessedMaterial::_setStageData() profile = &GFXStaticTextureSRGBProfile; // ORMConfig - if (mMaterial->getORMConfigMapAsset(i).notNull()) + if (mMaterial->getORMConfigMap(i)) { mStages[i].setTex(MFT_OrmMap, mMaterial->getORMConfigMap(profile, i)); if (!mStages[i].getTex(MFT_OrmMap)) @@ -471,7 +471,7 @@ void ProcessedMaterial::_setStageData() } else { - if ((mMaterial->getAOMapAsset(i).notNull()) || (mMaterial->getRoughMapAsset(i).notNull()) || (mMaterial->getMetalMapAsset(i).notNull())) + if ((mMaterial->getAOMap(i)) || (mMaterial->getRoughMap(i)) || (mMaterial->getMetalMap(i))) { U32 inputKey[4]; inputKey[0] = mMaterial->mAOChan[i]; @@ -485,7 +485,7 @@ void ProcessedMaterial::_setStageData() mMaterial->logError("Failed to dynamically create ORM Config map for stage %i", i); } } - if (mMaterial->getGlowMapAsset(i).notNull()) + if (mMaterial->getGlowMap(i)) { mStages[i].setTex(MFT_GlowMap, mMaterial->getGlowMap(i)); if (!mStages[i].getTex(MFT_GlowMap)) diff --git a/Engine/source/materials/processedShaderMaterial.cpp b/Engine/source/materials/processedShaderMaterial.cpp index 605e9dc6c..5c543ee5f 100644 --- a/Engine/source/materials/processedShaderMaterial.cpp +++ b/Engine/source/materials/processedShaderMaterial.cpp @@ -875,7 +875,7 @@ void ProcessedShaderMaterial::setTextureStages( SceneRenderState *state, const S case Material::TexTarget: { texTarget = rpd->mTexSlot[i].texTarget; - if (!mMaterial->getDiffuseMapAsset(0).notNull()) + if (!mMaterial->getDiffuseMap(0)) { GFX->setTexture(i, NULL); break; diff --git a/Engine/source/terrain/terrRender.cpp b/Engine/source/terrain/terrRender.cpp index 0fc77aafc..15848fefe 100644 --- a/Engine/source/terrain/terrRender.cpp +++ b/Engine/source/terrain/terrRender.cpp @@ -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); } diff --git a/Engine/source/ts/collada/colladaUtils.cpp b/Engine/source/ts/collada/colladaUtils.cpp index dc91b26f8..92b142ffb 100644 --- a/Engine/source/ts/collada/colladaUtils.cpp +++ b/Engine/source/ts/collada/colladaUtils.cpp @@ -1030,7 +1030,7 @@ void ColladaUtils::exportColladaMaterials(tinyxml2::XMLElement* rootNode, const { Torque::Path diffusePath; - if (mat->getDiffuseMapAsset(0).notNull()) + if (mat->getDiffuseMap(0)) diffusePath = Torque::Path(mat->getDiffuseMapAsset(0)->getImageFile()); else diffusePath = String("warningMat"); @@ -1040,7 +1040,7 @@ void ColladaUtils::exportColladaMaterials(tinyxml2::XMLElement* rootNode, const } else { - if (mat->getDiffuseMapAsset(0).notNull()) + if (mat->getDiffuseMap(0)) diffuseMap += Torque::Path(mat->getDiffuseMapAsset(0)->getImageFile()); else diffuseMap += "warningMat"; @@ -1316,7 +1316,7 @@ void ColladaUtils::exportColladaMaterials(tinyxml2::XMLElement* rootNode, const { Torque::Path diffusePath; - if (mat->getDiffuseMapAsset(0).notNull()) + if (mat->getDiffuseMap(0)) diffusePath = Torque::Path(mat->getDiffuseMapAsset(0)->getImageFile()); else diffusePath = String("warningMat"); @@ -1326,7 +1326,7 @@ void ColladaUtils::exportColladaMaterials(tinyxml2::XMLElement* rootNode, const } else { - if (mat->getDiffuseMapAsset(0).notNull()) + if (mat->getDiffuseMap(0)) diffuseMap += Torque::Path(mat->getDiffuseMapAsset(0)->getImageFile()); else diffuseMap += "warningMat";