コード例 #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);
            }
コード例 #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);
            }
コード例 #3
0
 public void SetCursor(byte[] pixels, int width, int height, Point hotspot)
 {
     SetCursor(pixels, 0, width, height, hotspot, 0xFF);
 }
コード例 #4
0
 public void SetCursor(byte[] pixels, int width, int height, Point hotspot)
 {
     _colorGraphicsManager.SetCursor(pixels, width, height, hotspot);
 }
コード例 #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);
 }
コード例 #6
0
ファイル: XnaGraphicsManager.cs プロジェクト: scemino/nscumm
            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);
            }
コード例 #7
0
ファイル: XnaGraphicsManager.cs プロジェクト: scemino/nscumm
 public void SetCursor(byte[] pixels, int width, int height, Point hotspot)
 {
     SetCursor(pixels, 0, width, height, hotspot, 0xFF);
 }
コード例 #8
0
ファイル: XnaGraphicsManager.cs プロジェクト: scemino/nscumm
            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);
            }
コード例 #9
0
ファイル: XnaGraphicsManager.cs プロジェクト: scemino/nscumm
 public void SetCursor(byte[] pixels, int offset, int width, int height, Point hotspot, int keyColor)
 {
     _colorGraphicsManager.SetCursor(pixels, offset, width, height, hotspot, keyColor);
 }
コード例 #10
0
ファイル: XnaGraphicsManager.cs プロジェクト: scemino/nscumm
 public void SetCursor(byte[] pixels, int width, int height, Point hotspot)
 {
     _colorGraphicsManager.SetCursor(pixels, width, height, hotspot);
 }