Exemplo n.º 1
0
        private void AddNew(object texture, VerticeSpriteSpecific data)
        {
            if (texture == null)
            {
                return;
            }

            lock (_textureSprites) {
                // Create new segment with initial values
                var newSegment = new SpriteSegment {
                    Texture = texture,
                    Sprites = { data }
                };

                _sprites.Add(newSegment);

                // Create reference for segment in dictionary
                if (!_textureSprites.ContainsKey(texture))
                {
                    // Thread.Sleep(100);
                    _textureSprites.Add(texture, new List <SpriteSegment>());
                    // Task.Run(() => AcToolsLogging.Write(s));
                }

                _textureSprites[texture].Add(newSegment);
                _spriteCount++;
                CheckForFullBuffer();
            }
        }
Exemplo n.º 2
0
        private void AddNew(object texture, VerticeSpriteSpecific data)
        {
            // Create new segment with initial values
            var newSegment = new SpriteSegment {
                Texture = texture,
                Sprites = { data }
            };

            _sprites.Add(newSegment);

            // Create reference for segment in dictionary
            if (!_textureSprites.ContainsKey(texture))
            {
                _textureSprites.Add(texture, new List <SpriteSegment>());
            }

            _textureSprites[texture].Add(newSegment);
            _spriteCount++;
            CheckForFullBuffer();
        }
Exemplo n.º 3
0
 private void AddIn(SpriteSegment segment, VerticeSpriteSpecific data)
 {
     segment.Sprites.Add(data);
     _spriteCount++;
     CheckForFullBuffer();
 }