コード例 #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;
        }
コード例 #4
0
 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();
 }
コード例 #6
0
            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);
                }
            }
コード例 #7
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;
        }
コード例 #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;
        }
コード例 #13
0
            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);
            }
コード例 #14
0
 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;
 }