Пример #1
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            for (int i = 0; i < DrawInfos.Count; ++i)
            {
                SpriteDrawInfo di     = DrawInfos[i];
                ISprite        sprite = di.Drawable;

                if (sprite == null || sprite.Texture() == null)
                {
                    continue;
                }

                var currentTextureName = Path.GetFileNameWithoutExtension(sprite.Texture().Name);

                if (_hiddenTextures.Find(n => n == currentTextureName) == null)
                {
                    if (sprite.Texture().Name != null && _textureSwapMap.ContainsKey(sprite.Texture().Name) && _textureSwapMap[sprite.Texture().Name] != null)
                    {
                        sprite = new TextureSprite(_textureSwapMap[sprite.Texture().Name]);
                    }

                    sprite.Draw(spriteBatch, di.Pivot, di.Position, di.Scale, di.Rotation, di.Color, di.Depth, StretchOut);
                }
            }
        }