예제 #1
0
        private static void UpdateTextureArray()
        {
            if (m_textureArrayDirty)
            {
                var arrayManager = MyManagers.FileArrayTextures;
                arrayManager.DisposeTex(ref m_textureArray);

                m_textureArray = null;

                var texts = GetTextureArrayFileList();
                if (texts.Length > 0)
                {
                    if (!arrayManager.CheckConsistency(texts))
                    {
                        CleanUpTextures();
                        texts = GetTextureArrayFileList();
                    }
                    if (texts.Length > 0)
                    {
                        m_textureArray = arrayManager.CreateFromFiles("gpuParticles", texts, MyFileTextureEnum.GPUPARTICLES, "", false);
                    }
                }

                m_textureArrayDirty = false;
            }
        }
예제 #2
0
 private static void DoneDevice()
 {
     var arrayManager = MyManagers.FileArrayTextures;
     arrayManager.DisposeTex(ref m_textureArray);
     m_textureArray = null;
     m_textureArrayDirty = false;
 }
예제 #3
0
        private static void DoneDevice()
        {
            var arrayManager = MyManagers.FileArrayTextures;

            arrayManager.DisposeTex(ref m_textureArray);
            m_textureArray      = null;
            m_textureArrayDirty = false;
        }
 public void Init(string name, MyFileTextureEnum type, byte[] errorBytePattern, Format formatBytePattern)
 {
     m_name              = name;
     m_type              = type;
     m_arrayTexture      = null;
     m_dirtyFlag         = false;
     m_numRefs           = 1;
     m_errorBytePattern  = errorBytePattern;
     m_formatBytePattern = formatBytePattern;
 }
예제 #5
0
 public void OnUnloadData()
 {
     MyFileArrayTexture[] array = new MyFileArrayTexture[m_texturesOnAutoDisposal.Count];
     m_texturesOnAutoDisposal.CopyTo(array);
     foreach (var myTex in array)
     {
         IFileArrayTexture tex = myTex;
         DisposeTex(ref tex);
     }
     m_texturesOnAutoDisposal.Clear();
 }
            public void Update()
            {
                if (!m_dirtyFlag)
                {
                    return;
                }

                m_dirtyFlag = false;
                if (m_arrayTexture != null)
                {
                    MyManagers.FileArrayTextures.DisposeTex(ref m_arrayTexture);
                }
                if (m_filepaths.Count != 0)
                {
                    m_arrayTexture = MyManagers.FileArrayTextures.CreateFromFiles(m_name, m_filepaths.ToArray(), m_type, m_errorBytePattern, m_formatBytePattern, false);
                }
            }
        public void DisposeTex(ref IFileArrayTexture texture)
        {
            if (texture == null)
            {
                return;
            }

            MyFileArrayTexture textureInternal = (MyFileArrayTexture)texture;

            if (m_isDeviceInit)
            {
                textureInternal.OnDeviceEnd();
            }

            m_fileTextureArrays.Deallocate(textureInternal);
            texture = null;
        }
예제 #8
0
        public void DisposeTex(ref IFileArrayTexture texture)
        {
            if (texture == null)
            {
                return;
            }

            MyFileArrayTexture textureInternal = (MyFileArrayTexture)texture;

            if (m_isDeviceInit)
            {
                textureInternal.OnDeviceEnd();
            }

            if (m_texturesOnAutoDisposal.Contains(textureInternal))
            {
                m_texturesOnAutoDisposal.Remove(textureInternal);
            }

            m_fileTextureArrays.Deallocate(textureInternal);
            texture = null;
        }
예제 #9
0
            public void Update()
            {
                if (!m_dirtyFlag)
                {
                    return;
                }

                m_dirtyFlag = false;

                var previousArrayTexture = m_arrayTexture;

                if (m_filepaths.Count == 0)
                {
                    m_arrayTexture = null;
                }
                else
                {
                    m_arrayTexture = MyManagers.FileArrayTextures.CreateFromFiles(m_name, m_filepaths.ToArray(), m_type, m_errorBytePattern, m_formatBytePattern, false, previousArrayTexture as MyFileArrayTexture);
                }

                MyManagers.FileArrayTextures.DisposeTex(ref previousArrayTexture);
            }
예제 #10
0
        public void DisposeTex(ref IFileArrayTexture texture)
        {
            if (texture == null)
                return;

            MyFileArrayTexture textureInternal = (MyFileArrayTexture) texture;

            if (m_isDeviceInit)
                textureInternal.OnDeviceEnd();

            if (m_texturesOnAutoDisposal.Contains(textureInternal))
                m_texturesOnAutoDisposal.Remove(textureInternal);

            m_fileTextureArrays.Deallocate(textureInternal);
            texture = null;
        }
예제 #11
0
        private static void UpdateTextureArray()
        {
            if (m_textureArrayDirty)
            {
                var arrayManager = MyManagers.FileArrayTextures;
                arrayManager.DisposeTex(ref m_textureArray);

                m_textureArray = null;

                var texts = GetTextureArrayFileList();
                if (texts.Length > 0)
                {
                    if (!arrayManager.CheckConsistency(texts))
                    {
                        CleanUpTextures();
                        texts = GetTextureArrayFileList();
                    }
                    if (texts.Length > 0)
                        m_textureArray = arrayManager.CreateFromFiles("gpuParticles", texts, MyFileTextureEnum.GPUPARTICLES, "", false);
                }

                m_textureArrayDirty = false;
            }
        }
예제 #12
0
        public void DisposeTex(ref IFileArrayTexture texture)
        {
            if (texture == null)
                return;

            MyFileArrayTexture textureInternal = (MyFileArrayTexture) texture;

            if (m_isDeviceInit)
                textureInternal.OnDeviceEnd();

            m_fileTextureArrays.Deallocate(textureInternal);
            texture = null;
        }
            public void Update()
            {
                if (!m_dirtyFlag)
                    return;

                m_dirtyFlag = false;
                if (m_arrayTexture != null)
                    MyManagers.FileArrayTextures.DisposeTex(ref m_arrayTexture);
                if (m_filepaths.Count != 0)
                    m_arrayTexture = MyManagers.FileArrayTextures.CreateFromFiles(m_name, m_filepaths.ToArray(), m_type, m_errorBytePattern, m_formatBytePattern, false);
            }
 public void Init(string name, MyFileTextureEnum type, byte[] errorBytePattern, Format formatBytePattern)
 {
     m_name = name;
     m_type = type;
     m_arrayTexture = null;
     m_dirtyFlag = false;
     m_numRefs = 1;
     m_errorBytePattern = errorBytePattern;
     m_formatBytePattern = formatBytePattern;
 }