Эх сурвалжийг харах

decal safeties via if (mMaterialAsset.notNull() && mMaterialAsset->getStatus() == MaterialAsset::Ok)

AzaezelX 4 жил өмнө
parent
commit
0bf97ad2c8

+ 4 - 2
Engine/source/T3D/decal/decalData.cpp

@@ -202,7 +202,7 @@ void DecalData::initPersistFields()
          "grid; use #textureCoords to manually specify UV coordinates for "
          "irregular sized frames." );
 
-      addField( "textureCoords", TypeRectF,  Offset( texRect, DecalData ), MAX_TEXCOORD_COUNT,
+      addField( "textureCoords", TypeRectUV,  Offset( texRect, DecalData ), MAX_TEXCOORD_COUNT,
          "@brief An array of RectFs (topleft.x topleft.y extent.x extent.y) "
          "representing the UV coordinates for each frame in the imagemap.\n\n"
          "@note This field should only be set if the imagemap frames are "
@@ -313,7 +313,9 @@ void DecalData::_initMaterial()
 {
    SAFE_DELETE( matInst );
 
-   if (mMaterialAsset.notNull())
+   _setMaterial(getMaterial());
+
+   if (mMaterialAsset.notNull() && mMaterialAsset->getStatus() == MaterialAsset::Ok)
    {
       matInst = getMaterialResource()->createMatInstance();
    }