private static void DoneDevice()
 {
     if (m_textureArray != null)
         m_textureArray.Dispose();
     m_textureArray = null;
     m_textureArrayDirty = false;
 }
Exemple #2
0
 private static void DoneDevice()
 {
     if (m_textureArray != null)
     {
         m_textureArray.Dispose();
     }
     m_textureArray      = null;
     m_textureArrayDirty = false;
 }
Exemple #3
0
        private static void UpdateTextureArray()
        {
            if (m_textureArrayDirty)
            {
                if (m_textureArray != null)
                {
                    m_textureArray.Dispose();
                }

                Resources.TexId[] textIds = new Resources.TexId[m_textureArrayIndices.Count];
                foreach (var item in m_textureArrayIndices)
                {
                    textIds[item.Value.Index] = item.Key;
                }
                m_textureArray = new Resources.MyTextureArray(textIds, "gpuParticles");

                m_textureArrayDirty = false;
            }
        }
 internal void Dispose()
 {
     if (ColorMetalArray != null)
     {
         ColorMetalArray.Dispose();
         ColorMetalArray = null;
     }
     if (NormalGlossArray != null)
     {
         NormalGlossArray.Dispose();
         NormalGlossArray = null;
     }
     if (ExtArray != null)
     {
         ExtArray.Dispose();
         ExtArray = null;
     }
 }
        internal void BuildTextureArrays()
        {
            Dispose();

            ColorMetalArray = new MyTextureArray(new[] { 
                MyTextureManager.GetColorMetalTexture(ColorMetal_XZ_nY_Texture),
                MyTextureManager.GetColorMetalTexture(ColorMetal_pY_Texture),
                MyTextureManager.GetColorMetalTexture(LowFreqColorMetal_XZ_nY_Texture),
                MyTextureManager.GetColorMetalTexture(LowFreqColorMetal_pY_Texture),
            });
            ColorMetalArray.SetDebugName(String.Format("voxel material {0} ColorMetal array", Id));

            NormalGlossArray = new MyTextureArray(new[] { 
                MyTextureManager.GetNormalGlossTexture(NormalGloss_XZ_nY_Texture),
                MyTextureManager.GetNormalGlossTexture(NormalGloss_pY_Texture),
                MyTextureManager.GetNormalGlossTexture(LowFreqNormalGloss_XZ_nY_Texture),
                MyTextureManager.GetNormalGlossTexture(LowFreqNormalGloss_pY_Texture),
            });
            NormalGlossArray.SetDebugName(String.Format("voxel material {0} NormalGloss array", Id));

            ExtArray = new MyTextureArray(new[] { 
                MyTextureManager.GetExtensionsTexture(Ext_XZ_nY_Texture),
                MyTextureManager.GetExtensionsTexture(Ext_pY_Texture),
                MyTextureManager.GetExtensionsTexture(LowFreqExt_XZ_nY_Texture),
                MyTextureManager.GetExtensionsTexture(LowFreqExt_pY_Texture),
            });
            ExtArray.SetDebugName(String.Format("voxel material {0} Ex6 array", Id));

            if (FoliageTextureArray1_Filename != null)
            { 
                FoliageTextureArray1 = MyTextureManager.GetTexture(FoliageTextureArray1_Filename);
                FoliageArraySize = (uint)((Texture2D)FoliageTextureArray1.Resource).Description.ArraySize;
            }
            if (FoliageTextureArray2_Filename != null)
            { 
                FoliageTextureArray2 = MyTextureManager.GetTexture(FoliageTextureArray2_Filename);
            }
        }
        private static void UpdateTextureArray()
        {
            if (m_textureArrayDirty)
            {
                if (m_textureArray != null)
                    m_textureArray.Dispose();
                m_textureArray = null;

                Resources.TexId[] textIds = new Resources.TexId[m_textureArrayIndices.Count];
                foreach (var item in m_textureArrayIndices)
                    textIds[item.Value.Index] = item.Key;
                if (textIds.Length > 0)
                    m_textureArray = new Resources.MyTextureArray(textIds, "gpuParticles");

                m_textureArrayDirty = false;
            }
        }