NES PPU Viewer - start pattern viewer

This commit is contained in:
andres.delikat 2011-03-09 03:47:48 +00:00
parent ea21d73ed8
commit 8078018905
4 changed files with 66 additions and 67 deletions

View File

@ -138,6 +138,9 @@
<Compile Include="NEStools\PaletteViewer.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="NEStools\PatternViewer.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="PlayMovie.cs">
<SubType>Form</SubType>
</Compile>

View File

@ -30,17 +30,20 @@
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.PalettesGroup = new System.Windows.Forms.GroupBox();
this.PaletteView = new BizHawk.MultiClient.PaletteViewer();
this.DetailsBox = new System.Windows.Forms.GroupBox();
this.SectionLabel = new System.Windows.Forms.Label();
this.AddressLabel = new System.Windows.Forms.Label();
this.ValueLabel = new System.Windows.Forms.Label();
this.PaletteView = new BizHawk.MultiClient.PaletteViewer();
this.PatternView = new BizHawk.MultiClient.PatternViewer();
this.groupBox1.SuspendLayout();
this.PalettesGroup.SuspendLayout();
this.DetailsBox.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.PatternView);
this.groupBox1.Location = new System.Drawing.Point(12, 26);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(281, 199);
@ -58,17 +61,6 @@
this.PalettesGroup.TabStop = false;
this.PalettesGroup.Text = "Palettes";
//
// PaletteView
//
this.PaletteView.BackColor = System.Drawing.Color.White;
this.PaletteView.Location = new System.Drawing.Point(6, 19);
this.PaletteView.Name = "PaletteView";
this.PaletteView.Size = new System.Drawing.Size(257, 34);
this.PaletteView.TabIndex = 0;
this.PaletteView.MouseLeave += new System.EventHandler(this.PaletteView_MouseLeave);
this.PaletteView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PaletteView_MouseMove);
this.PaletteView.MouseEnter += new System.EventHandler(this.PaletteView_MouseEnter);
//
// DetailsBox
//
this.DetailsBox.Controls.Add(this.ValueLabel);
@ -108,6 +100,23 @@
this.ValueLabel.TabIndex = 2;
this.ValueLabel.Text = "label1";
//
// PaletteView
//
this.PaletteView.BackColor = System.Drawing.Color.White;
this.PaletteView.Location = new System.Drawing.Point(6, 19);
this.PaletteView.Name = "PaletteView";
this.PaletteView.Size = new System.Drawing.Size(257, 34);
this.PaletteView.TabIndex = 0;
this.PaletteView.MouseLeave += new System.EventHandler(this.PaletteView_MouseLeave);
this.PaletteView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PaletteView_MouseMove);
this.PaletteView.MouseEnter += new System.EventHandler(this.PaletteView_MouseEnter);
//
// label1
//
this.PatternView.Location = new System.Drawing.Point(17, 26);
this.PatternView.Size = new System.Drawing.Size(35, 13);
this.PatternView.TabIndex = 0;
//
// NESPPU
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -120,6 +129,8 @@
this.Name = "NESPPU";
this.Text = "PPU Viewer";
this.Load += new System.EventHandler(this.NESPPU_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.PalettesGroup.ResumeLayout(false);
this.DetailsBox.ResumeLayout(false);
this.DetailsBox.PerformLayout();
@ -136,5 +147,6 @@
private System.Windows.Forms.Label ValueLabel;
private System.Windows.Forms.Label AddressLabel;
private System.Windows.Forms.Label SectionLabel;
private BizHawk.MultiClient.PatternViewer PatternView;
}
}

View File

@ -53,8 +53,6 @@ namespace BizHawk.MultiClient
this.Size = new Size(128, 32);
this.BackColor = Color.White;
this.Paint += new System.Windows.Forms.PaintEventHandler(this.PaletteViewer_Paint);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PaletteViewer_MouseMove);
this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.PaletteViewer_MouseClick);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PaletteViewer_KeyDown);
for (int x = 0; x < 16; x++)
@ -89,58 +87,5 @@ namespace BizHawk.MultiClient
{
Display(e.Graphics);
}
private void PaletteViewer_MouseMove(object sender, MouseEventArgs e)
{
}
private void PaletteViewer_MouseClick(object sender, MouseEventArgs e)
{
}
/*
//adelikat: Using my own approximation of the NES color palette until we have a decent palette system
private Color GetColorByValue(int value)
{
switch (value)
{
case 0x00:
return Color.White;
case 0x01:
return Color.LightBlue;
case 0x02:
return Color.Blue;
case 0x03:
return Color.DarkBlue;
case 0x04:
return Color.Magenta;
case 0x05:
return Color.OrangeRed;
case 0x06:
return Color.Red;
case 0x07:
return Color.DarkRed;
case 0x08:
return Color.Brown;
case 0x09:
return Color.DarkGreen;
case 0x0A:
return Color.Green;
case 0x0B:
return Color.LightGreen;
case 0x0C:
return Color.Aqua;
case 0x0D:
return Color.DarkGray;
case 0x0E:
return Color.Gray;
case 0x0F:
return Color.LightGray;
default:
return Color.Black;
}
}
*/
}
}

View File

@ -0,0 +1,39 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
namespace BizHawk.MultiClient
{
public class PatternViewer : Control
{
public PatternViewer()
{
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
this.Size = new Size(128, 32);
this.BackColor = Color.White;
this.Paint += new System.Windows.Forms.PaintEventHandler(this.PatternViewer_Paint);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PatternViewer_KeyDown);
}
private void PatternViewer_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { }
private void Display(Graphics g)
{
unchecked
{
}
}
private void PatternViewer_Paint(object sender, PaintEventArgs e)
{
Display(e.Graphics);
}
}
}