Example #1
0
 private void DeepCopyBatchValues(DrawingBatch from, DrawingBatch to)
 {
     to.NumIndices   = from.NumIndices;
     to.StartIndex   = from.StartIndex;
     to.TextureMode0 = from.TextureMode0;
     to.TextureMode1 = from.TextureMode1;
     to.Texture0     = from.Texture0;
     to.Texture1     = from.Texture1;
 }
Example #2
0
        public DrawingBatch[] CreatePoolOfSize(int size, bool copyExisting, DrawingBatch[] existing = null)
        {
            var oldPool = existing;

            var pool = new DrawingBatch[size];

            for (var p = 0; p < size; p++)
            {
                pool[p] = new DrawingBatch();
            }

            if (copyExisting)
            {
                var oldSize = oldPool.Length;
                var num     = oldSize < size ? oldSize : size;
                for (var p = 0; p < num; p++)
                {
                    DeepCopyBatchValues(oldPool[p], pool[p]);
                }
            }

            return(pool);
        }