├── .gitattributes
├── .gitignore
├── Codec
├── Palette.cs
└── PaletteFormat
│ └── TileLayerPro.cs
├── Forms
├── ColorSortManual.Designer.cs
├── ColorSortManual.cs
├── ColorSortManual.resx
├── ColorSortSettings.Designer.cs
├── ColorSortSettings.cs
├── ColorSortSettings.resx
├── Main.cs
├── Main.designer.cs
├── Main.resx
├── Preview.Designer.cs
├── Preview.cs
├── Preview.resx
├── TranslucencySettings.Designer.cs
├── TranslucencySettings.cs
├── TranslucencySettings.resx
├── TransparencySettings.Designer.cs
├── TransparencySettings.cs
└── TransparencySettings.resx
├── NewCode
├── IBitformat.cs
├── Linear.cs
├── Packed.cs
├── SNES.cs
├── SnesGFX.cs
└── Tile.cs
├── Options.cs
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
├── Settings.settings
└── app.manifest
├── Resources
├── base.mwl
├── empty.png
└── mw3.mw3
├── SnesGFX.csproj
├── app.config
├── icon.ico
└── snesgfx.ico
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | bld/
24 | [Bb]in/
25 | [Oo]bj/
26 | [Ll]og/
27 |
28 | # Visual Studio 2015/2017 cache/options directory
29 | .vs/
30 | # Uncomment if you have tasks that create the project's static files in wwwroot
31 | #wwwroot/
32 |
33 | # Visual Studio 2017 auto generated files
34 | Generated\ Files/
35 |
36 | # MSTest test Results
37 | [Tt]est[Rr]esult*/
38 | [Bb]uild[Ll]og.*
39 |
40 | # NUNIT
41 | *.VisualState.xml
42 | TestResult.xml
43 |
44 | # Build Results of an ATL Project
45 | [Dd]ebugPS/
46 | [Rr]eleasePS/
47 | dlldata.c
48 |
49 | # Benchmark Results
50 | BenchmarkDotNet.Artifacts/
51 |
52 | # .NET Core
53 | project.lock.json
54 | project.fragment.lock.json
55 | artifacts/
56 |
57 | # StyleCop
58 | StyleCopReport.xml
59 |
60 | # Files built by Visual Studio
61 | *_i.c
62 | *_p.c
63 | *_h.h
64 | *.ilk
65 | *.meta
66 | *.obj
67 | *.iobj
68 | *.pch
69 | *.pdb
70 | *.ipdb
71 | *.pgc
72 | *.pgd
73 | *.rsp
74 | *.sbr
75 | *.tlb
76 | *.tli
77 | *.tlh
78 | *.tmp
79 | *.tmp_proj
80 | *_wpftmp.csproj
81 | *.log
82 | *.vspscc
83 | *.vssscc
84 | .builds
85 | *.pidb
86 | *.svclog
87 | *.scc
88 |
89 | # Chutzpah Test files
90 | _Chutzpah*
91 |
92 | # Visual C++ cache files
93 | ipch/
94 | *.aps
95 | *.ncb
96 | *.opendb
97 | *.opensdf
98 | *.sdf
99 | *.cachefile
100 | *.VC.db
101 | *.VC.VC.opendb
102 |
103 | # Visual Studio profiler
104 | *.psess
105 | *.vsp
106 | *.vspx
107 | *.sap
108 |
109 | # Visual Studio Trace Files
110 | *.e2e
111 |
112 | # TFS 2012 Local Workspace
113 | $tf/
114 |
115 | # Guidance Automation Toolkit
116 | *.gpState
117 |
118 | # ReSharper is a .NET coding add-in
119 | _ReSharper*/
120 | *.[Rr]e[Ss]harper
121 | *.DotSettings.user
122 |
123 | # JustCode is a .NET coding add-in
124 | .JustCode
125 |
126 | # TeamCity is a build add-in
127 | _TeamCity*
128 |
129 | # DotCover is a Code Coverage Tool
130 | *.dotCover
131 |
132 | # AxoCover is a Code Coverage Tool
133 | .axoCover/*
134 | !.axoCover/settings.json
135 |
136 | # Visual Studio code coverage results
137 | *.coverage
138 | *.coveragexml
139 |
140 | # NCrunch
141 | _NCrunch_*
142 | .*crunch*.local.xml
143 | nCrunchTemp_*
144 |
145 | # MightyMoose
146 | *.mm.*
147 | AutoTest.Net/
148 |
149 | # Web workbench (sass)
150 | .sass-cache/
151 |
152 | # Installshield output folder
153 | [Ee]xpress/
154 |
155 | # DocProject is a documentation generator add-in
156 | DocProject/buildhelp/
157 | DocProject/Help/*.HxT
158 | DocProject/Help/*.HxC
159 | DocProject/Help/*.hhc
160 | DocProject/Help/*.hhk
161 | DocProject/Help/*.hhp
162 | DocProject/Help/Html2
163 | DocProject/Help/html
164 |
165 | # Click-Once directory
166 | publish/
167 |
168 | # Publish Web Output
169 | *.[Pp]ublish.xml
170 | *.azurePubxml
171 | # Note: Comment the next line if you want to checkin your web deploy settings,
172 | # but database connection strings (with potential passwords) will be unencrypted
173 | *.pubxml
174 | *.publishproj
175 |
176 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
177 | # checkin your Azure Web App publish settings, but sensitive information contained
178 | # in these scripts will be unencrypted
179 | PublishScripts/
180 |
181 | # NuGet Packages
182 | *.nupkg
183 | # The packages folder can be ignored because of Package Restore
184 | **/[Pp]ackages/*
185 | # except build/, which is used as an MSBuild target.
186 | !**/[Pp]ackages/build/
187 | # Uncomment if necessary however generally it will be regenerated when needed
188 | #!**/[Pp]ackages/repositories.config
189 | # NuGet v3's project.json files produces more ignorable files
190 | *.nuget.props
191 | *.nuget.targets
192 |
193 | # Microsoft Azure Build Output
194 | csx/
195 | *.build.csdef
196 |
197 | # Microsoft Azure Emulator
198 | ecf/
199 | rcf/
200 |
201 | # Windows Store app package directories and files
202 | AppPackages/
203 | BundleArtifacts/
204 | Package.StoreAssociation.xml
205 | _pkginfo.txt
206 | *.appx
207 |
208 | # Visual Studio cache files
209 | # files ending in .cache can be ignored
210 | *.[Cc]ache
211 | # but keep track of directories ending in .cache
212 | !*.[Cc]ache/
213 |
214 | # Others
215 | ClientBin/
216 | ~$*
217 | *~
218 | *.dbmdl
219 | *.dbproj.schemaview
220 | *.jfm
221 | *.pfx
222 | *.publishsettings
223 | orleans.codegen.cs
224 |
225 | # Including strong name files can present a security risk
226 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
227 | #*.snk
228 |
229 | # Since there are multiple workflows, uncomment next line to ignore bower_components
230 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
231 | #bower_components/
232 |
233 | # RIA/Silverlight projects
234 | Generated_Code/
235 |
236 | # Backup & report files from converting an old project file
237 | # to a newer Visual Studio version. Backup files are not needed,
238 | # because we have git ;-)
239 | _UpgradeReport_Files/
240 | Backup*/
241 | UpgradeLog*.XML
242 | UpgradeLog*.htm
243 | ServiceFabricBackup/
244 | *.rptproj.bak
245 |
246 | # SQL Server files
247 | *.mdf
248 | *.ldf
249 | *.ndf
250 |
251 | # Business Intelligence projects
252 | *.rdl.data
253 | *.bim.layout
254 | *.bim_*.settings
255 | *.rptproj.rsuser
256 |
257 | # Microsoft Fakes
258 | FakesAssemblies/
259 |
260 | # GhostDoc plugin setting file
261 | *.GhostDoc.xml
262 |
263 | # Node.js Tools for Visual Studio
264 | .ntvs_analysis.dat
265 | node_modules/
266 |
267 | # Visual Studio 6 build log
268 | *.plg
269 |
270 | # Visual Studio 6 workspace options file
271 | *.opt
272 |
273 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
274 | *.vbw
275 |
276 | # Visual Studio LightSwitch build output
277 | **/*.HTMLClient/GeneratedArtifacts
278 | **/*.DesktopClient/GeneratedArtifacts
279 | **/*.DesktopClient/ModelManifest.xml
280 | **/*.Server/GeneratedArtifacts
281 | **/*.Server/ModelManifest.xml
282 | _Pvt_Extensions
283 |
284 | # Paket dependency manager
285 | .paket/paket.exe
286 | paket-files/
287 |
288 | # FAKE - F# Make
289 | .fake/
290 |
291 | # JetBrains Rider
292 | .idea/
293 | *.sln.iml
294 |
295 | # CodeRush personal settings
296 | .cr/personal
297 |
298 | # Python Tools for Visual Studio (PTVS)
299 | __pycache__/
300 | *.pyc
301 |
302 | # Cake - Uncomment if you are using it
303 | # tools/**
304 | # !tools/packages.config
305 |
306 | # Tabs Studio
307 | *.tss
308 |
309 | # Telerik's JustMock configuration file
310 | *.jmconfig
311 |
312 | # BizTalk build output
313 | *.btp.cs
314 | *.btm.cs
315 | *.odx.cs
316 | *.xsd.cs
317 |
318 | # OpenCover UI analysis results
319 | OpenCover/
320 |
321 | # Azure Stream Analytics local run output
322 | ASALocalRun/
323 |
324 | # MSBuild Binary and Structured Log
325 | *.binlog
326 |
327 | # NVidia Nsight GPU debugger configuration file
328 | *.nvuser
329 |
330 | # MFractors (Xamarin productivity tool) working folder
331 | .mfractor/
332 |
333 | # Local History for Visual Studio
334 | .localhistory/
335 |
--------------------------------------------------------------------------------
/Codec/Palette.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Text;
5 |
6 | namespace SnesGFX.Codec
7 | {
8 | class Palette
9 | {
10 | public interface Interface
11 | {
12 | bool IsGeneric { get; }
13 | bool TestInput(byte[] input);
14 | Color[] Decode();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Codec/PaletteFormat/TileLayerPro.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SnesGFX.Codec.PaletteFormat
6 | {
7 | class TileLayerPro
8 | {
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Forms/ColorSortManual.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace SnesGFX.Forms
2 | {
3 | partial class ColorSortManual
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ColorSortManual));
32 | this.panel1 = new System.Windows.Forms.Panel();
33 | this.label1 = new System.Windows.Forms.Label();
34 | this.button1 = new System.Windows.Forms.Button();
35 | this.button2 = new System.Windows.Forms.Button();
36 | this.button4 = new System.Windows.Forms.Button();
37 | this.button5 = new System.Windows.Forms.Button();
38 | this.button6 = new System.Windows.Forms.Button();
39 | this.SuspendLayout();
40 | //
41 | // panel1
42 | //
43 | this.panel1.Location = new System.Drawing.Point(12, 12);
44 | this.panel1.Name = "panel1";
45 | this.panel1.Size = new System.Drawing.Size(256, 256);
46 | this.panel1.TabIndex = 0;
47 | //
48 | // label1
49 | //
50 | this.label1.Location = new System.Drawing.Point(274, 12);
51 | this.label1.Name = "label1";
52 | this.label1.Size = new System.Drawing.Size(236, 256);
53 | this.label1.TabIndex = 1;
54 | this.label1.Text = resources.GetString("label1.Text");
55 | this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
56 | //
57 | // button1
58 | //
59 | this.button1.Location = new System.Drawing.Point(12, 274);
60 | this.button1.Name = "button1";
61 | this.button1.Size = new System.Drawing.Size(75, 23);
62 | this.button1.TabIndex = 2;
63 | this.button1.Text = "OK";
64 | this.button1.UseVisualStyleBackColor = true;
65 | this.button1.Click += new System.EventHandler(this.button1_Click);
66 | //
67 | // button2
68 | //
69 | this.button2.Location = new System.Drawing.Point(93, 274);
70 | this.button2.Name = "button2";
71 | this.button2.Size = new System.Drawing.Size(75, 23);
72 | this.button2.TabIndex = 3;
73 | this.button2.Text = "Cancel";
74 | this.button2.UseVisualStyleBackColor = true;
75 | this.button2.Click += new System.EventHandler(this.button2_Click);
76 | //
77 | // button4
78 | //
79 | this.button4.Location = new System.Drawing.Point(273, 274);
80 | this.button4.Name = "button4";
81 | this.button4.Size = new System.Drawing.Size(75, 23);
82 | this.button4.TabIndex = 5;
83 | this.button4.Text = "Hue";
84 | this.button4.UseVisualStyleBackColor = true;
85 | this.button4.Click += new System.EventHandler(this.button4_Click);
86 | //
87 | // button5
88 | //
89 | this.button5.Location = new System.Drawing.Point(354, 274);
90 | this.button5.Name = "button5";
91 | this.button5.Size = new System.Drawing.Size(75, 23);
92 | this.button5.TabIndex = 6;
93 | this.button5.Text = "Brightness";
94 | this.button5.UseVisualStyleBackColor = true;
95 | this.button5.Click += new System.EventHandler(this.button5_Click);
96 | //
97 | // button6
98 | //
99 | this.button6.Location = new System.Drawing.Point(435, 274);
100 | this.button6.Name = "button6";
101 | this.button6.Size = new System.Drawing.Size(75, 23);
102 | this.button6.TabIndex = 7;
103 | this.button6.Text = "Saturation";
104 | this.button6.UseVisualStyleBackColor = true;
105 | this.button6.Click += new System.EventHandler(this.button6_Click);
106 | //
107 | // Form5
108 | //
109 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
110 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
111 | this.ClientSize = new System.Drawing.Size(522, 306);
112 | this.Controls.Add(this.button6);
113 | this.Controls.Add(this.button5);
114 | this.Controls.Add(this.button4);
115 | this.Controls.Add(this.button2);
116 | this.Controls.Add(this.button1);
117 | this.Controls.Add(this.label1);
118 | this.Controls.Add(this.panel1);
119 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
120 | this.MaximizeBox = false;
121 | this.MinimizeBox = false;
122 | this.Name = "Form5";
123 | this.Text = "Arrange Colors: Manual";
124 | this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form5_FormClosed);
125 | this.ResumeLayout(false);
126 |
127 | }
128 |
129 | #endregion
130 |
131 | private System.Windows.Forms.Panel panel1;
132 | private System.Windows.Forms.Label label1;
133 | private System.Windows.Forms.Button button1;
134 | private System.Windows.Forms.Button button2;
135 | private System.Windows.Forms.Button button4;
136 | private System.Windows.Forms.Button button5;
137 | private System.Windows.Forms.Button button6;
138 | }
139 | }
--------------------------------------------------------------------------------
/Forms/ColorSortManual.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 | using System.Drawing.Imaging;
9 |
10 | namespace SnesGFX.Forms
11 | {
12 | public partial class ColorSortManual : Form
13 | {
14 | ///
15 | /// likely to have 256 entries.
16 | ///
17 | public Color[] table;
18 | Bitmap bmp;
19 | Label[] labelTable;
20 |
21 | int source = -1;
22 | int source2 = -1;
23 |
24 | public bool cancelled = true;
25 |
26 | public ColorSortManual(Color[] tbl)
27 | {
28 | InitializeComponent();
29 | this.table = new Color[256];
30 | this.labelTable = new Label[256];
31 | tbl.CopyTo(table, 0);
32 | Application.UseWaitCursor = false;
33 | using (var b = new Bitmap(1, 1, PixelFormat.Format32bppArgb))
34 | {
35 | this.bmp = Program.ScaleRatio(b, new Size(16, 16));
36 | }
37 |
38 | for (int i = 0; i < 256; ++i)
39 | {
40 | int x = i << 4 & 0xF0;
41 | int y = i & 0xF0;
42 |
43 | Label label = new Label();
44 | if (table[i].A != 0)
45 | {
46 | label.BackColor = table[i];
47 | }
48 | else
49 | {
50 | label.BackColor = Color.Transparent;
51 | label.Image = bmp;
52 | }
53 |
54 | if (table[i].IsEmpty)
55 | {
56 | label.Image = Properties.Resources.empty;
57 | }
58 | label.Size = new Size(16, 16);
59 | label.Location = new Point(x, y);
60 | label.MouseClick += new MouseEventHandler(label_MouseClick);
61 | label.Tag = i;
62 | panel1.Controls.Add(label);
63 | labelTable[i] = label;
64 | }
65 | }
66 |
67 | void label_MouseClick(object sender, MouseEventArgs e)
68 | {
69 | Text = "Arrange Colors: Manual";
70 | if (e.Button == System.Windows.Forms.MouseButtons.Left)
71 | {
72 | if (source == -1)
73 | {
74 | source = (int)(((Label)sender).Tag);
75 | }
76 | else
77 | {
78 | int dest = (int)(((Label)sender).Tag);
79 |
80 | Color a = table[source];
81 | Color b = table[dest];
82 |
83 | changeColor(b, source);
84 | changeColor(a, dest);
85 | source = -1;
86 | }
87 | }
88 | else if (e.Button == System.Windows.Forms.MouseButtons.Right)
89 | {
90 | if (source2 == -1)
91 | {
92 | source2 = (int)(((Label)sender).Tag) & 0xF0;
93 | }
94 | else
95 | {
96 | int dest = (int)(((Label)sender).Tag) & 0xF0;
97 |
98 | for (int i = 0; i < 16; ++i)
99 | {
100 | int n1 = source2 + i;
101 | int n2 = dest + i;
102 |
103 | Color a = table[n1];
104 | Color b = table[n2];
105 |
106 | changeColor(b, n1);
107 | changeColor(a, n2);
108 | }
109 |
110 | source2 = -1;
111 | }
112 | }
113 | else
114 | {
115 | Text = "Hey, use a saner mouse button please!";
116 | }
117 | }
118 |
119 | private void button3_Click(object sender, EventArgs e)
120 | {
121 | var data = Properties.Resources.mw3;
122 | Color[] tbl = new Color[256];
123 |
124 | for (int i = 0; i < 256; ++i)
125 | {
126 | int snes = data[i << 1] | (data[(i << 1) + 1] << 8);
127 | tbl[i] = Color.FromArgb((snes & 0x1F) << 3, snes >> 2 & 0xF8, snes >> 7 & 0xF8);
128 |
129 | if (table[i].A == 0)
130 | {
131 | changeColor(tbl[i], i);
132 | }
133 | }
134 | }
135 |
136 | private void changeColor(Color c, int n)
137 | {
138 | table[n] = c;
139 | labelTable[n].BackColor = c;
140 | if (c.A != 0)
141 | {
142 | labelTable[n].Image = null;
143 | }
144 | else
145 | {
146 | labelTable[n].Image = bmp;
147 | }
148 |
149 | if (c.IsEmpty)
150 | {
151 | labelTable[n].Image = Properties.Resources.empty;
152 | }
153 | }
154 |
155 | private void button4_Click(object sender, EventArgs e)
156 | {
157 | List list = new List(table);
158 | list.Sort(Program.SortColorsByHue);
159 | for (int i = 0; i < 256; ++i)
160 | {
161 | changeColor(list[i], i);
162 | }
163 | }
164 |
165 | private void button5_Click(object sender, EventArgs e)
166 | {
167 | List list = new List(table);
168 | list.Sort(Program.SortColorsByBrightness);
169 | for (int i = 0; i < 256; ++i)
170 | {
171 | changeColor(list[i], i);
172 | }
173 | }
174 |
175 | private void button6_Click(object sender, EventArgs e)
176 | {
177 | List list = new List(table);
178 | list.Sort(Program.SortColorsBySaturation);
179 | for (int i = 0; i < 256; ++i)
180 | {
181 | changeColor(list[i], i);
182 | }
183 | }
184 |
185 | private void button2_Click(object sender, EventArgs e)
186 | {
187 | Close();
188 | }
189 |
190 | private void button1_Click(object sender, EventArgs e)
191 | {
192 | cancelled = false;
193 | Close();
194 | }
195 |
196 | private void Form5_FormClosed(object sender, FormClosedEventArgs e)
197 | {
198 | if (bmp != null)
199 | {
200 | bmp.Dispose();
201 | bmp = null;
202 | }
203 | }
204 | }
205 | }
206 |
--------------------------------------------------------------------------------
/Forms/ColorSortManual.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | Do a left click to select source color and left click again on another slot to move the colors.
122 |
123 | Use right click to move an entire palette row.
124 |
125 | Click OK to proceed or Cancel if you want to cancel the convertion.
126 |
127 | Click Hue/Brightness/Saturation to sort the colors according the button you've clicked. Note that it will discard the previous order changes you did.
128 |
129 | Remember to keep all colors on same row if you're using 4BPP or on a group of 4 colors if you're using 2BPP.
130 |
131 |
--------------------------------------------------------------------------------
/Forms/ColorSortSettings.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace SnesGFX.Forms
2 | {
3 | partial class ColorSortSettings
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.groupBox1 = new System.Windows.Forms.GroupBox();
32 | this.radioButton4 = new System.Windows.Forms.RadioButton();
33 | this.radioButton3 = new System.Windows.Forms.RadioButton();
34 | this.radioButton2 = new System.Windows.Forms.RadioButton();
35 | this.radioButton1 = new System.Windows.Forms.RadioButton();
36 | this.label1 = new System.Windows.Forms.Label();
37 | this.groupBox1.SuspendLayout();
38 | this.SuspendLayout();
39 | //
40 | // groupBox1
41 | //
42 | this.groupBox1.Controls.Add(this.radioButton4);
43 | this.groupBox1.Controls.Add(this.radioButton3);
44 | this.groupBox1.Controls.Add(this.radioButton2);
45 | this.groupBox1.Controls.Add(this.radioButton1);
46 | this.groupBox1.Location = new System.Drawing.Point(15, 25);
47 | this.groupBox1.Name = "groupBox1";
48 | this.groupBox1.Size = new System.Drawing.Size(155, 112);
49 | this.groupBox1.TabIndex = 0;
50 | this.groupBox1.TabStop = false;
51 | //
52 | // radioButton4
53 | //
54 | this.radioButton4.Location = new System.Drawing.Point(6, 88);
55 | this.radioButton4.Name = "radioButton4";
56 | this.radioButton4.Size = new System.Drawing.Size(143, 17);
57 | this.radioButton4.TabIndex = 4;
58 | this.radioButton4.TabStop = true;
59 | this.radioButton4.Tag = "3";
60 | this.radioButton4.Text = "Manually";
61 | this.radioButton4.UseVisualStyleBackColor = true;
62 | this.radioButton4.Click += new System.EventHandler(this.radioButton1_CheckedChanged);
63 | //
64 | // radioButton3
65 | //
66 | this.radioButton3.Location = new System.Drawing.Point(6, 65);
67 | this.radioButton3.Name = "radioButton3";
68 | this.radioButton3.Size = new System.Drawing.Size(143, 17);
69 | this.radioButton3.TabIndex = 3;
70 | this.radioButton3.TabStop = true;
71 | this.radioButton3.Tag = "2";
72 | this.radioButton3.Text = "By Saturation";
73 | this.radioButton3.UseVisualStyleBackColor = true;
74 | this.radioButton3.Click += new System.EventHandler(this.radioButton1_CheckedChanged);
75 | //
76 | // radioButton2
77 | //
78 | this.radioButton2.Location = new System.Drawing.Point(6, 42);
79 | this.radioButton2.Name = "radioButton2";
80 | this.radioButton2.Size = new System.Drawing.Size(143, 17);
81 | this.radioButton2.TabIndex = 2;
82 | this.radioButton2.TabStop = true;
83 | this.radioButton2.Tag = "1";
84 | this.radioButton2.Text = "By Brightness";
85 | this.radioButton2.UseVisualStyleBackColor = true;
86 | this.radioButton2.Click += new System.EventHandler(this.radioButton1_CheckedChanged);
87 | //
88 | // radioButton1
89 | //
90 | this.radioButton1.Location = new System.Drawing.Point(6, 19);
91 | this.radioButton1.Name = "radioButton1";
92 | this.radioButton1.Size = new System.Drawing.Size(143, 17);
93 | this.radioButton1.TabIndex = 0;
94 | this.radioButton1.TabStop = true;
95 | this.radioButton1.Tag = "0";
96 | this.radioButton1.Text = "By Hue";
97 | this.radioButton1.UseVisualStyleBackColor = true;
98 | this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
99 | this.radioButton1.Click += new System.EventHandler(this.radioButton1_CheckedChanged);
100 | //
101 | // label1
102 | //
103 | this.label1.AutoSize = true;
104 | this.label1.Location = new System.Drawing.Point(12, 9);
105 | this.label1.Name = "label1";
106 | this.label1.Size = new System.Drawing.Size(79, 13);
107 | this.label1.TabIndex = 1;
108 | this.label1.Text = "Arrange Colors:";
109 | //
110 | // Form4
111 | //
112 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
113 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
114 | this.ClientSize = new System.Drawing.Size(182, 149);
115 | this.Controls.Add(this.groupBox1);
116 | this.Controls.Add(this.label1);
117 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
118 | this.MaximizeBox = false;
119 | this.MinimizeBox = false;
120 | this.Name = "Form4";
121 | this.ShowInTaskbar = false;
122 | this.Text = "Arrange Colors Settings";
123 | this.groupBox1.ResumeLayout(false);
124 | this.ResumeLayout(false);
125 | this.PerformLayout();
126 |
127 | }
128 |
129 | #endregion
130 |
131 | private System.Windows.Forms.GroupBox groupBox1;
132 | private System.Windows.Forms.RadioButton radioButton1;
133 | private System.Windows.Forms.RadioButton radioButton2;
134 | private System.Windows.Forms.Label label1;
135 | private System.Windows.Forms.RadioButton radioButton4;
136 | private System.Windows.Forms.RadioButton radioButton3;
137 | }
138 | }
--------------------------------------------------------------------------------
/Forms/ColorSortSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace SnesGFX.Forms
10 | {
11 | public partial class ColorSortSettings : Form
12 | {
13 | public ColorSortSettings()
14 | {
15 | InitializeComponent();
16 |
17 | foreach (var c in Controls)
18 | {
19 | if (c is GroupBox)
20 | {
21 | foreach (RadioButton d in (c as GroupBox).Controls)
22 | {
23 | if (int.Parse((string)d.Tag) == Program.arrangeMethod)
24 | {
25 | d.Checked = true;
26 | }
27 | }
28 | }
29 | }
30 | }
31 |
32 | private void radioButton1_CheckedChanged(object sender, EventArgs e)
33 | {
34 | Program.arrangeMethod = int.Parse((string)((sender as RadioButton).Tag));
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Forms/ColorSortSettings.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Forms/Main.designer.cs:
--------------------------------------------------------------------------------
1 | namespace SnesGFX.Forms
2 | {
3 | partial class Main
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.checkBox3 = new System.Windows.Forms.CheckBox();
32 | this.checkBox1 = new System.Windows.Forms.CheckBox();
33 | this.checkBox4 = new System.Windows.Forms.CheckBox();
34 | this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
35 | this.button5 = new System.Windows.Forms.Button();
36 | this.button2 = new System.Windows.Forms.Button();
37 | this.comboBox2 = new System.Windows.Forms.ComboBox();
38 | this.label3 = new System.Windows.Forms.Label();
39 | this.comboBox1 = new System.Windows.Forms.ComboBox();
40 | this.label2 = new System.Windows.Forms.Label();
41 | this.button1 = new System.Windows.Forms.Button();
42 | this.label1 = new System.Windows.Forms.Label();
43 | this.textBox1 = new System.Windows.Forms.TextBox();
44 | this.textBox2 = new System.Windows.Forms.TextBox();
45 | this.label5 = new System.Windows.Forms.Label();
46 | this.tabControl1 = new System.Windows.Forms.TabControl();
47 | this.tabPage1 = new System.Windows.Forms.TabPage();
48 | this.label6 = new System.Windows.Forms.Label();
49 | this.label4 = new System.Windows.Forms.Label();
50 | this.comboBox5 = new System.Windows.Forms.ComboBox();
51 | this.comboBox4 = new System.Windows.Forms.ComboBox();
52 | this.button3 = new System.Windows.Forms.Button();
53 | this.groupBox1 = new System.Windows.Forms.GroupBox();
54 | this.domainUpDown2 = new System.Windows.Forms.DomainUpDown();
55 | this.checkBox12 = new System.Windows.Forms.CheckBox();
56 | this.checkBox11 = new System.Windows.Forms.CheckBox();
57 | this.domainUpDown1 = new System.Windows.Forms.DomainUpDown();
58 | this.button7 = new System.Windows.Forms.Button();
59 | this.checkBox10 = new System.Windows.Forms.CheckBox();
60 | this.checkBox9 = new System.Windows.Forms.CheckBox();
61 | this.button6 = new System.Windows.Forms.Button();
62 | this.button4 = new System.Windows.Forms.Button();
63 | this.checkBox7 = new System.Windows.Forms.CheckBox();
64 | this.checkBox8 = new System.Windows.Forms.CheckBox();
65 | this.comboBox3 = new System.Windows.Forms.ComboBox();
66 | this.checkBox6 = new System.Windows.Forms.CheckBox();
67 | this.checkBox5 = new System.Windows.Forms.CheckBox();
68 | this.checkBox2 = new System.Windows.Forms.CheckBox();
69 | this.tabControl1.SuspendLayout();
70 | this.tabPage1.SuspendLayout();
71 | this.groupBox1.SuspendLayout();
72 | this.SuspendLayout();
73 | //
74 | // checkBox3
75 | //
76 | this.checkBox3.AutoSize = true;
77 | this.checkBox3.BackColor = System.Drawing.Color.Transparent;
78 | this.checkBox3.Location = new System.Drawing.Point(6, 42);
79 | this.checkBox3.Name = "checkBox3";
80 | this.checkBox3.Size = new System.Drawing.Size(93, 17);
81 | this.checkBox3.TabIndex = 26;
82 | this.checkBox3.Text = "&Resize Image:";
83 | this.checkBox3.UseVisualStyleBackColor = false;
84 | this.checkBox3.CheckedChanged += new System.EventHandler(this.Ripper_ScaleOptions_CheckedStateChanged);
85 | //
86 | // checkBox1
87 | //
88 | this.checkBox1.AutoSize = true;
89 | this.checkBox1.BackColor = System.Drawing.Color.Transparent;
90 | this.checkBox1.Location = new System.Drawing.Point(6, 19);
91 | this.checkBox1.Name = "checkBox1";
92 | this.checkBox1.Size = new System.Drawing.Size(125, 17);
93 | this.checkBox1.TabIndex = 29;
94 | this.checkBox1.Text = "&Accurate Conversion";
95 | this.checkBox1.UseVisualStyleBackColor = false;
96 | this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
97 | //
98 | // checkBox4
99 | //
100 | this.checkBox4.AutoSize = true;
101 | this.checkBox4.Location = new System.Drawing.Point(214, 19);
102 | this.checkBox4.Name = "checkBox4";
103 | this.checkBox4.Size = new System.Drawing.Size(95, 17);
104 | this.checkBox4.TabIndex = 36;
105 | this.checkBox4.Text = "Arrange &Colors";
106 | this.checkBox4.UseVisualStyleBackColor = true;
107 | this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged);
108 | //
109 | // openFileDialog1
110 | //
111 | this.openFileDialog1.Filter = "Images (*.bmp;*.png;*.jpg;*.jpeg;*.tif;*.tiff;*.gif)|*.bmp;*.png;*.jpg;*.jpeg;*.t" +
112 | "if;*.tiff;*.gif|All Files (*.*)|*.*";
113 | this.openFileDialog1.Multiselect = true;
114 | this.openFileDialog1.RestoreDirectory = true;
115 | this.openFileDialog1.Title = "Search";
116 | //
117 | // button5
118 | //
119 | this.button5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
120 | this.button5.Enabled = false;
121 | this.button5.Font = new System.Drawing.Font("Calibri", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
122 | this.button5.Location = new System.Drawing.Point(13, 256);
123 | this.button5.Name = "button5";
124 | this.button5.Size = new System.Drawing.Size(114, 36);
125 | this.button5.TabIndex = 31;
126 | this.button5.Text = "&Preview";
127 | this.button5.UseVisualStyleBackColor = true;
128 | this.button5.Click += new System.EventHandler(this.button5_Click);
129 | //
130 | // button2
131 | //
132 | this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
133 | this.button2.Enabled = false;
134 | this.button2.Font = new System.Drawing.Font("Calibri", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
135 | this.button2.Location = new System.Drawing.Point(351, 256);
136 | this.button2.Name = "button2";
137 | this.button2.Size = new System.Drawing.Size(114, 36);
138 | this.button2.TabIndex = 28;
139 | this.button2.Text = "&Save";
140 | this.button2.UseVisualStyleBackColor = true;
141 | this.button2.Click += new System.EventHandler(this.button2_Click);
142 | //
143 | // comboBox2
144 | //
145 | this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
146 | this.comboBox2.FormattingEnabled = true;
147 | this.comboBox2.Location = new System.Drawing.Point(328, 39);
148 | this.comboBox2.Name = "comboBox2";
149 | this.comboBox2.Size = new System.Drawing.Size(135, 21);
150 | this.comboBox2.TabIndex = 24;
151 | //
152 | // label3
153 | //
154 | this.label3.AutoSize = true;
155 | this.label3.BackColor = System.Drawing.Color.Transparent;
156 | this.label3.ForeColor = System.Drawing.SystemColors.WindowText;
157 | this.label3.Location = new System.Drawing.Point(278, 42);
158 | this.label3.Name = "label3";
159 | this.label3.Size = new System.Drawing.Size(39, 13);
160 | this.label3.TabIndex = 23;
161 | this.label3.Text = "Colors:";
162 | //
163 | // comboBox1
164 | //
165 | this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
166 | this.comboBox1.FormattingEnabled = true;
167 | this.comboBox1.Location = new System.Drawing.Point(61, 39);
168 | this.comboBox1.Name = "comboBox1";
169 | this.comboBox1.Size = new System.Drawing.Size(211, 21);
170 | this.comboBox1.TabIndex = 22;
171 | this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.Ripper_ChangeCodec);
172 | //
173 | // label2
174 | //
175 | this.label2.AutoSize = true;
176 | this.label2.BackColor = System.Drawing.Color.Transparent;
177 | this.label2.ForeColor = System.Drawing.SystemColors.WindowText;
178 | this.label2.Location = new System.Drawing.Point(8, 42);
179 | this.label2.Name = "label2";
180 | this.label2.Size = new System.Drawing.Size(42, 13);
181 | this.label2.TabIndex = 21;
182 | this.label2.Text = "Format:";
183 | //
184 | // button1
185 | //
186 | this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
187 | this.button1.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
188 | this.button1.Location = new System.Drawing.Point(390, 7);
189 | this.button1.Name = "button1";
190 | this.button1.Size = new System.Drawing.Size(75, 23);
191 | this.button1.TabIndex = 20;
192 | this.button1.Text = "&Browse...";
193 | this.button1.UseVisualStyleBackColor = true;
194 | this.button1.Click += new System.EventHandler(this.ShowDialog1);
195 | //
196 | // label1
197 | //
198 | this.label1.AutoSize = true;
199 | this.label1.BackColor = System.Drawing.Color.Transparent;
200 | this.label1.Location = new System.Drawing.Point(8, 11);
201 | this.label1.Name = "label1";
202 | this.label1.Size = new System.Drawing.Size(39, 13);
203 | this.label1.TabIndex = 19;
204 | this.label1.Text = "Image:";
205 | //
206 | // textBox1
207 | //
208 | this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
209 | | System.Windows.Forms.AnchorStyles.Right)));
210 | this.textBox1.Location = new System.Drawing.Point(61, 8);
211 | this.textBox1.Name = "textBox1";
212 | this.textBox1.Size = new System.Drawing.Size(323, 20);
213 | this.textBox1.TabIndex = 18;
214 | this.textBox1.Click += new System.EventHandler(this.ShowDialog1);
215 | //
216 | // textBox2
217 | //
218 | this.textBox2.CharacterCasing = System.Windows.Forms.CharacterCasing.Lower;
219 | this.textBox2.Enabled = false;
220 | this.textBox2.Location = new System.Drawing.Point(123, 40);
221 | this.textBox2.MaxLength = 3;
222 | this.textBox2.Name = "textBox2";
223 | this.textBox2.Size = new System.Drawing.Size(24, 20);
224 | this.textBox2.TabIndex = 34;
225 | this.textBox2.Text = "100";
226 | this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
227 | this.textBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox2_KeyPress);
228 | //
229 | // label5
230 | //
231 | this.label5.BackColor = System.Drawing.Color.Transparent;
232 | this.label5.Location = new System.Drawing.Point(146, 40);
233 | this.label5.Name = "label5";
234 | this.label5.Size = new System.Drawing.Size(35, 20);
235 | this.label5.TabIndex = 35;
236 | this.label5.Text = "%";
237 | this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
238 | //
239 | // tabControl1
240 | //
241 | this.tabControl1.Controls.Add(this.tabPage1);
242 | this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
243 | this.tabControl1.Location = new System.Drawing.Point(0, 0);
244 | this.tabControl1.Name = "tabControl1";
245 | this.tabControl1.SelectedIndex = 0;
246 | this.tabControl1.Size = new System.Drawing.Size(479, 329);
247 | this.tabControl1.TabIndex = 36;
248 | //
249 | // tabPage1
250 | //
251 | this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
252 | this.tabPage1.Controls.Add(this.label6);
253 | this.tabPage1.Controls.Add(this.label4);
254 | this.tabPage1.Controls.Add(this.comboBox5);
255 | this.tabPage1.Controls.Add(this.comboBox4);
256 | this.tabPage1.Controls.Add(this.button3);
257 | this.tabPage1.Controls.Add(this.groupBox1);
258 | this.tabPage1.Controls.Add(this.button5);
259 | this.tabPage1.Controls.Add(this.label1);
260 | this.tabPage1.Controls.Add(this.button2);
261 | this.tabPage1.Controls.Add(this.textBox1);
262 | this.tabPage1.Controls.Add(this.button1);
263 | this.tabPage1.Controls.Add(this.label2);
264 | this.tabPage1.Controls.Add(this.comboBox1);
265 | this.tabPage1.Controls.Add(this.comboBox2);
266 | this.tabPage1.Controls.Add(this.label3);
267 | this.tabPage1.Location = new System.Drawing.Point(4, 22);
268 | this.tabPage1.Name = "tabPage1";
269 | this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
270 | this.tabPage1.Size = new System.Drawing.Size(471, 303);
271 | this.tabPage1.TabIndex = 0;
272 | this.tabPage1.Text = "Graphics Ripper";
273 | //
274 | // label6
275 | //
276 | this.label6.AutoSize = true;
277 | this.label6.BackColor = System.Drawing.Color.Transparent;
278 | this.label6.ForeColor = System.Drawing.SystemColors.WindowText;
279 | this.label6.Location = new System.Drawing.Point(278, 69);
280 | this.label6.Name = "label6";
281 | this.label6.Size = new System.Drawing.Size(43, 13);
282 | this.label6.TabIndex = 40;
283 | this.label6.Text = "Palette:";
284 | //
285 | // label4
286 | //
287 | this.label4.AutoSize = true;
288 | this.label4.BackColor = System.Drawing.Color.Transparent;
289 | this.label4.ForeColor = System.Drawing.SystemColors.WindowText;
290 | this.label4.Location = new System.Drawing.Point(8, 69);
291 | this.label4.Name = "label4";
292 | this.label4.Size = new System.Drawing.Size(47, 13);
293 | this.label4.TabIndex = 39;
294 | this.label4.Text = "Tilemap:";
295 | //
296 | // comboBox5
297 | //
298 | this.comboBox5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
299 | this.comboBox5.FormattingEnabled = true;
300 | this.comboBox5.Items.AddRange(new object[] {
301 | "YY-CHR Palette",
302 | "Tile Layer Pro Palette",
303 | "Mario World Palette",
304 | "RAW SNES/ASM",
305 | "RAW SNES/BIN",
306 | "No Palette Output"});
307 | this.comboBox5.Location = new System.Drawing.Point(328, 66);
308 | this.comboBox5.Name = "comboBox5";
309 | this.comboBox5.Size = new System.Drawing.Size(135, 21);
310 | this.comboBox5.TabIndex = 38;
311 | this.comboBox5.SelectedIndexChanged += new System.EventHandler(this.comboBox5_SelectedIndexChanged);
312 | //
313 | // comboBox4
314 | //
315 | this.comboBox4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
316 | this.comboBox4.FormattingEnabled = true;
317 | this.comboBox4.Items.AddRange(new object[] {
318 | "Output Map16",
319 | "Output Map16+MWL",
320 | "Output SNES Tilemap",
321 | "Output Mode 7 Tilemap",
322 | "Output Interleaved Mode 7 Tilemap",
323 | "No Tilemap Output"});
324 | this.comboBox4.Location = new System.Drawing.Point(61, 66);
325 | this.comboBox4.Name = "comboBox4";
326 | this.comboBox4.Size = new System.Drawing.Size(211, 21);
327 | this.comboBox4.TabIndex = 37;
328 | this.comboBox4.SelectedIndexChanged += new System.EventHandler(this.comboBox4_SelectedIndexChanged);
329 | //
330 | // button3
331 | //
332 | this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
333 | | System.Windows.Forms.AnchorStyles.Right)));
334 | this.button3.Enabled = false;
335 | this.button3.Location = new System.Drawing.Point(169, 264);
336 | this.button3.Name = "button3";
337 | this.button3.Size = new System.Drawing.Size(140, 25);
338 | this.button3.TabIndex = 0;
339 | this.button3.Text = "Count Nu&mber of Colors";
340 | this.button3.UseVisualStyleBackColor = true;
341 | this.button3.Click += new System.EventHandler(this.button3_Click);
342 | //
343 | // groupBox1
344 | //
345 | this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
346 | | System.Windows.Forms.AnchorStyles.Left)
347 | | System.Windows.Forms.AnchorStyles.Right)));
348 | this.groupBox1.Controls.Add(this.domainUpDown2);
349 | this.groupBox1.Controls.Add(this.checkBox12);
350 | this.groupBox1.Controls.Add(this.checkBox11);
351 | this.groupBox1.Controls.Add(this.domainUpDown1);
352 | this.groupBox1.Controls.Add(this.button7);
353 | this.groupBox1.Controls.Add(this.checkBox10);
354 | this.groupBox1.Controls.Add(this.checkBox9);
355 | this.groupBox1.Controls.Add(this.button6);
356 | this.groupBox1.Controls.Add(this.button4);
357 | this.groupBox1.Controls.Add(this.checkBox7);
358 | this.groupBox1.Controls.Add(this.checkBox8);
359 | this.groupBox1.Controls.Add(this.comboBox3);
360 | this.groupBox1.Controls.Add(this.checkBox6);
361 | this.groupBox1.Controls.Add(this.checkBox5);
362 | this.groupBox1.Controls.Add(this.checkBox2);
363 | this.groupBox1.Controls.Add(this.checkBox4);
364 | this.groupBox1.Controls.Add(this.checkBox1);
365 | this.groupBox1.Controls.Add(this.checkBox3);
366 | this.groupBox1.Controls.Add(this.textBox2);
367 | this.groupBox1.Controls.Add(this.label5);
368 | this.groupBox1.Location = new System.Drawing.Point(11, 93);
369 | this.groupBox1.Name = "groupBox1";
370 | this.groupBox1.Size = new System.Drawing.Size(452, 157);
371 | this.groupBox1.TabIndex = 36;
372 | this.groupBox1.TabStop = false;
373 | this.groupBox1.Text = "Options";
374 | //
375 | // domainUpDown2
376 | //
377 | this.domainUpDown2.Location = new System.Drawing.Point(358, 130);
378 | this.domainUpDown2.Name = "domainUpDown2";
379 | this.domainUpDown2.Size = new System.Drawing.Size(56, 20);
380 | this.domainUpDown2.TabIndex = 50;
381 | this.domainUpDown2.SelectedItemChanged += new System.EventHandler(this.domainUpDown2_SelectedItemChanged);
382 | //
383 | // checkBox12
384 | //
385 | this.checkBox12.AutoSize = true;
386 | this.checkBox12.Location = new System.Drawing.Point(214, 131);
387 | this.checkBox12.Name = "checkBox12";
388 | this.checkBox12.Size = new System.Drawing.Size(120, 17);
389 | this.checkBox12.TabIndex = 49;
390 | this.checkBox12.Text = "Set Starting Palette:";
391 | this.checkBox12.UseVisualStyleBackColor = true;
392 | this.checkBox12.CheckedChanged += new System.EventHandler(this.checkBox12_CheckedChanged);
393 | //
394 | // checkBox11
395 | //
396 | this.checkBox11.AutoSize = true;
397 | this.checkBox11.Location = new System.Drawing.Point(6, 131);
398 | this.checkBox11.Name = "checkBox11";
399 | this.checkBox11.Size = new System.Drawing.Size(82, 17);
400 | this.checkBox11.TabIndex = 48;
401 | this.checkBox11.Text = "Offset Tiles:";
402 | this.checkBox11.UseVisualStyleBackColor = true;
403 | this.checkBox11.CheckedChanged += new System.EventHandler(this.checkBox11_CheckedChanged);
404 | //
405 | // domainUpDown1
406 | //
407 | this.domainUpDown1.Location = new System.Drawing.Point(130, 130);
408 | this.domainUpDown1.Name = "domainUpDown1";
409 | this.domainUpDown1.Size = new System.Drawing.Size(56, 20);
410 | this.domainUpDown1.TabIndex = 43;
411 | this.domainUpDown1.SelectedItemChanged += new System.EventHandler(this.domainUpDown1_SelectedItemChanged);
412 | this.domainUpDown1.TextChanged += new System.EventHandler(this.domainUpDown1_SelectedItemChanged);
413 | //
414 | // button7
415 | //
416 | this.button7.Enabled = false;
417 | this.button7.Location = new System.Drawing.Point(120, 105);
418 | this.button7.Name = "button7";
419 | this.button7.Size = new System.Drawing.Size(66, 20);
420 | this.button7.TabIndex = 47;
421 | this.button7.Text = "Settings";
422 | this.button7.UseVisualStyleBackColor = true;
423 | this.button7.Click += new System.EventHandler(this.button7_Click);
424 | //
425 | // checkBox10
426 | //
427 | this.checkBox10.AutoSize = true;
428 | this.checkBox10.Location = new System.Drawing.Point(6, 108);
429 | this.checkBox10.Name = "checkBox10";
430 | this.checkBox10.Size = new System.Drawing.Size(108, 17);
431 | this.checkBox10.TabIndex = 46;
432 | this.checkBox10.Text = "CGADSUB Mode";
433 | this.checkBox10.UseVisualStyleBackColor = true;
434 | this.checkBox10.CheckedChanged += new System.EventHandler(this.checkBox10_CheckedChanged);
435 | //
436 | // checkBox9
437 | //
438 | this.checkBox9.AutoSize = true;
439 | this.checkBox9.Location = new System.Drawing.Point(214, 65);
440 | this.checkBox9.Name = "checkBox9";
441 | this.checkBox9.Size = new System.Drawing.Size(128, 17);
442 | this.checkBox9.TabIndex = 45;
443 | this.checkBox9.Text = "Remove &Flipped Tiles";
444 | this.checkBox9.UseVisualStyleBackColor = true;
445 | this.checkBox9.CheckedChanged += new System.EventHandler(this.checkBox9_CheckedChanged);
446 | //
447 | // button6
448 | //
449 | this.button6.Enabled = false;
450 | this.button6.Location = new System.Drawing.Point(348, 16);
451 | this.button6.Name = "button6";
452 | this.button6.Size = new System.Drawing.Size(66, 20);
453 | this.button6.TabIndex = 44;
454 | this.button6.Text = "Settin&gs";
455 | this.button6.UseVisualStyleBackColor = true;
456 | this.button6.Click += new System.EventHandler(this.button6_Click);
457 | //
458 | // button4
459 | //
460 | this.button4.Enabled = false;
461 | this.button4.Location = new System.Drawing.Point(348, 108);
462 | this.button4.Name = "button4";
463 | this.button4.Size = new System.Drawing.Size(66, 20);
464 | this.button4.TabIndex = 43;
465 | this.button4.Text = "Settings";
466 | this.button4.UseVisualStyleBackColor = true;
467 | this.button4.Click += new System.EventHandler(this.button4_Click);
468 | //
469 | // checkBox7
470 | //
471 | this.checkBox7.AutoSize = true;
472 | this.checkBox7.Location = new System.Drawing.Point(214, 111);
473 | this.checkBox7.Name = "checkBox7";
474 | this.checkBox7.Size = new System.Drawing.Size(128, 17);
475 | this.checkBox7.TabIndex = 42;
476 | this.checkBox7.Text = "Handle &Transparency";
477 | this.checkBox7.UseVisualStyleBackColor = true;
478 | this.checkBox7.CheckedChanged += new System.EventHandler(this.checkBox7_CheckedChanged);
479 | //
480 | // checkBox8
481 | //
482 | this.checkBox8.AutoSize = true;
483 | this.checkBox8.Location = new System.Drawing.Point(6, 88);
484 | this.checkBox8.Name = "checkBox8";
485 | this.checkBox8.Size = new System.Drawing.Size(137, 17);
486 | this.checkBox8.TabIndex = 41;
487 | this.checkBox8.Text = "Save on Image\'s &Folder";
488 | this.checkBox8.UseVisualStyleBackColor = true;
489 | this.checkBox8.CheckedChanged += new System.EventHandler(this.checkBox8_CheckedChanged);
490 | //
491 | // comboBox3
492 | //
493 | this.comboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
494 | this.comboBox3.Enabled = false;
495 | this.comboBox3.FormattingEnabled = true;
496 | this.comboBox3.Items.AddRange(new object[] {
497 | "512 bytes",
498 | "1 KiB",
499 | "2 KiB",
500 | "4 KiB",
501 | "8 KiB",
502 | "16 KiB",
503 | "32 KiB"});
504 | this.comboBox3.Location = new System.Drawing.Point(269, 86);
505 | this.comboBox3.Name = "comboBox3";
506 | this.comboBox3.Size = new System.Drawing.Size(127, 21);
507 | this.comboBox3.TabIndex = 37;
508 | this.comboBox3.SelectedIndexChanged += new System.EventHandler(this.comboBox3_SelectedIndexChanged);
509 | //
510 | // checkBox6
511 | //
512 | this.checkBox6.AutoSize = true;
513 | this.checkBox6.Location = new System.Drawing.Point(214, 88);
514 | this.checkBox6.Name = "checkBox6";
515 | this.checkBox6.Size = new System.Drawing.Size(49, 17);
516 | this.checkBox6.TabIndex = 39;
517 | this.checkBox6.Text = "Spli&t:";
518 | this.checkBox6.UseVisualStyleBackColor = true;
519 | this.checkBox6.CheckedChanged += new System.EventHandler(this.checkBox6_CheckedChanged);
520 | //
521 | // checkBox5
522 | //
523 | this.checkBox5.AutoSize = true;
524 | this.checkBox5.Location = new System.Drawing.Point(6, 65);
525 | this.checkBox5.Name = "checkBox5";
526 | this.checkBox5.Size = new System.Drawing.Size(98, 17);
527 | this.checkBox5.TabIndex = 38;
528 | this.checkBox5.Text = "&Optimize Image";
529 | this.checkBox5.UseVisualStyleBackColor = true;
530 | this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged);
531 | //
532 | // checkBox2
533 | //
534 | this.checkBox2.AutoSize = true;
535 | this.checkBox2.Location = new System.Drawing.Point(214, 42);
536 | this.checkBox2.Name = "checkBox2";
537 | this.checkBox2.Size = new System.Drawing.Size(145, 17);
538 | this.checkBox2.TabIndex = 37;
539 | this.checkBox2.Text = "Remove &Duplicated Tiles";
540 | this.checkBox2.UseVisualStyleBackColor = true;
541 | this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
542 | //
543 | // Main
544 | //
545 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
546 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
547 | this.ClientSize = new System.Drawing.Size(479, 329);
548 | this.Controls.Add(this.tabControl1);
549 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
550 | this.MaximizeBox = false;
551 | this.Name = "Main";
552 | this.Text = "SnesGFX v2.62";
553 | this.Load += new System.EventHandler(this.Main_Load);
554 | this.tabControl1.ResumeLayout(false);
555 | this.tabPage1.ResumeLayout(false);
556 | this.tabPage1.PerformLayout();
557 | this.groupBox1.ResumeLayout(false);
558 | this.groupBox1.PerformLayout();
559 | this.ResumeLayout(false);
560 |
561 | }
562 |
563 | #endregion
564 |
565 | private System.Windows.Forms.OpenFileDialog openFileDialog1;
566 | private System.Windows.Forms.Button button5;
567 | private System.Windows.Forms.CheckBox checkBox1;
568 | private System.Windows.Forms.Button button2;
569 | private System.Windows.Forms.CheckBox checkBox3;
570 | private System.Windows.Forms.ComboBox comboBox2;
571 | private System.Windows.Forms.Label label3;
572 | private System.Windows.Forms.ComboBox comboBox1;
573 | private System.Windows.Forms.Label label2;
574 | private System.Windows.Forms.Button button1;
575 | private System.Windows.Forms.Label label1;
576 | private System.Windows.Forms.TextBox textBox1;
577 | private System.Windows.Forms.TextBox textBox2;
578 | private System.Windows.Forms.Label label5;
579 | private System.Windows.Forms.TabControl tabControl1;
580 | private System.Windows.Forms.TabPage tabPage1;
581 | private System.Windows.Forms.GroupBox groupBox1;
582 | private System.Windows.Forms.CheckBox checkBox4;
583 | private System.Windows.Forms.CheckBox checkBox5;
584 | private System.Windows.Forms.CheckBox checkBox2;
585 | private System.Windows.Forms.Button button3;
586 | private System.Windows.Forms.ComboBox comboBox3;
587 | private System.Windows.Forms.CheckBox checkBox6;
588 | private System.Windows.Forms.CheckBox checkBox8;
589 | private System.Windows.Forms.Label label6;
590 | private System.Windows.Forms.Label label4;
591 | private System.Windows.Forms.ComboBox comboBox5;
592 | private System.Windows.Forms.ComboBox comboBox4;
593 | private System.Windows.Forms.CheckBox checkBox7;
594 | private System.Windows.Forms.Button button4;
595 | private System.Windows.Forms.Button button6;
596 | private System.Windows.Forms.CheckBox checkBox9;
597 | private System.Windows.Forms.CheckBox checkBox10;
598 | private System.Windows.Forms.Button button7;
599 | private System.Windows.Forms.DomainUpDown domainUpDown1;
600 | private System.Windows.Forms.DomainUpDown domainUpDown2;
601 | private System.Windows.Forms.CheckBox checkBox12;
602 | private System.Windows.Forms.CheckBox checkBox11;
603 |
604 | }
605 | }
606 |
607 |
--------------------------------------------------------------------------------
/Forms/Main.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 12, 7
122 |
123 |
--------------------------------------------------------------------------------
/Forms/Preview.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace SnesGFX.Forms
2 | {
3 | partial class Preview
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
32 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // pictureBox1
36 | //
37 | this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
38 | this.pictureBox1.Location = new System.Drawing.Point(0, 0);
39 | this.pictureBox1.Name = "pictureBox1";
40 | this.pictureBox1.Size = new System.Drawing.Size(284, 262);
41 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
42 | this.pictureBox1.TabIndex = 0;
43 | this.pictureBox1.TabStop = false;
44 | //
45 | // Form2
46 | //
47 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
48 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
49 | this.ClientSize = new System.Drawing.Size(284, 262);
50 | this.Controls.Add(this.pictureBox1);
51 | this.DoubleBuffered = true;
52 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
53 | this.MinimumSize = new System.Drawing.Size(128, 128);
54 | this.Name = "Form2";
55 | this.ShowIcon = false;
56 | this.ShowInTaskbar = false;
57 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
58 | this.Text = "Preview";
59 | this.SizeChanged += new System.EventHandler(this.ViewBase_SizeChanged);
60 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
61 | this.ResumeLayout(false);
62 | this.PerformLayout();
63 |
64 | }
65 |
66 | #endregion
67 |
68 | private System.Windows.Forms.PictureBox pictureBox1;
69 | }
70 | }
--------------------------------------------------------------------------------
/Forms/Preview.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Windows.Forms;
4 |
5 | namespace SnesGFX.Forms
6 | {
7 | public partial class Preview : Form
8 | {
9 | private Bitmap bitmap;
10 |
11 | public Bitmap CurrrentImage
12 | {
13 | get
14 | {
15 | return bitmap;
16 | }
17 |
18 | set
19 | {
20 | this.bitmap = value;
21 | this.pictureBox1.Image = Program.ScaleRatio(value, pictureBox1.ClientSize);
22 | }
23 | }
24 |
25 | public Preview(Bitmap bitmap, Size size)
26 | {
27 | InitializeComponent();
28 | this.bitmap = bitmap;
29 | this.ClientSize = size;
30 | }
31 |
32 | private void ViewBase_SizeChanged(object sender, EventArgs e)
33 | {
34 | if (bitmap != null)
35 | {
36 | pictureBox1.Image = Program.ScaleRatio(bitmap, pictureBox1.ClientSize);
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Forms/Preview.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Forms/TranslucencySettings.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace SnesGFX.Forms
2 | {
3 | partial class TranslucencySettings
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.groupBox1 = new System.Windows.Forms.GroupBox();
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.label2 = new System.Windows.Forms.Label();
34 | this.textBox1 = new System.Windows.Forms.TextBox();
35 | this.textBox2 = new System.Windows.Forms.TextBox();
36 | this.groupBox1.SuspendLayout();
37 | this.SuspendLayout();
38 | //
39 | // groupBox1
40 | //
41 | this.groupBox1.Controls.Add(this.textBox2);
42 | this.groupBox1.Controls.Add(this.textBox1);
43 | this.groupBox1.Controls.Add(this.label2);
44 | this.groupBox1.Controls.Add(this.label1);
45 | this.groupBox1.Location = new System.Drawing.Point(12, 12);
46 | this.groupBox1.Name = "groupBox1";
47 | this.groupBox1.Size = new System.Drawing.Size(189, 71);
48 | this.groupBox1.TabIndex = 0;
49 | this.groupBox1.TabStop = false;
50 | //
51 | // label1
52 | //
53 | this.label1.AutoSize = true;
54 | this.label1.Location = new System.Drawing.Point(3, 16);
55 | this.label1.Name = "label1";
56 | this.label1.Size = new System.Drawing.Size(137, 13);
57 | this.label1.TabIndex = 0;
58 | this.label1.Text = "Max. Transparency [0-255]:";
59 | //
60 | // label2
61 | //
62 | this.label2.AutoSize = true;
63 | this.label2.Location = new System.Drawing.Point(6, 40);
64 | this.label2.Name = "label2";
65 | this.label2.Size = new System.Drawing.Size(82, 13);
66 | this.label2.TabIndex = 1;
67 | this.label2.Text = "Tolerance [1-8]:";
68 | //
69 | // textBox1
70 | //
71 | this.textBox1.Location = new System.Drawing.Point(146, 13);
72 | this.textBox1.MaxLength = 3;
73 | this.textBox1.Name = "textBox1";
74 | this.textBox1.Size = new System.Drawing.Size(33, 20);
75 | this.textBox1.TabIndex = 2;
76 | this.textBox1.Text = "224";
77 | this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
78 | //
79 | // textBox2
80 | //
81 | this.textBox2.Location = new System.Drawing.Point(146, 40);
82 | this.textBox2.MaxLength = 1;
83 | this.textBox2.Name = "textBox2";
84 | this.textBox2.Size = new System.Drawing.Size(33, 20);
85 | this.textBox2.TabIndex = 3;
86 | this.textBox2.Text = "2";
87 | this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
88 | //
89 | // Form6
90 | //
91 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
92 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
93 | this.ClientSize = new System.Drawing.Size(211, 97);
94 | this.Controls.Add(this.groupBox1);
95 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
96 | this.MaximizeBox = false;
97 | this.MinimizeBox = false;
98 | this.Name = "Form6";
99 | this.ShowInTaskbar = false;
100 | this.Text = "CGADSUB Settings";
101 | this.groupBox1.ResumeLayout(false);
102 | this.groupBox1.PerformLayout();
103 | this.ResumeLayout(false);
104 |
105 | }
106 |
107 | #endregion
108 |
109 | private System.Windows.Forms.GroupBox groupBox1;
110 | private System.Windows.Forms.TextBox textBox2;
111 | private System.Windows.Forms.TextBox textBox1;
112 | private System.Windows.Forms.Label label2;
113 | private System.Windows.Forms.Label label1;
114 | }
115 | }
--------------------------------------------------------------------------------
/Forms/TranslucencySettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace SnesGFX.Forms
10 | {
11 | public partial class TranslucencySettings : Form
12 | {
13 | public TranslucencySettings()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | private void textBox1_TextChanged(object sender, EventArgs e)
19 | {
20 | try
21 | {
22 | Program.maxCgasubTransparency = byte.Parse(textBox1.Text);
23 | textBox1.BackColor = SystemColors.Window;
24 | }
25 | catch
26 | {
27 | textBox1.BackColor = Color.Orange;
28 | Program.maxCgasubTransparency = 224;
29 | }
30 | }
31 |
32 | private void textBox2_TextChanged(object sender, EventArgs e)
33 | {
34 | try
35 | {
36 | Program.cgadsubTolerance = byte.Parse(textBox2.Text);
37 | textBox2.BackColor = SystemColors.Window;
38 | if (Program.cgadsubTolerance < 1 || Program.cgadsubTolerance > 8) throw new Exception();
39 | }
40 | catch
41 | {
42 | textBox2.BackColor = Color.Orange;
43 | Program.cgadsubTolerance = 2;
44 | }
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Forms/TranslucencySettings.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Forms/TransparencySettings.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace SnesGFX.Forms
2 | {
3 | partial class TransparencySettings
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.radioButton1 = new System.Windows.Forms.RadioButton();
32 | this.radioButton2 = new System.Windows.Forms.RadioButton();
33 | this.radioButton3 = new System.Windows.Forms.RadioButton();
34 | this.radioButton4 = new System.Windows.Forms.RadioButton();
35 | this.radioButton5 = new System.Windows.Forms.RadioButton();
36 | this.button1 = new System.Windows.Forms.Button();
37 | this.colorDialog1 = new System.Windows.Forms.ColorDialog();
38 | this.groupBox1 = new System.Windows.Forms.GroupBox();
39 | this.groupBox1.SuspendLayout();
40 | this.SuspendLayout();
41 | //
42 | // radioButton1
43 | //
44 | this.radioButton1.Location = new System.Drawing.Point(6, 19);
45 | this.radioButton1.Name = "radioButton1";
46 | this.radioButton1.Size = new System.Drawing.Size(169, 17);
47 | this.radioButton1.TabIndex = 0;
48 | this.radioButton1.TabStop = true;
49 | this.radioButton1.Tag = "0";
50 | this.radioButton1.Text = "First pixel";
51 | this.radioButton1.UseVisualStyleBackColor = true;
52 | //
53 | // radioButton2
54 | //
55 | this.radioButton2.Location = new System.Drawing.Point(6, 42);
56 | this.radioButton2.Name = "radioButton2";
57 | this.radioButton2.Size = new System.Drawing.Size(169, 17);
58 | this.radioButton2.TabIndex = 1;
59 | this.radioButton2.TabStop = true;
60 | this.radioButton2.Tag = "1";
61 | this.radioButton2.Text = "Last pixel";
62 | this.radioButton2.UseVisualStyleBackColor = true;
63 | //
64 | // radioButton3
65 | //
66 | this.radioButton3.Location = new System.Drawing.Point(6, 65);
67 | this.radioButton3.Name = "radioButton3";
68 | this.radioButton3.Size = new System.Drawing.Size(169, 17);
69 | this.radioButton3.TabIndex = 2;
70 | this.radioButton3.TabStop = true;
71 | this.radioButton3.Tag = "2";
72 | this.radioButton3.Text = "Transparent 1 (#00000000)";
73 | this.radioButton3.UseVisualStyleBackColor = true;
74 | //
75 | // radioButton4
76 | //
77 | this.radioButton4.Location = new System.Drawing.Point(6, 88);
78 | this.radioButton4.Name = "radioButton4";
79 | this.radioButton4.Size = new System.Drawing.Size(169, 17);
80 | this.radioButton4.TabIndex = 3;
81 | this.radioButton4.TabStop = true;
82 | this.radioButton4.Tag = "3";
83 | this.radioButton4.Text = "Transparent 2 (#00FFFFFF)";
84 | this.radioButton4.UseVisualStyleBackColor = true;
85 | //
86 | // radioButton5
87 | //
88 | this.radioButton5.Location = new System.Drawing.Point(6, 111);
89 | this.radioButton5.Name = "radioButton5";
90 | this.radioButton5.Size = new System.Drawing.Size(169, 17);
91 | this.radioButton5.TabIndex = 4;
92 | this.radioButton5.TabStop = true;
93 | this.radioButton5.Tag = "4";
94 | this.radioButton5.Text = "Other:";
95 | this.radioButton5.UseVisualStyleBackColor = true;
96 | //
97 | // button1
98 | //
99 | this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
100 | this.button1.Location = new System.Drawing.Point(66, 108);
101 | this.button1.Name = "button1";
102 | this.button1.Size = new System.Drawing.Size(75, 23);
103 | this.button1.TabIndex = 5;
104 | this.button1.Text = "Black";
105 | this.button1.UseVisualStyleBackColor = true;
106 | this.button1.Click += new System.EventHandler(this.button1_Click);
107 | //
108 | // colorDialog1
109 | //
110 | this.colorDialog1.FullOpen = true;
111 | //
112 | // groupBox1
113 | //
114 | this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
115 | | System.Windows.Forms.AnchorStyles.Left)
116 | | System.Windows.Forms.AnchorStyles.Right)));
117 | this.groupBox1.Controls.Add(this.radioButton1);
118 | this.groupBox1.Controls.Add(this.button1);
119 | this.groupBox1.Controls.Add(this.radioButton2);
120 | this.groupBox1.Controls.Add(this.radioButton5);
121 | this.groupBox1.Controls.Add(this.radioButton3);
122 | this.groupBox1.Controls.Add(this.radioButton4);
123 | this.groupBox1.Location = new System.Drawing.Point(12, 12);
124 | this.groupBox1.Name = "groupBox1";
125 | this.groupBox1.Size = new System.Drawing.Size(181, 147);
126 | this.groupBox1.TabIndex = 6;
127 | this.groupBox1.TabStop = false;
128 | //
129 | // Form3
130 | //
131 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
132 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
133 | this.ClientSize = new System.Drawing.Size(205, 171);
134 | this.Controls.Add(this.groupBox1);
135 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
136 | this.MaximizeBox = false;
137 | this.MinimizeBox = false;
138 | this.Name = "Form3";
139 | this.ShowInTaskbar = false;
140 | this.Text = "Transparency Settings";
141 | this.groupBox1.ResumeLayout(false);
142 | this.ResumeLayout(false);
143 |
144 | }
145 |
146 | #endregion
147 |
148 | private System.Windows.Forms.RadioButton radioButton1;
149 | private System.Windows.Forms.RadioButton radioButton2;
150 | private System.Windows.Forms.RadioButton radioButton3;
151 | private System.Windows.Forms.RadioButton radioButton4;
152 | private System.Windows.Forms.RadioButton radioButton5;
153 | private System.Windows.Forms.Button button1;
154 | private System.Windows.Forms.ColorDialog colorDialog1;
155 | private System.Windows.Forms.GroupBox groupBox1;
156 | }
157 | }
--------------------------------------------------------------------------------
/Forms/TransparencySettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace SnesGFX.Forms
10 | {
11 | public partial class TransparencySettings : Form
12 | {
13 | public TransparencySettings()
14 | {
15 | InitializeComponent();
16 | setColor(Program.customTransparent);
17 |
18 | foreach (Control c in this.Controls[0].Controls)
19 | {
20 | if (c is RadioButton)
21 | {
22 | int i = int.Parse((string)((RadioButton)c).Tag);
23 | if (i == Program.colorMode)
24 | {
25 | (c as RadioButton).Checked = true;
26 | }
27 |
28 | c.Click += new EventHandler(c_Click);
29 | }
30 | }
31 | }
32 |
33 | void c_Click(object sender, EventArgs e)
34 | {
35 | Program.colorMode = int.Parse((string)((RadioButton)sender).Tag);
36 | Program.customTransparent = button1.BackColor;
37 | }
38 |
39 | void setColor(Color color)
40 | {
41 | button1.BackColor = color;
42 | button1.ForeColor = Color.FromArgb(color.ToArgb() ^ 0xFFFFFF);
43 | button1.Text = color.IsKnownColor ? color.Name : "#" + (color.ToArgb() & 0xFFFFFF).ToString("X6");
44 | Program.customTransparent = button1.BackColor;
45 | }
46 |
47 | private void button1_Click(object sender, EventArgs e)
48 | {
49 | colorDialog1.Color = button1.BackColor;
50 | if (colorDialog1.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
51 | {
52 | setColor(colorDialog1.Color);
53 | radioButton5.Checked = true;
54 | }
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Forms/TransparencySettings.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/NewCode/IBitformat.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SnesGFX
6 | {
7 | interface IBitformat
8 | {
9 | int BitsPerPixel { get; } // 2, 3, 4 and 8
10 | int Colors { get; } // obvious, according to BitsPerPixel.
11 | BitformatType Type { get; } // packed, linear or snes?
12 | string Name { get; } // known name? 2bpp snes..? 8bpp linear?
13 | bool AlignBy8x8 { get; } // image must have a align of 8x8 blocks..?
14 | int FixedWidth { get; } // if n != 0, width = n.
15 |
16 | byte[] Encode(byte[] input); // Encodes a bitmap.
17 | byte[] Decode(byte[] input); // Decodes to a bitmap.
18 | }
19 |
20 | enum BitformatType : byte
21 | {
22 | BITFORMAT_PACKED = 0, // "Packed" format
23 | BITFORMAT_LINEAR = 1, // "Linear" format
24 | BITFORMAT_PLANAR = 2, // "SNES" format
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/NewCode/Linear.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SnesGFX.Linear
6 | {
7 | class _8BPP : IBitformat
8 | {
9 | public int BitsPerPixel
10 | {
11 | get { return 8; }
12 | }
13 |
14 | public int Colors
15 | {
16 | get { return 256; }
17 | }
18 |
19 | public BitformatType Type
20 | {
21 | get { return BitformatType.BITFORMAT_LINEAR; }
22 | }
23 |
24 | public string Name
25 | {
26 | get { return "8BPP Linear"; }
27 | }
28 |
29 | public bool AlignBy8x8
30 | {
31 | get { return false; }
32 | }
33 |
34 | public int FixedWidth
35 | {
36 | get { return 0; }
37 | }
38 |
39 | public byte[] Encode(byte[] input)
40 | {
41 | return input;
42 | }
43 |
44 | public byte[] Decode(byte[] input)
45 | {
46 | return input;
47 | }
48 | }
49 |
50 | class _4BPP : IBitformat
51 | {
52 | public int BitsPerPixel
53 | {
54 | get { return 4; }
55 | }
56 |
57 | public int Colors
58 | {
59 | get { return 16; }
60 | }
61 |
62 | public BitformatType Type
63 | {
64 | get { return BitformatType.BITFORMAT_LINEAR; }
65 | }
66 |
67 | public string Name
68 | {
69 | get { return "4BPP Linear"; }
70 | }
71 |
72 | public bool AlignBy8x8
73 | {
74 | get { return false; }
75 | }
76 |
77 | public int FixedWidth
78 | {
79 | get { return 0; }
80 | }
81 |
82 | public byte[] Encode(byte[] input)
83 | {
84 | for (int i = 0, j = input.Length; i < j; ++i)
85 | {
86 | input[i] &= 15;
87 | }
88 |
89 | return input;
90 | }
91 |
92 | public byte[] Decode(byte[] input)
93 | {
94 | for (int i = 0, j = input.Length; i < j; ++i)
95 | {
96 | input[i] &= 15;
97 | }
98 |
99 | return input;
100 | }
101 | }
102 |
103 | class _2BPP : IBitformat
104 | {
105 | public int BitsPerPixel
106 | {
107 | get { return 2; }
108 | }
109 |
110 | public int Colors
111 | {
112 | get { return 4; }
113 | }
114 |
115 | public BitformatType Type
116 | {
117 | get { return BitformatType.BITFORMAT_LINEAR; }
118 | }
119 |
120 | public string Name
121 | {
122 | get { return "2BPP Linear"; }
123 | }
124 |
125 | public bool AlignBy8x8
126 | {
127 | get { return false; }
128 | }
129 |
130 | public int FixedWidth
131 | {
132 | get { return 0; }
133 | }
134 |
135 | public byte[] Encode(byte[] input)
136 | {
137 | for (int i = 0, j = input.Length; i < j; ++i)
138 | {
139 | input[i] &= 3;
140 | }
141 |
142 | return input;
143 | }
144 |
145 | public byte[] Decode(byte[] input)
146 | {
147 | for (int i = 0, j = input.Length; i < j; ++i)
148 | {
149 | input[i] &= 3;
150 | }
151 |
152 | return input;
153 | }
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/NewCode/Packed.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SnesGFX.Packed
6 | {
7 | class _4BPP : IBitformat
8 | {
9 | public int BitsPerPixel
10 | {
11 | get { return 4; }
12 | }
13 |
14 | public int Colors
15 | {
16 | get { return 16; }
17 | }
18 |
19 | public BitformatType Type
20 | {
21 | get { return BitformatType.BITFORMAT_PACKED; }
22 | }
23 |
24 | public string Name
25 | {
26 | get { return "4BPP Packed"; }
27 | }
28 |
29 | public bool AlignBy8x8
30 | {
31 | get { return false; }
32 | }
33 |
34 | public int FixedWidth
35 | {
36 | get { return 0; }
37 | }
38 |
39 | public byte[] Encode(byte[] input)
40 | {
41 | byte[] output = new byte[input.Length >> 1];
42 |
43 | for (int x = 0, y = 0, j = input.Length >> 1; x < j; ++x, y += 2)
44 | {
45 | output[x] = (byte)((input[y] & 15) | ((input[y + 1] & 15) << 4));
46 | }
47 |
48 | return output;
49 | }
50 |
51 | public byte[] Decode(byte[] input)
52 | {
53 | byte[] output = new byte[input.Length << 1];
54 |
55 | for (int i = 0, j = 0, s = input.Length; i < s; ++i, j += 2)
56 | {
57 | output[j] = (byte)(input[i] & 15);
58 | output[j + 1] = (byte)(input[i] >> 4);
59 | }
60 |
61 | return output;
62 | }
63 | }
64 |
65 | class _2BPP : IBitformat
66 | {
67 | public int BitsPerPixel
68 | {
69 | get { return 2; }
70 | }
71 |
72 | public int Colors
73 | {
74 | get { return 4; }
75 | }
76 |
77 | public BitformatType Type
78 | {
79 | get { return BitformatType.BITFORMAT_PACKED; }
80 | }
81 |
82 | public string Name
83 | {
84 | get { return "2BPP Packed"; }
85 | }
86 |
87 | public bool AlignBy8x8
88 | {
89 | get { return false; }
90 | }
91 |
92 | public int FixedWidth
93 | {
94 | get { return 0; }
95 | }
96 |
97 | public byte[] Encode(byte[] input)
98 | {
99 | byte[] output = new byte[input.Length >> 2];
100 |
101 | for (int x = 0, y = 0, j = input.Length >> 2; x < j; ++x, y += 4)
102 | {
103 | output[x] = (byte)( input[y ] & 3);
104 | output[x] |= (byte)((input[y + 1] & 3) << 2);
105 | output[x] |= (byte)((input[y + 2] & 3) << 4);
106 | output[x] |= (byte)((input[y + 3] & 3) << 6);
107 | }
108 |
109 | return output;
110 | }
111 |
112 | public byte[] Decode(byte[] input)
113 | {
114 | byte[] output = new byte[input.Length << 2];
115 |
116 | for (int i = 0, j = 0, s = input.Length; i < s; ++i, j += 4)
117 | {
118 | output[j ] = (byte)( input[i] & 3);
119 | output[j + 1] = (byte)((input[i] >> 2) & 3);
120 | output[j + 2] = (byte)((input[i] >> 4) & 3);
121 | output[j + 3] = (byte)((input[i] >> 6) & 3);
122 | }
123 |
124 | return output;
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/NewCode/SNES.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace SnesGFX.SNES
5 | {
6 | static class Generic
7 | {
8 | public static byte[] linearToBlocks(byte[] input, int width, int tileWidth)
9 | {
10 | int size = input.Length;
11 |
12 | byte[] output = new byte[size];
13 | int blockSize = tileWidth * tileWidth;
14 | int a8x8 = size / blockSize;
15 | int x = 0, y = 0, i = 0;
16 |
17 | int r = 0;
18 |
19 | do
20 | {
21 | i = ((i % width) == 0 && (i > 0)) ? i + (width * (tileWidth - 1)) : i;
22 | y = 0;
23 | do
24 | {
25 | r = i + (y & (tileWidth - 1)) + (width * (y / tileWidth));
26 | if (r >= size) continue;
27 |
28 | output[x * blockSize + y] = input[r];
29 | } while (++y < blockSize);
30 | i += tileWidth;
31 | } while (++x < a8x8);
32 |
33 | input = null;
34 | return output;
35 | }
36 |
37 | public static byte[] blocksToLinear(byte[] input, int width, int tileWidth)
38 | {
39 | int size = input.Length;
40 |
41 | byte[] output = new byte[size];
42 | int blockSize = tileWidth * tileWidth;
43 | int a8x8 = size / blockSize;
44 | int x = 0, y = 0, i = 0;
45 |
46 | int r = 0;
47 |
48 | do
49 | {
50 | i = ((i % width) == 0 && (i > 0)) ? i + (width * (tileWidth - 1)) : i;
51 |
52 | y = 0;
53 | do
54 | {
55 | r = i + (y & (blockSize - 1)) + (width * (y / tileWidth));
56 | if (r >= size) continue;
57 |
58 | output[r] = input[x * blockSize + y];
59 | } while (++y < blockSize);
60 | i += blockSize;
61 | } while (++x < a8x8);
62 |
63 | return output;
64 | }
65 | }
66 |
67 | unsafe class Mode7 : IBitformat
68 | {
69 | public int BitsPerPixel { get { return 8; } }
70 | public int Colors { get { return 256; } }
71 | public BitformatType Type { get { return BitformatType.BITFORMAT_PLANAR; } }
72 | public string Name { get { return "Mode 7"; } }
73 | public bool AlignBy8x8 { get { return true; } }
74 | public int FixedWidth { get { return 128; } }
75 |
76 | public byte[] Encode(byte[] input)
77 | {
78 | return Generic.linearToBlocks(input, 128, 8);
79 | }
80 |
81 | public byte[] Decode(byte[] input)
82 | {
83 | return Generic.blocksToLinear(input, 128, 8);
84 | }
85 | }
86 |
87 | unsafe class _2BPP : IBitformat
88 | {
89 | public int BitsPerPixel { get { return 2; } }
90 | public int Colors { get { return 4; } }
91 | public BitformatType Type { get { return BitformatType.BITFORMAT_PLANAR; } }
92 | public string Name { get { return "2BPP GB"; } }
93 | public bool AlignBy8x8 { get { return true; } }
94 | public int FixedWidth { get { return 128; } }
95 |
96 | public byte[] Encode(byte[] bitmap)
97 | {
98 | return _encode(Generic.linearToBlocks(bitmap, 128, 8));
99 | }
100 |
101 | private byte[] _encode(byte[] input)
102 | {
103 | int bits = 0;
104 | int sizeFix = input.Length / 4; //64/16
105 | if ((sizeFix % 16) != 0)
106 | {
107 | sizeFix += 16 - (sizeFix % 16);
108 | }
109 | byte[] data = new byte[sizeFix];
110 |
111 | fixed (byte* output = &data[0], pinput = &input[0])
112 | {
113 | byte* ptr1 = output - 1;
114 | byte* ptr2 = pinput;
115 | byte* ptr3 = ptr2 + input.Length;
116 |
117 | while (ptr2 < ptr3)
118 | {
119 | bits = 0;
120 | for (int y = 0; y < 8; ++y)
121 | {
122 | bits |= (ptr2[y] & 1) << (7 - y);
123 | }
124 | *++ptr1 = (byte)bits;
125 |
126 | bits = 0;
127 | for (int y = 0; y < 8; ++y)
128 | {
129 | bits |= (ptr2[y] & 2) >> 1 << (7 - y);
130 | }
131 | *++ptr1 = (byte)bits;
132 |
133 | ptr2 += 8;
134 | }
135 | }
136 |
137 | return data;
138 | }
139 |
140 | private byte decodePixel(byte* ptr2, int shift)
141 | {
142 | return (byte)(
143 | (ptr2[1] >> shift << 1 & 2)
144 | | (ptr2[0] >> shift & 1));
145 | }
146 |
147 | public byte[] Decode(byte[] data)
148 | {
149 | return Generic.blocksToLinear(_decode(data), 128, 8);
150 | }
151 |
152 | public byte[] _decode(byte[] input)
153 | {
154 | int size = input.Length;
155 | int sizeFix = size * 4;
156 | if (sizeFix % 64 != 0)
157 | {
158 | sizeFix += 64 - (sizeFix % 64);
159 | }
160 |
161 | byte[] output = new byte[sizeFix]; // 64/16 = 4
162 |
163 | fixed (byte* poutput = &output[0], pinput = &input[0])
164 | {
165 | byte* ptr1 = poutput - 1;
166 | byte* ptr2 = pinput;
167 | byte* ptr3 = pinput + size;
168 |
169 | while (ptr2 < ptr3)
170 | {
171 | *++ptr1 = decodePixel(ptr2, 7);
172 | *++ptr1 = decodePixel(ptr2, 6);
173 | *++ptr1 = decodePixel(ptr2, 5);
174 | *++ptr1 = decodePixel(ptr2, 4);
175 | *++ptr1 = decodePixel(ptr2, 3);
176 | *++ptr1 = decodePixel(ptr2, 2);
177 | *++ptr1 = decodePixel(ptr2, 1);
178 | *++ptr1 = decodePixel(ptr2, 0);
179 |
180 | ptr2 += 2;
181 | }
182 | }
183 |
184 | return output;
185 | }
186 | }
187 |
188 | unsafe class _3BPP : IBitformat
189 | {
190 | public int BitsPerPixel { get { return 3; } }
191 | public int Colors { get { return 8; } }
192 | public BitformatType Type { get { return BitformatType.BITFORMAT_PLANAR; } }
193 | public string Name { get { return "3BPP SNES"; } }
194 | public bool AlignBy8x8 { get { return true; } }
195 | public int FixedWidth { get { return 128; } }
196 |
197 | public byte[] Encode(byte[] bitmap)
198 | {
199 | return _encode(Generic.linearToBlocks(bitmap, 128, 8));
200 | }
201 |
202 | private byte[] _encode(byte[] input)
203 | {
204 | int bits = 0;
205 | int sizeFix = input.Length * 3 / 8; //64/24 = 8/3
206 | if ((sizeFix % 24) != 0)
207 | {
208 | sizeFix += 24 - (sizeFix % 24);
209 | }
210 | byte[] data = new byte[sizeFix];
211 |
212 | fixed (byte* output = &data[0], pinput = &input[0])
213 | {
214 | byte* ptr1 = output - 1;
215 | byte* ptr2 = pinput;
216 | byte* ptr3 = ptr2 + input.Length;
217 |
218 | while (ptr2 < ptr3)
219 | {
220 | for (int i = 0; i < 64; i += 8)
221 | {
222 | bits = 0;
223 | for (int y = 0; y < 8; ++y)
224 | {
225 | bits |= (ptr2[i + y] & 1) << (7 - y);
226 | }
227 | *++ptr1 = (byte)bits;
228 |
229 | bits = 0;
230 | for (int y = 0; y < 8; ++y)
231 | {
232 | bits |= (ptr2[i + y] & 2) >> 1 << (7 - y);
233 | }
234 | *++ptr1 = (byte)bits;
235 | }
236 | for (int i = 0; i < 64; i += 8)
237 | {
238 | bits = 0;
239 | for (int y = 0; y < 8; ++y)
240 | {
241 | bits |= (ptr2[i + y] & 4) >> 2 << (7 - y);
242 | }
243 | *++ptr1 = (byte)bits;
244 | }
245 |
246 | ptr2 += 64;
247 | }
248 | }
249 |
250 | return data;
251 | }
252 |
253 | private byte decodePixel(byte* ptr2, byte* ptr4, int shift)
254 | {
255 | return (byte)(
256 | (ptr4[16] >> shift << 2 & 4)
257 | | (ptr2[1 ] >> shift << 1 & 2)
258 | | (ptr2[0 ] >> shift & 1));
259 | }
260 |
261 | public byte[] Decode(byte[] data)
262 | {
263 | return Generic.blocksToLinear(_decode(data), 128, 8);
264 | }
265 |
266 | public byte[] _decode(byte[] input)
267 | {
268 | int size = input.Length;
269 | int sizeFix = size * 8 / 3;
270 | if (sizeFix % 64 != 0)
271 | {
272 | sizeFix += 64 - (sizeFix % 64);
273 | }
274 |
275 | byte[] output = new byte[sizeFix]; // 64/24 = 8/3
276 |
277 | fixed (byte* poutput = &output[0], pinput = &input[0])
278 | {
279 | byte* ptr1 = poutput - 1;
280 | byte* ptr2 = pinput;
281 | byte* ptr3 = pinput + size;
282 | byte* ptr4 = pinput;
283 |
284 | while (ptr2 < ptr3)
285 | {
286 | for (int i = 0; i < 16; i += 2, ptr2 += 2, ++ptr4)
287 | {
288 | *++ptr1 = decodePixel(ptr2, ptr4, 7);
289 | *++ptr1 = decodePixel(ptr2, ptr4, 6);
290 | *++ptr1 = decodePixel(ptr2, ptr4, 5);
291 | *++ptr1 = decodePixel(ptr2, ptr4, 4);
292 | *++ptr1 = decodePixel(ptr2, ptr4, 3);
293 | *++ptr1 = decodePixel(ptr2, ptr4, 2);
294 | *++ptr1 = decodePixel(ptr2, ptr4, 1);
295 | *++ptr1 = decodePixel(ptr2, ptr4, 0);
296 | }
297 | ptr2 += 8; //24-16
298 | ptr4 += 16;
299 | }
300 | }
301 |
302 | return output;
303 | }
304 | }
305 |
306 | unsafe class _4BPP : IBitformat
307 | {
308 | public int BitsPerPixel { get { return 4; } }
309 | public int Colors { get { return 16; } }
310 | public BitformatType Type { get { return BitformatType.BITFORMAT_PLANAR; } }
311 | public string Name { get { return "4BPP SNES"; } }
312 | public bool AlignBy8x8 { get { return true; } }
313 | public int FixedWidth { get { return 128; } }
314 |
315 | public byte[] Encode(byte[] bitmap)
316 | {
317 | return _encode(Generic.linearToBlocks(bitmap, 128, 8));
318 | }
319 |
320 | private byte[] _encode(byte[] input)
321 | {
322 | int bits = 0;
323 | int sizeFix = input.Length / 2; //64/32 = 2
324 | if ((sizeFix % 32) != 0)
325 | {
326 | sizeFix += 32 - (sizeFix % 32);
327 | }
328 | byte[] data = new byte[sizeFix];
329 |
330 | fixed (byte* output = &data[0], pinput = &input[0])
331 | {
332 | byte* ptr1 = output - 1;
333 | byte* ptr2 = pinput;
334 | byte* ptr3 = ptr2 + input.Length;
335 |
336 | while (ptr2 < ptr3)
337 | {
338 | for (int i = 0; i < 64; i += 8)
339 | {
340 | bits = 0;
341 | for (int y = 0; y < 8; ++y)
342 | {
343 | bits |= (ptr2[i + y] & 1) << (7 - y);
344 | }
345 | *++ptr1 = (byte)bits;
346 |
347 | bits = 0;
348 | for (int y = 0; y < 8; ++y)
349 | {
350 | bits |= (ptr2[i + y] & 2) >> 1 << (7 - y);
351 | }
352 | *++ptr1 = (byte)bits;
353 | }
354 | for (int i = 0; i < 64; i += 8)
355 | {
356 | bits = 0;
357 | for (int y = 0; y < 8; ++y)
358 | {
359 | bits |= (ptr2[i + y] & 4) >> 2 << (7 - y);
360 | }
361 | *++ptr1 = (byte)bits;
362 |
363 | bits = 0;
364 | for (int y = 0; y < 8; ++y)
365 | {
366 | bits |= (ptr2[i + y] & 8) >> 3 << (7 - y);
367 | }
368 | *++ptr1 = (byte)bits;
369 | }
370 |
371 | ptr2 += 64;
372 | }
373 | }
374 |
375 | return data;
376 | }
377 |
378 | private byte decodePixel(byte* ptr2, int shift)
379 | {
380 | return (byte)(
381 | (ptr2[17] >> shift << 3 & 8)
382 | | (ptr2[16] >> shift << 2 & 4)
383 | | (ptr2[ 1] >> shift << 1 & 2)
384 | | (ptr2[ 0] >> shift & 1));
385 | }
386 |
387 | public byte[] Decode(byte[] data)
388 | {
389 | return Generic.blocksToLinear(_decode(data), 128, 8);
390 | }
391 |
392 | public byte[] _decode(byte[] input)
393 | {
394 | int size = input.Length;
395 | int sizeFix = size * 2;
396 | if (sizeFix % 64 != 0)
397 | {
398 | sizeFix += 64 - (sizeFix % 64);
399 | }
400 |
401 | byte[] output = new byte[sizeFix]; // 64/32 = 2
402 |
403 | fixed (byte* poutput = &output[0], pinput = &input[0])
404 | {
405 | byte* ptr1 = poutput - 1;
406 | byte* ptr2 = pinput;
407 | byte* ptr3 = pinput + size;
408 |
409 | while (ptr2 < ptr3)
410 | {
411 | for (int i = 0; i < 16; i += 2, ptr2 += 2)
412 | {
413 | *++ptr1 = decodePixel(ptr2, 7);
414 | *++ptr1 = decodePixel(ptr2, 6);
415 | *++ptr1 = decodePixel(ptr2, 5);
416 | *++ptr1 = decodePixel(ptr2, 4);
417 | *++ptr1 = decodePixel(ptr2, 3);
418 | *++ptr1 = decodePixel(ptr2, 2);
419 | *++ptr1 = decodePixel(ptr2, 1);
420 | *++ptr1 = decodePixel(ptr2, 0);
421 | }
422 | ptr2 += 16; //32-16
423 | }
424 | }
425 |
426 | return output;
427 | }
428 | }
429 |
430 | unsafe class _8BPP : IBitformat
431 | {
432 | public int BitsPerPixel { get { return 8; } }
433 | public int Colors { get { return 256; } }
434 | public BitformatType Type { get { return BitformatType.BITFORMAT_PLANAR; } }
435 | public string Name { get { return "8BPP SNES"; } }
436 | public bool AlignBy8x8 { get { return true; } }
437 | public int FixedWidth { get { return 128; } }
438 |
439 | public byte[] Encode(byte[] bitmap)
440 | {
441 | return _encode(Generic.linearToBlocks(bitmap, 128, 8));
442 | }
443 |
444 | private byte[] _encode(byte[] input)
445 | {
446 | int bits = 0;
447 | int sizeFix = input.Length; //64/64
448 | if ((sizeFix % 64) != 0)
449 | {
450 | sizeFix += 64 - (sizeFix % 64);
451 | }
452 | byte[] data = new byte[sizeFix];
453 |
454 | fixed (byte* output = &data[0], pinput = &input[0])
455 | {
456 | byte* ptr1 = output - 1;
457 | byte* ptr2 = pinput;
458 | byte* ptr3 = ptr2 + input.Length;
459 |
460 | while (ptr2 < ptr3)
461 | {
462 | for (int i = 0; i < 64; i += 8)
463 | {
464 | bits = 0;
465 | for (int y = 0; y < 8; ++y)
466 | {
467 | bits |= (ptr2[i + y] & 1) << (7 - y);
468 | }
469 | *++ptr1 = (byte)bits;
470 |
471 | bits = 0;
472 | for (int y = 0; y < 8; ++y)
473 | {
474 | bits |= (ptr2[i + y] & 2) >> 1 << (7 - y);
475 | }
476 | *++ptr1 = (byte)bits;
477 | }
478 | for (int i = 0; i < 64; i += 8)
479 | {
480 | bits = 0;
481 | for (int y = 0; y < 8; ++y)
482 | {
483 | bits |= (ptr2[i + y] & 4) >> 2 << (7 - y);
484 | }
485 | *++ptr1 = (byte)bits;
486 |
487 | bits = 0;
488 | for (int y = 0; y < 8; ++y)
489 | {
490 | bits |= (ptr2[i + y] & 8) >> 3 << (7 - y);
491 | }
492 | *++ptr1 = (byte)bits;
493 | }
494 | for (int i = 0; i < 64; i += 8)
495 | {
496 | bits = 0;
497 | for (int y = 0; y < 8; ++y)
498 | {
499 | bits |= (ptr2[i + y] & 16) >> 4 << (7 - y);
500 | }
501 | *++ptr1 = (byte)bits;
502 |
503 | bits = 0;
504 | for (int y = 0; y < 8; ++y)
505 | {
506 | bits |= (ptr2[i + y] & 32) >> 5 << (7 - y);
507 | }
508 | *++ptr1 = (byte)bits;
509 | }
510 | for (int i = 0; i < 64; i += 8)
511 | {
512 | bits = 0;
513 | for (int y = 0; y < 8; ++y)
514 | {
515 | bits |= (ptr2[i + y] & 64) >> 6 << (7 - y);
516 | }
517 | *++ptr1 = (byte)bits;
518 |
519 | bits = 0;
520 | for (int y = 0; y < 8; ++y)
521 | {
522 | bits |= (ptr2[i + y] & 128) >> 7 << (7 - y);
523 | }
524 | *++ptr1 = (byte)bits;
525 | }
526 |
527 | ptr2 += 64;
528 | }
529 | }
530 |
531 | return data;
532 | }
533 |
534 | private byte decodePixel(byte* ptr2, int shift)
535 | {
536 | return (byte)(
537 | (ptr2[49] >> shift << 7 & 128)
538 | | (ptr2[48] >> shift << 6 & 64)
539 | | (ptr2[33] >> shift << 5 & 32)
540 | | (ptr2[32] >> shift << 4 & 16)
541 | | (ptr2[17] >> shift << 3 & 8)
542 | | (ptr2[16] >> shift << 2 & 4)
543 | | (ptr2[ 1] >> shift << 1 & 2)
544 | | (ptr2[ 0] >> shift & 1));
545 | }
546 |
547 | public byte[] Decode(byte[] data)
548 | {
549 | return Generic.blocksToLinear(_decode(data), 128, 8);
550 | }
551 |
552 | public byte[] _decode(byte[] input)
553 | {
554 | int size = input.Length;
555 | int sizeFix = size;
556 | if (sizeFix % 64 != 0)
557 | {
558 | sizeFix += 64 - (sizeFix % 64);
559 | }
560 |
561 | byte[] output = new byte[sizeFix]; // 64/64
562 |
563 | fixed (byte* poutput = &output[0], pinput = &input[0])
564 | {
565 | byte* ptr1 = poutput - 1;
566 | byte* ptr2 = pinput;
567 | byte* ptr3 = pinput + size;
568 |
569 | while (ptr2 < ptr3)
570 | {
571 | for (int i = 0; i < 16; i += 2, ptr2 += 2)
572 | {
573 | *++ptr1 = decodePixel(ptr2, 7);
574 | *++ptr1 = decodePixel(ptr2, 6);
575 | *++ptr1 = decodePixel(ptr2, 5);
576 | *++ptr1 = decodePixel(ptr2, 4);
577 | *++ptr1 = decodePixel(ptr2, 3);
578 | *++ptr1 = decodePixel(ptr2, 2);
579 | *++ptr1 = decodePixel(ptr2, 1);
580 | *++ptr1 = decodePixel(ptr2, 0);
581 | }
582 | ptr2 += 48; //64-16
583 | }
584 | }
585 |
586 | return output;
587 | }
588 | }
589 | }
590 |
--------------------------------------------------------------------------------
/NewCode/SnesGFX.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SnesGFX
6 | {
7 | class SnesGFX
8 | {
9 | static IBitformat[] formats;
10 |
11 | public static IBitformat[] AvaiableFormats
12 | {
13 | get
14 | {
15 | return formats;
16 | }
17 | }
18 |
19 | public static void Init()
20 | {
21 | if (formats != null) { return; }
22 | formats = new IBitformat[] {
23 | new SNES._2BPP(), // 0
24 | new SNES._3BPP(), // 1
25 | new SNES._4BPP(), // 2
26 | new SNES._8BPP(), // 3
27 | new Linear._2BPP(), // 4
28 | new Linear._4BPP(), // 5
29 | new Linear._8BPP(), // 6
30 | new Packed._2BPP(), // 7
31 | new Packed._4BPP(), // 8
32 | new SNES.Mode7(), // 9
33 | };
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/NewCode/Tile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace SnesGFX.SNES
5 | {
6 | class Tile
7 | {
8 | ///
9 | /// Size of tile in pixels.
10 | ///
11 | public int Size { get; private set; }
12 |
13 | ///
14 | /// Gets the pixel data of 8x8 block.
15 | ///
16 | public byte[] TileData { get; }
17 |
18 | public Tile(byte[] block, int size)
19 | {
20 | Size = size;
21 | TileData = new byte[size * size];
22 | Array.Copy(block, TileData, TileData.Length);
23 | }
24 |
25 | public static Tile FlipX(Tile tile)
26 | {
27 | byte[] output = new byte[tile.TileData.Length];
28 | for (int y = 0; y < tile.Size; ++y)
29 | {
30 | for (int x = 0; x < tile.Size; ++x)
31 | {
32 | output[y * tile.Size + (x ^ (tile.Size - 1))] = tile.TileData[y * tile.Size + x];
33 | }
34 | }
35 | return new Tile(output, tile.Size);
36 | }
37 | public static Tile FlipY(Tile tile)
38 | {
39 | byte[] output = new byte[tile.TileData.Length];
40 | for (int y = 0; y < tile.Size; ++y)
41 | {
42 | for (int x = 0; x < tile.Size; ++x)
43 | {
44 | output[(y ^ (tile.Size - 1)) * tile.Size + x] = tile.TileData[y * tile.Size + x];
45 | }
46 | }
47 | return new Tile(output, tile.Size);
48 | }
49 | public static Tile FlipXY(Tile tile)
50 | {
51 | byte[] output = new byte[tile.TileData.Length];
52 | for (int y = 0; y < tile.Size; ++y)
53 | {
54 | for (int x = 0; x < tile.Size; ++x)
55 | {
56 | output[(y ^ (tile.Size - 1)) * tile.Size + (x ^ (tile.Size - 1))] = tile.TileData[y * tile.Size + x];
57 | }
58 | }
59 | return new Tile(output, tile.Size);
60 | }
61 |
62 | public static Tile[] FromBitmap(byte[] bitmap, int width, int blockWidth)
63 | {
64 | // FIX ME
65 | int tileSize = blockWidth * blockWidth;
66 |
67 | byte[] blocks8x8 = Generic.linearToBlocks(bitmap, width, blockWidth);
68 | Tile[] output = new Tile[blocks8x8.Length / tileSize];
69 | byte[] currentBlock = new byte[tileSize];
70 |
71 | for (int i = 0, j = blocks8x8.Length, y = 0; i < j; i += tileSize, ++y)
72 | {
73 | for (int x = 0; x < tileSize; ++x)
74 | {
75 | currentBlock[x] = blocks8x8[i + x];
76 | }
77 |
78 | output[y] = new Tile(currentBlock, blockWidth);
79 | }
80 |
81 | return output;
82 | }
83 |
84 | public static Tile[] RemoveRepeatedBlocks(Tile[] blocks, bool allowFlip,
85 | out int[] result, out bool[] flipx, out bool[] flipy)
86 | {
87 | result = new int[blocks.Length];
88 | flipx = new bool[blocks.Length];
89 | flipy = new bool[blocks.Length];
90 | List output = new List();
91 |
92 | Tile[] xflipped = new Tile[blocks.Length];
93 | Tile[] yflipped = new Tile[blocks.Length];
94 | Tile[] xyflipped = new Tile[blocks.Length];
95 |
96 | for (int i = 0; i < blocks.Length; ++i)
97 | {
98 | xflipped[i] = Tile.FlipX(blocks[i]);
99 | yflipped[i] = Tile.FlipY(blocks[i]);
100 | xyflipped[i] = Tile.FlipXY(blocks[i]);
101 | }
102 |
103 | for (int i = 0, j = blocks.Length; i < j; ++i)
104 | {
105 | for (int x = 0, y = output.Count; x < y; ++x)
106 | {
107 | if (blocks[i] == output[x])
108 | {
109 | result[i] = x;
110 | flipx[i] = false;
111 | flipy[i] = false;
112 | goto reset;
113 | }
114 | if (xflipped[i] == output[x] && allowFlip)
115 | {
116 | result[i] = x;
117 | flipx[i] = true;
118 | flipy[i] = false;
119 | goto reset;
120 | }
121 | if (yflipped[i] == output[x] && allowFlip)
122 | {
123 | result[i] = x;
124 | flipx[i] = false;
125 | flipy[i] = true;
126 | goto reset;
127 | }
128 | if (xyflipped[i] == output[x] && allowFlip)
129 | {
130 | result[i] = x;
131 | flipx[i] = true;
132 | flipy[i] = true;
133 | goto reset;
134 | }
135 | }
136 |
137 | output.Add(blocks[i]);
138 | result[i] = output.Count - 1;
139 |
140 | reset:
141 | continue;
142 | }
143 |
144 | return output.ToArray();
145 | }
146 |
147 | public static byte[] Join(Tile[] blocks)
148 | {
149 | int size = blocks[0].TileData.Length;
150 | byte[] output = new byte[blocks.Length * size];
151 |
152 | for (int i = 0, j = blocks.Length, y = 0; i < j; ++i, y += size)
153 | {
154 | for (int x = 0; x < size; ++x)
155 | {
156 | output[x + y] = blocks[i].TileData[x];
157 | }
158 | }
159 |
160 | return output;
161 | }
162 |
163 | public static byte[] ConvertToBitmap(Tile[] blocks, int width)
164 | {
165 | return Generic.blocksToLinear(Join(blocks), width, blocks[0].Size);
166 | }
167 |
168 | public override bool Equals(object obj)
169 | {
170 | if (obj is Tile)
171 | {
172 | return this == (Tile)obj;
173 | }
174 | else
175 | {
176 | return false;
177 | }
178 | }
179 |
180 | ///
181 | /// This return much like a sum of all values...
182 | ///
183 | /// The XORSUM of all pixels.
184 | public override int GetHashCode()
185 | {
186 | int result = 0x55555555;
187 | int shift = 0;
188 |
189 | foreach (int pixel in TileData)
190 | {
191 | result ^= pixel << shift;
192 | shift += 8;
193 |
194 | if (shift == 32)
195 | {
196 | shift = 0;
197 | }
198 | }
199 |
200 | return result;
201 | }
202 |
203 | ///
204 | /// Returns true if all pixels in those tiles are equal.
205 | ///
206 | /// First tile to compare
207 | /// Second tile to compare
208 | /// True if all pixels are equal, otherwise, false.
209 | public static bool operator ==(Tile one, Tile two)
210 | {
211 | if (one.Size != two.Size)
212 | {
213 | return false;
214 | }
215 |
216 | for (int i = 0; i < one.TileData.Length; ++i)
217 | {
218 | if (one.TileData[i] != two.TileData[i])
219 | {
220 | return false;
221 | }
222 | }
223 |
224 | return true;
225 | }
226 |
227 | ///
228 | /// Returns true if some pixel isn't equal.
229 | ///
230 | /// First tile to compare
231 | /// Second tile to compare
232 | /// True if isn't equal.
233 | public static bool operator !=(Tile one, Tile two)
234 | {
235 | return !(one == two);
236 | }
237 | }
238 | }
239 |
--------------------------------------------------------------------------------
/Options.cs:
--------------------------------------------------------------------------------
1 | using SnesGFX.Properties;
2 |
3 | namespace SnesGFX
4 | {
5 | public static class Options
6 | {
7 | private static void SaveConfig()
8 | {
9 | try
10 | {
11 | Settings.Default.Save();
12 | }
13 | catch
14 | {
15 | }
16 | }
17 |
18 |
19 | ///
20 | /// Flag que determina se a imagem fica no modo transparência.
21 | ///
22 | public static bool CGADSUB
23 | {
24 | get
25 | {
26 | return Settings.Default.CGADSUB;
27 | }
28 |
29 | set
30 | {
31 | Settings.Default.CGADSUB = value;
32 | SaveConfig();
33 | }
34 | }
35 |
36 | ///
37 | /// Flag que determina se a imagem deve ter transparência ou não
38 | ///
39 | public static bool AllowTransparency
40 | {
41 | get
42 | {
43 | return Settings.Default.Transparency;
44 | }
45 |
46 | set
47 | {
48 | Settings.Default.Transparency = value;
49 | SaveConfig();
50 | }
51 | }
52 |
53 | ///
54 | /// Flag que determina se a palette vai ser ordenada ou não.
55 | ///
56 | public static bool OrderPalette
57 | {
58 | get
59 | {
60 | return Settings.Default.OrderPalette;
61 | }
62 |
63 | set
64 | {
65 | Settings.Default.OrderPalette = value;
66 | SaveConfig();
67 | }
68 | }
69 |
70 | ///
71 | /// Flag que determina se vai usar configurações de qualidados ou de pobre.
72 | ///
73 | public static bool HiQuality
74 | {
75 | get
76 | {
77 | return Settings.Default.HiQuality;
78 | }
79 |
80 | set
81 | {
82 | Settings.Default.HiQuality = value;
83 | SaveConfig();
84 | }
85 | }
86 |
87 | ///
88 | /// Flag que determina se a imagem será redmensionada ou não.
89 | ///
90 | public static bool ScaleOption
91 | {
92 | get
93 | {
94 | return Settings.Default.ScaleOption;
95 | }
96 |
97 | set
98 | {
99 | Settings.Default.ScaleOption = value;
100 | SaveConfig();
101 | }
102 | }
103 |
104 | public static bool RemoveDuplicateTiles
105 | {
106 | get
107 | {
108 | return Settings.Default.NoDuplicate;
109 | }
110 |
111 | set
112 | {
113 | Settings.Default.NoDuplicate = value;
114 | SaveConfig();
115 | }
116 | }
117 |
118 | public static bool RemoveFlippedTiles
119 | {
120 | get
121 | {
122 | return Settings.Default.NoFlips;
123 | }
124 |
125 | set
126 | {
127 | Settings.Default.NoFlips = value;
128 | SaveConfig();
129 | }
130 | }
131 |
132 |
133 | public static bool OptimizeImage
134 | {
135 | get
136 | {
137 | return Settings.Default.OptimizeImage;
138 | }
139 |
140 | set
141 | {
142 | Settings.Default.OptimizeImage = value;
143 | SaveConfig();
144 | }
145 | }
146 |
147 | public static bool SaveOnImageFolder
148 | {
149 | get
150 | {
151 | return Settings.Default.SaveImageFolder;
152 | }
153 |
154 | set
155 | {
156 | Settings.Default.SaveImageFolder = value;
157 | SaveConfig();
158 | }
159 | }
160 |
161 | public static bool SplitOutput
162 | {
163 | get
164 | {
165 | return Settings.Default.Split;
166 | }
167 |
168 | set
169 | {
170 | Settings.Default.Split = value;
171 | SaveConfig();
172 | }
173 | }
174 |
175 | public static int SplitOutputIndex
176 | {
177 | get
178 | {
179 | return Settings.Default.SplitItem;
180 | }
181 |
182 | set
183 | {
184 | Settings.Default.SplitItem = value;
185 | SaveConfig();
186 | }
187 | }
188 |
189 | public static int TilemapOutput
190 | {
191 | get
192 | {
193 | return Settings.Default.TilemapOutput;
194 | }
195 | set
196 | {
197 | Settings.Default.TilemapOutput = value;
198 | SaveConfig();
199 | }
200 | }
201 |
202 | public static int PaletteOutput
203 | {
204 | get
205 | {
206 | return Settings.Default.PaletteOutput;
207 | }
208 | set
209 | {
210 | Settings.Default.PaletteOutput = value;
211 | SaveConfig();
212 | }
213 | }
214 |
215 | public static int OffsetTile
216 | {
217 | get
218 | {
219 | return Settings.Default.OffsetTile;
220 | }
221 | set
222 | {
223 | Settings.Default.OffsetTile = value;
224 | SaveConfig();
225 | }
226 | }
227 |
228 | public static int OffsetPalette
229 | {
230 | get
231 | {
232 | return Settings.Default.OffsetPalette;
233 | }
234 | set
235 | {
236 | Settings.Default.OffsetPalette = value;
237 | SaveConfig();
238 | }
239 | }
240 |
241 | }
242 | }
243 |
--------------------------------------------------------------------------------
/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using System.Resources;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("SnesGFX")]
10 | [assembly: AssemblyDescription("SnesGFX 2.62")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("Vitor Vilela")]
13 | [assembly: AssemblyProduct("SnesGFX")]
14 | [assembly: AssemblyCopyright("")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 | [assembly: ComVisible(false)]
22 |
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM
24 | [assembly: Guid("2ea28ed6-f411-4300-b40d-18b6c6a5b99f")]
25 |
26 | // Version information for an assembly consists of the following four values:
27 | //
28 | // Major Version
29 | // Minor Version
30 | // Build Number
31 | // Revision
32 | //
33 | // You can specify all the values or you can default the Build and Revision Numbers
34 | // by using the '*' as shown below:
35 | // [assembly: AssemblyVersion("1.0.*")]
36 | [assembly: AssemblyVersion("3.0.0.0")]
37 | [assembly: AssemblyFileVersion("3.0.0.0")]
38 | [assembly: NeutralResourcesLanguageAttribute("en")]
39 |
--------------------------------------------------------------------------------
/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34003
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace SnesGFX.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SnesGFX.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Byte[].
65 | ///
66 | internal static byte[] _base {
67 | get {
68 | object obj = ResourceManager.GetObject("_base", resourceCulture);
69 | return ((byte[])(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized resource of type System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap empty {
77 | get {
78 | object obj = ResourceManager.GetObject("empty", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// Looks up a localized resource of type System.Byte[].
85 | ///
86 | internal static byte[] mw3 {
87 | get {
88 | object obj = ResourceManager.GetObject("mw3", resourceCulture);
89 | return ((byte[])(obj));
90 | }
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\mw3.mw3;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
123 |
124 |
125 | ..\Resources\base.mwl;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
126 |
127 |
128 |
129 | ..\Resources\empty.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
130 |
131 |
--------------------------------------------------------------------------------
/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace SnesGFX.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
29 | public int Codec {
30 | get {
31 | return ((int)(this["Codec"]));
32 | }
33 | set {
34 | this["Codec"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
41 | public int Row {
42 | get {
43 | return ((int)(this["Row"]));
44 | }
45 | set {
46 | this["Row"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
53 | public bool OrderPalette {
54 | get {
55 | return ((bool)(this["OrderPalette"]));
56 | }
57 | set {
58 | this["OrderPalette"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
65 | public bool HiQuality {
66 | get {
67 | return ((bool)(this["HiQuality"]));
68 | }
69 | set {
70 | this["HiQuality"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
77 | public bool ScaleOption {
78 | get {
79 | return ((bool)(this["ScaleOption"]));
80 | }
81 | set {
82 | this["ScaleOption"] = value;
83 | }
84 | }
85 |
86 | [global::System.Configuration.UserScopedSettingAttribute()]
87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
88 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
89 | public bool OptimizeImage {
90 | get {
91 | return ((bool)(this["OptimizeImage"]));
92 | }
93 | set {
94 | this["OptimizeImage"] = value;
95 | }
96 | }
97 |
98 | [global::System.Configuration.UserScopedSettingAttribute()]
99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
100 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
101 | public bool NoDuplicate {
102 | get {
103 | return ((bool)(this["NoDuplicate"]));
104 | }
105 | set {
106 | this["NoDuplicate"] = value;
107 | }
108 | }
109 |
110 | [global::System.Configuration.UserScopedSettingAttribute()]
111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
112 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
113 | public bool SaveImageFolder {
114 | get {
115 | return ((bool)(this["SaveImageFolder"]));
116 | }
117 | set {
118 | this["SaveImageFolder"] = value;
119 | }
120 | }
121 |
122 | [global::System.Configuration.UserScopedSettingAttribute()]
123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
124 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
125 | public bool Split {
126 | get {
127 | return ((bool)(this["Split"]));
128 | }
129 | set {
130 | this["Split"] = value;
131 | }
132 | }
133 |
134 | [global::System.Configuration.UserScopedSettingAttribute()]
135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
136 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
137 | public int SplitItem {
138 | get {
139 | return ((int)(this["SplitItem"]));
140 | }
141 | set {
142 | this["SplitItem"] = value;
143 | }
144 | }
145 |
146 | [global::System.Configuration.UserScopedSettingAttribute()]
147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
148 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
149 | public int TilemapOutput {
150 | get {
151 | return ((int)(this["TilemapOutput"]));
152 | }
153 | set {
154 | this["TilemapOutput"] = value;
155 | }
156 | }
157 |
158 | [global::System.Configuration.UserScopedSettingAttribute()]
159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
160 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
161 | public int PaletteOutput {
162 | get {
163 | return ((int)(this["PaletteOutput"]));
164 | }
165 | set {
166 | this["PaletteOutput"] = value;
167 | }
168 | }
169 |
170 | [global::System.Configuration.UserScopedSettingAttribute()]
171 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
172 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
173 | public bool Transparency {
174 | get {
175 | return ((bool)(this["Transparency"]));
176 | }
177 | set {
178 | this["Transparency"] = value;
179 | }
180 | }
181 |
182 | [global::System.Configuration.UserScopedSettingAttribute()]
183 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
184 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
185 | public bool NoFlips {
186 | get {
187 | return ((bool)(this["NoFlips"]));
188 | }
189 | set {
190 | this["NoFlips"] = value;
191 | }
192 | }
193 |
194 | [global::System.Configuration.UserScopedSettingAttribute()]
195 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
196 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
197 | public bool CGADSUB {
198 | get {
199 | return ((bool)(this["CGADSUB"]));
200 | }
201 | set {
202 | this["CGADSUB"] = value;
203 | }
204 | }
205 |
206 | [global::System.Configuration.UserScopedSettingAttribute()]
207 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
208 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
209 | public int OffsetTile {
210 | get {
211 | return ((int)(this["OffsetTile"]));
212 | }
213 | set {
214 | this["OffsetTile"] = value;
215 | }
216 | }
217 |
218 | [global::System.Configuration.UserScopedSettingAttribute()]
219 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
220 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
221 | public int OffsetPalette {
222 | get {
223 | return ((int)(this["OffsetPalette"]));
224 | }
225 | set {
226 | this["OffsetPalette"] = value;
227 | }
228 | }
229 | }
230 | }
231 |
--------------------------------------------------------------------------------
/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 0
7 |
8 |
9 | 0
10 |
11 |
12 | True
13 |
14 |
15 | False
16 |
17 |
18 | False
19 |
20 |
21 | True
22 |
23 |
24 | False
25 |
26 |
27 | True
28 |
29 |
30 | False
31 |
32 |
33 | 0
34 |
35 |
36 | 0
37 |
38 |
39 | 0
40 |
41 |
42 | True
43 |
44 |
45 | False
46 |
47 |
48 | False
49 |
50 |
51 | 0
52 |
53 |
54 | 0
55 |
56 |
57 |
--------------------------------------------------------------------------------
/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
47 |
--------------------------------------------------------------------------------
/Resources/base.mwl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VitorVilela7/SnesGFX/7cdb6f7b9c02831966c0396d443a45d89c2d0b68/Resources/base.mwl
--------------------------------------------------------------------------------
/Resources/empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VitorVilela7/SnesGFX/7cdb6f7b9c02831966c0396d443a45d89c2d0b68/Resources/empty.png
--------------------------------------------------------------------------------
/Resources/mw3.mw3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VitorVilela7/SnesGFX/7cdb6f7b9c02831966c0396d443a45d89c2d0b68/Resources/mw3.mw3
--------------------------------------------------------------------------------
/SnesGFX.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 | 8.0.30703
7 | 2.0
8 | {C8B44B3B-7A84-42C2-868E-C700213C2AEC}
9 | WinExe
10 | Properties
11 | SnesGFX
12 | SnesGFX
13 | v2.0
14 | 512
15 | false
16 | publish\
17 | true
18 | Disk
19 | false
20 | Foreground
21 | 7
22 | Days
23 | false
24 | false
25 | true
26 | 0
27 | 1.0.0.%2a
28 | false
29 | true
30 |
31 |
32 | x86
33 | true
34 | full
35 | false
36 | bin\Debug\
37 | DEBUG;TRACE
38 | prompt
39 | 4
40 | true
41 | 8192
42 |
43 |
44 | x86
45 | pdbonly
46 | true
47 | bin\Release\
48 |
49 |
50 | prompt
51 | 4
52 | true
53 | true
54 |
55 |
56 | SnesGFX.Program
57 |
58 |
59 | snesgfx.ico
60 |
61 |
62 | false
63 |
64 |
65 | 14123A6059B448522494FAD341AF2A29244A704F
66 |
67 |
68 | SnesGFX_TemporaryKey.pfx
69 |
70 |
71 | false
72 |
73 |
74 |
75 |
76 |
77 |
78 | false
79 |
80 |
81 | LocalIntranet
82 |
83 |
84 | false
85 |
86 |
87 | Properties\app.manifest
88 |
89 |
90 | true
91 | bin\Debug\
92 | DEBUG;TRACE
93 | true
94 | 8192
95 | full
96 | AnyCPU
97 | prompt
98 |
99 |
100 | true
101 | bin\Release\
102 | true
103 | true
104 | pdbonly
105 | AnyCPU
106 | prompt
107 | false
108 | false
109 | false
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | Form
123 |
124 |
125 | TranslucencySettings.cs
126 |
127 |
128 | Form
129 |
130 |
131 | Main.cs
132 |
133 |
134 | Form
135 |
136 |
137 | TransparencySettings.cs
138 |
139 |
140 | Form
141 |
142 |
143 | ColorSortSettings.cs
144 |
145 |
146 | Form
147 |
148 |
149 | ColorSortManual.cs
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 | Form
162 |
163 |
164 | Preview.cs
165 |
166 |
167 | TranslucencySettings.cs
168 |
169 |
170 | Main.cs
171 |
172 |
173 | TransparencySettings.cs
174 |
175 |
176 | ColorSortSettings.cs
177 |
178 |
179 | ColorSortManual.cs
180 |
181 |
182 | ResXFileCodeGenerator
183 | Resources.Designer.cs
184 | Designer
185 |
186 |
187 | True
188 | Resources.resx
189 | True
190 |
191 |
192 | Preview.cs
193 |
194 |
195 |
196 |
197 | SettingsSingleFileGenerator
198 | Settings.Designer.cs
199 |
200 |
201 | True
202 | Settings.settings
203 | True
204 |
205 |
206 |
207 |
208 |
209 |
210 | False
211 | .NET Framework 3.5 SP1 Client Profile
212 | false
213 |
214 |
215 | False
216 | .NET Framework 3.5 SP1
217 | true
218 |
219 |
220 | False
221 | Windows Installer 3.1
222 | true
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
237 |
--------------------------------------------------------------------------------
/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 0
12 |
13 |
14 | 0
15 |
16 |
17 | True
18 |
19 |
20 | False
21 |
22 |
23 | False
24 |
25 |
26 | True
27 |
28 |
29 | False
30 |
31 |
32 | True
33 |
34 |
35 | False
36 |
37 |
38 | 0
39 |
40 |
41 | 0
42 |
43 |
44 | 0
45 |
46 |
47 | True
48 |
49 |
50 | False
51 |
52 |
53 | False
54 |
55 |
56 | 0
57 |
58 |
59 | 0
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VitorVilela7/SnesGFX/7cdb6f7b9c02831966c0396d443a45d89c2d0b68/icon.ico
--------------------------------------------------------------------------------
/snesgfx.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VitorVilela7/SnesGFX/7cdb6f7b9c02831966c0396d443a45d89c2d0b68/snesgfx.ico
--------------------------------------------------------------------------------