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); }
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); }
public void SetCursor(byte[] pixels, int width, int height, Point hotspot) { SetCursor(pixels, 0, width, height, hotspot, 0xFF); }
public void SetCursor(byte[] pixels, int width, int height, Point hotspot) { _colorGraphicsManager.SetCursor(pixels, width, height, hotspot); }
public void SetCursor(byte[] pixels, int offset, int width, int height, Point hotspot, int keyColor) { _colorGraphicsManager.SetCursor(pixels, offset, width, height, hotspot, keyColor); }