Forráskód Böngészése

fix for empty r channel creation of composites crashing out

AzaezelX 4 éve
szülő
commit
ed260548c5
1 módosított fájl, 4 hozzáadás és 1 törlés
  1. 4 1
      Engine/source/gfx/gfxTextureManager.cpp

+ 4 - 1
Engine/source/gfx/gfxTextureManager.cpp

@@ -1196,7 +1196,10 @@ GFXTextureObject *GFXTextureManager::createCompositeTexture(GBitmap*bmp[4], U32
    {
    {
       for (U32 y = 0; y < bmp[lastValidTex]->getHeight(); y++)
       for (U32 y = 0; y < bmp[lastValidTex]->getHeight(); y++)
       {
       {
-         rChan = bmp[0]->getChanelValueAt(x, y, inputKey[0]);
+         if (bmp[0])
+            rChan = bmp[0]->getChanelValueAt(x, y, inputKey[0]);
+         else
+            gChan = 255;
 
 
          if (bmp[1])
          if (bmp[1])
             gChan = bmp[1]->getChanelValueAt(x, y, inputKey[1]);
             gChan = bmp[1]->getChanelValueAt(x, y, inputKey[1]);