Beispiel #1
0
        private static void Remove(GPUEmitterId id)
        {
            var emitter = m_emitters.Data[id.Index];

            m_idIndex.Remove(emitter.GPUEmitter.GID);

            m_freeBufferIndices.Enqueue(emitter.BufferIndex);

            m_emitters.Free(id.Index);

            RemoveTexture(emitter.TextureId);
        }
Beispiel #2
0
        internal static void Create(uint GID)
        {
            var id = new GPUEmitterId {
                Index = m_emitters.Allocate()
            };

            MyRenderProxy.Assert(m_freeBufferIndices.Count > 0, "Too many live emitters!");

            m_emitters.Data[id.Index] = new MyLiveData
            {
                BufferIndex = m_freeBufferIndices.Dequeue(),
                TextureId   = Resources.TexId.NULL,
                DieAt       = float.MaxValue
            };

            m_idIndex[GID] = id;
        }