Ejemplo n.º 1
0
            public void SetCursor(byte[] pixels, int offset, int width, int height, Point hotspot, int keyColor)
            {
                if (_gfxManager._textureCursor.Width != width || _gfxManager._textureCursor.Height != height)
                {
                    _gfxManager._textureCursor.Dispose();
                    _gfxManager._textureCursor = new Texture2D(_gfxManager._device, width, height);
                }

                _gfxManager.Hotspot = new Vector2(hotspot.X, hotspot.Y);
                var pixelsCursor = new Color[width * height];

                byte r, g, b;

                for (int h = 0; h < height; h++)
                {
                    for (int w = 0; w < width; w++)
                    {
                        var palColor = pixels.ToUInt16(offset + w * 2 + h * width * 2);
                        Core.Graphics.ColorHelper.ColorToRGB(palColor, out r, out g, out b);
                        var color = palColor == keyColor ? Color.Transparent : new Color(r, g, b);
                        pixelsCursor[w + h * width] = color;
                    }
                }

                _gfxManager._textureCursor.SetData(pixelsCursor);
            }
Ejemplo n.º 2
0
            public void SetCursor(byte[] pixels, int offset, int width, int height, Point hotspot, int keyColor)
            {
                if (_gfxManager._textureCursor.Width != width || _gfxManager._textureCursor.Height != height)
                {
                    _gfxManager._textureCursor.Dispose();
                    _gfxManager._textureCursor = new Texture2D(_gfxManager._device, width, height);
                }

                _gfxManager.Hotspot = new Vector2(hotspot.X, hotspot.Y);
                var pixelsCursor = new Color[width * height];

                for (int h = 0; h < height; h++)
                {
                    for (int w = 0; w < width; w++)
                    {
                        var palColor = pixels[offset + w + h * width];
                        var color    = palColor == keyColor ? Color.Transparent : _gfxManager._palColors[palColor];
                        pixelsCursor[w + h * width] = color;
                    }
                }

                _gfxManager._textureCursor.SetData(pixelsCursor);
            }
Ejemplo n.º 3
0
 public void SetCursor(byte[] pixels, int width, int height, Point hotspot)
 {
     SetCursor(pixels, 0, width, height, hotspot, 0xFF);
 }
Ejemplo n.º 4
0
 public void SetCursor(byte[] pixels, int width, int height, Point hotspot)
 {
     _colorGraphicsManager.SetCursor(pixels, width, height, hotspot);
 }
Ejemplo n.º 5
0
 public void SetCursor(byte[] pixels, int offset, int width, int height, Point hotspot, int keyColor)
 {
     _colorGraphicsManager.SetCursor(pixels, offset, width, height, hotspot, keyColor);
 }
Ejemplo n.º 6
0
            public void SetCursor(byte[] pixels, int offset, int width, int height, Point hotspot, int keyColor)
            {
                if (_gfxManager._textureCursor.Width != width || _gfxManager._textureCursor.Height != height)
                {
                    _gfxManager._textureCursor.Dispose();
                    _gfxManager._textureCursor = new Texture2D(_gfxManager._device, width, height);
                }

                _gfxManager.Hotspot = new Vector2(hotspot.X, hotspot.Y);
                var pixelsCursor = new Color[width * height];

                for (int h = 0; h < height; h++)
                {
                    for (int w = 0; w < width; w++)
                    {
                        var palColor = pixels[offset + w + h * width];
                        var color = palColor == keyColor ? Color.Transparent : _gfxManager._palColors[palColor];
                        pixelsCursor[w + h * width] = color;
                    }
                }

                _gfxManager._textureCursor.SetData(pixelsCursor);
            }
Ejemplo n.º 7
0
 public void SetCursor(byte[] pixels, int width, int height, Point hotspot)
 {
     SetCursor(pixels, 0, width, height, hotspot, 0xFF);
 }
Ejemplo n.º 8
0
            public void SetCursor(byte[] pixels, int offset, int width, int height, Point hotspot, int keyColor)
            {
                if (_gfxManager._textureCursor.Width != width || _gfxManager._textureCursor.Height != height)
                {
                    _gfxManager._textureCursor.Dispose();
                    _gfxManager._textureCursor = new Texture2D(_gfxManager._device, width, height);
                }

                _gfxManager.Hotspot = new Vector2(hotspot.X, hotspot.Y);
                var pixelsCursor = new Color[width * height];

                byte r, g, b;
                for (int h = 0; h < height; h++)
                {
                    for (int w = 0; w < width; w++)
                    {
                        var palColor = pixels.ToUInt16(offset + w * 2 + h * width * 2);
                        Core.Graphics.ColorHelper.ColorToRGB(palColor, out r, out g, out b);
                        var color = palColor == keyColor ? Color.Transparent : new Color(r, g, b);
                        pixelsCursor[w + h * width] = color;
                    }
                }

                _gfxManager._textureCursor.SetData(pixelsCursor);
            }
Ejemplo n.º 9
0
 public void SetCursor(byte[] pixels, int offset, int width, int height, Point hotspot, int keyColor)
 {
     _colorGraphicsManager.SetCursor(pixels, offset, width, height, hotspot, keyColor);
 }
Ejemplo n.º 10
0
 public void SetCursor(byte[] pixels, int width, int height, Point hotspot)
 {
     _colorGraphicsManager.SetCursor(pixels, width, height, hotspot);
 }