Пример #1
0
        public void DisposeTex(IGeneratedTexture tex)
        {
            if (tex == null)
            {
                return;
            }

            if (tex is MyUserGeneratedTexture)
            {
                MyUserGeneratedTexture texture = (MyUserGeneratedTexture)tex;
                texture.Dispose();
                m_objectsPoolGenerated.Deallocate(texture);
                tex = null;
            }
            else if (tex is MyGeneratedTextureFromPattern)
            {
                MyGeneratedTextureFromPattern texture = (MyGeneratedTextureFromPattern)tex;
                texture.Dispose();
                m_objectsPoolGeneratedFromPattern.Deallocate(texture);
                tex = null;
            }
            else
            {
                MyRenderProxy.Assert(false, "It is disposed texture that does not belong to this manager");
            }
        }
Пример #2
0
 public void Unload()
 {
     m_listSubresourceFilenames.Clear();
     m_objectsPoolOfStringLists.Deallocate(m_listSubresourceFilenames);
     m_listSubresourceFilenames = null;
     TextureFormat = Format.Unknown;
 }
Пример #3
0
        internal static void Commit(MyLinesBatch batch)
        {
            batch.VertexCount = batch.List.Count;
            batch.StartVertex = m_vertices.Count;

            if (batch.VertexCount > 0)
            {
                m_batches.Add(batch);
                m_vertices.AddList(batch.List);
                batch.List.Clear();
            }
            else
            {
                m_batchesPool.Deallocate(batch);
            }
        }
Пример #4
0
 public static void Deallocate(CellData cell)
 {
     using (m_lock.AcquireExclusiveUsing())
     {
         m_pool.Deallocate(cell);
     }
 }
Пример #5
0
        public void DisposeCsm(ICascadeShadowMap csm)
        {
            MyCascadeShadowMap myCsm = (MyCascadeShadowMap)csm;

            MyRenderProxy.Assert(!m_objectsPoolCsm.Active.Contains(myCsm), "Shadowmap is not active, maybe it is disposed already.");
            myCsm.Destroy();
            m_objectsPoolCsm.Deallocate(myCsm);
        }
Пример #6
0
        public void DisposeSingleShadowmap(ISingleShadowmap shadowmap)
        {
            MySingleShadowmap myShadowmap = (MySingleShadowmap)shadowmap;

            MyRenderProxy.Assert(!m_objectsPoolSingleShadowmap.Active.Contains(myShadowmap), "Shadowmap is not active, maybe it is disposed already.");
            myShadowmap.Destroy();
            m_objectsPoolSingleShadowmap.Deallocate(myShadowmap);
        }
Пример #7
0
 public static void RemoveLight(MyLight light)
 {
     if (light != null)
     {
         light.Clear();
         m_preallocatedLights.Deallocate(light);
     }
 }
Пример #8
0
 public static void RemoveLight(MyLight light)
 {
     if (light.ProxyId != MyDynamicAABBTree.NullNode) // Has been added
     {
         m_tree.RemoveProxy(light.ProxyId);
     }
     light.Clear();
     m_preallocatedLights.Deallocate(light);
 }
 private void OnComplete()
 {
     MySimpleProfiler.Begin("MyOreDetectorComponent - OnComplete");
     CompletionCallback(this, m_result, m_emptyCells);
     CompletionCallback = null;
     //m_result = null;
     m_instancePool.Deallocate(this);
     MySimpleProfiler.End();
 }
        void DisposeTexture(MyBorrowedDepthStencilTexture depthStencil)
        {
            IDepthStencil customTexture = depthStencil.DepthStencilTexture;

            MyManagers.DepthStencils.DisposeTex(ref customTexture);

            MyBorrowedTextureKey key = depthStencil.Key;

            m_dictionaryDepthStencilTextures[key].Remove(depthStencil);
            m_objectPoolDepthStencil.Deallocate(depthStencil);
        }
        void DisposeTexture(MyBorrowedCustomTexture custom)
        {
            ICustomTexture customTexture = custom.CustomTexture;

            MyManagers.CustomTextures.DisposeTex(ref customTexture);

            MyBorrowedTextureKey key = custom.Key;

            m_dictionaryCustomTextures[key].Remove(custom);
            m_objectPoolCustom.Deallocate(custom);
        }
        void DisposeTexture(MyBorrowedUavTexture uav)
        {
            IUavTexture uavTexture = uav.UavTexture;

            MyManagers.RwTextures.DisposeTex(ref uavTexture);

            MyBorrowedTextureKey key = uav.Key;

            m_dictionaryUavTextures[key].Remove(uav);
            m_objectPoolUav.Deallocate(uav);
        }
        void DisposeTexture(MyBorrowedRtvTexture rtv)
        {
            IRtvTexture rtvTexture = rtv.RtvTexture;

            MyManagers.RwTextures.DisposeTex(ref rtvTexture);

            MyBorrowedTextureKey key = rtv.Key;

            m_dictionaryRtvTextures[key].Remove(rtv);
            m_objectPoolRtv.Deallocate(rtv);
        }
Пример #14
0
        public static void RemoveLight(MyLight light)
        {
            if (light != null)
            {
                light.Clear();

                //by Gregory: added null check happened once when unloading session
                if (m_preallocatedLights != null)
                {
                    m_preallocatedLights.Deallocate(light);
                }
            }
        }
        public void DisposeTex(ref IDynamicFileArrayTexture inTex)
        {
            if (inTex == null)
            {
                return;
            }

            MyDynamicFileArrayTexture tex = (MyDynamicFileArrayTexture)inTex;

            //if (m_texarraysAutodestroyed.Contains(tex))
            //    m_texarraysAutodestroyed.Remove(tex);
            tex.Release();
            m_objectsPool.Deallocate(tex);
            inTex = null;
        }
Пример #16
0
        public void Update()
        {
            IntPtr cuePtr;

            while (PopDestroyList(out cuePtr))
            {
                var xactCue = new Cue(cuePtr);

                var cue = GetCueByPointer(cuePtr);
                m_activeCues.Remove(cuePtr.ToInt64());
                cue.OnRelease();
                m_pool.Deallocate(cue);
                xactCue.Destroy();
            }
        }
Пример #17
0
        public void DisposeTex(ref ICustomTexture texture)
        {
            if (texture == null)
            {
                return;
            }

            MyCustomTexture textureInternal = (MyCustomTexture)texture;

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

            m_objectsPool.Deallocate(textureInternal);
        }
Пример #18
0
        internal void DisposeTex(ref IDepthStencil tex)
        {
            if (tex == null)
            {
                return;
            }

            MyDepthStencil texture = (MyDepthStencil)tex;

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

            m_objectsPool.Deallocate(texture);
        }
Пример #19
0
        internal void DisposeTex(ref IDepthArrayTexture texture)
        {
            if (texture == null)
            {
                return;
            }

            MyDepthArrayTexture castedTexture = (MyDepthArrayTexture)texture;

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

            m_depthArrays.Deallocate(castedTexture);
            texture = null;
        }
Пример #20
0
        public void DisposeTex(ref IDepthTexture texture)
        {
            if (texture == null)
            {
                return;
            }

            MyDepthTexture textureInternal = (MyDepthTexture)texture;

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

            m_depthTextures.Deallocate(textureInternal);
            texture = null;
        }
        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;
        }
Пример #22
0
        public void DisposeTex(ref IUavTexture texture)
        {
            if (texture == null)
            {
                return;
            }

            MyUavTexture textureInternal = (MyUavTexture)texture;

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

            m_uavTextures.Deallocate(textureInternal);
            m_statistics.Remove(textureInternal);
            texture = null;
        }
Пример #23
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;
        }
Пример #24
0
 internal static void Remove(MyCullProxy proxy)
 {
     m_cullProxyPool.Deallocate(proxy);
 }
Пример #25
0
 internal static void Deallocate(T item)
 {
     item.Destruct();
     m_pool.Deallocate(item);
 }
Пример #26
0
 public static void DeallocateAnimatedParticle(MyAnimatedParticle particle)
 {
     m_animatedParticles.Deallocate(particle);
 }
Пример #27
0
 internal static void Remove(MyRenderableProxy proxy)
 {
     m_rendrableProxyPool.Deallocate(proxy);
 }
Пример #28
0
 internal static void Free(MyCullProxy_2 o)
 {
     Pool.Deallocate(o);
 }
Пример #29
0
 internal static void Destroy(MyActor item)
 {
     item.Destruct();
     m_pool.Deallocate(item);
 }
Пример #30
0
 public static void Remove(MyMissile missile)
 {
     m_missiles.Deallocate(missile);
 }