nes palette viewer - dont' new up brushes on every draw
This commit is contained in:
parent
5c5438ea18
commit
284af73b14
|
@ -5,6 +5,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public sealed class PaletteViewer : Control
|
public sealed class PaletteViewer : Control
|
||||||
{
|
{
|
||||||
|
private readonly SolidBrush BgPalettesBrush = new SolidBrush(Color.Black);
|
||||||
|
private readonly SolidBrush SpritePalettesBrush = new SolidBrush(Color.Black);
|
||||||
|
|
||||||
public class Palette
|
public class Palette
|
||||||
{
|
{
|
||||||
public int Address { get; }
|
public int Address { get; }
|
||||||
|
@ -49,8 +52,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
for (int x = 0; x < 16; x++)
|
for (int x = 0; x < 16; x++)
|
||||||
{
|
{
|
||||||
e.Graphics.FillRectangle(new SolidBrush(BgPalettes[x].Color), new Rectangle(x * 16, 0, 16, 16));
|
BgPalettesBrush.Color = BgPalettes[x].Color;
|
||||||
e.Graphics.FillRectangle(new SolidBrush(SpritePalettes[x].Color), new Rectangle(x * 16, 16, 16, 16));
|
SpritePalettesBrush.Color = SpritePalettes[x].Color;
|
||||||
|
e.Graphics.FillRectangle(BgPalettesBrush, new Rectangle(x * 16, 0, 16, 16));
|
||||||
|
e.Graphics.FillRectangle(SpritePalettesBrush, new Rectangle(x * 16, 16, 16, 16));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue