This commit is contained in:
mkwong98 2018-03-03 03:00:35 +08:00
parent 93e6ce73fb
commit f19304628a
15 changed files with 5591 additions and 2474 deletions

View file

@ -8,5 +8,6 @@ class image;
class condition;
class gameTile;
class tileReference;
class paletteSwap;
#endif // CLASSLIST_H_INCLUDED

View file

@ -6,6 +6,7 @@
#include <string>
#include <iostream>
#include <vector>
#include <array>
#include <iomanip>
#include <wx/image.h>

View file

@ -1,5 +1,6 @@
#include "gameObjNode.h"
#include "gameTile.h"
#include "paletteSwap.h"
#include "main.h"
#include "hdnesPackEditormainForm.h"
@ -28,6 +29,10 @@ void gameObjNode::addTile(gameTile g){
addToObjectSize(tiles.size() - 1);
}
void gameObjNode::addSwap(paletteSwap g){
swaps.push_back(g);
}
void gameObjNode::addToObjectSize(int gIdx){
x1 = min(x1, tiles[gIdx].objCoordX);
x2 = max(x2, tiles[gIdx].objCoordX + 8);
@ -52,6 +57,7 @@ void gameObjNode::load(fstream& file, wxTreeItemId newItm){
string lineHdr;
string lineTail;
gameTile g;
paletteSwap p;
getline(file, line);
while(line != "<endGameObject>"){
@ -81,10 +87,21 @@ void gameObjNode::load(fstream& file, wxTreeItemId newItm){
else if(lineHdr == "<tiles>"){
getline(file, line);
while(line != "<endTiles>"){
g = gameTile();
g.load(file);
addTile(g);
getline(file, line);
}
updatePalettes();
}
else if(lineHdr == "<swaps>"){
getline(file, line);
while(line != "<endSwaps>"){
p = paletteSwap();
p.load(file);
addSwap(p);
getline(file, line);
}
}
}
getline(file, line);
@ -108,6 +125,12 @@ void gameObjNode::save(fstream& file, wxTreeItemId newItm){
tiles[i].save(file);
}
file << "<endTiles>\n";
file << "<swaps>\n";
for(int i = 0; i < swaps.size(); ++i){
swaps[i].save(file);
}
file << "<endSwaps>\n";
}
else{
file << "<childObjects>\n";
@ -117,3 +140,25 @@ void gameObjNode::save(fstream& file, wxTreeItemId newItm){
file << "<endGameObject>\n";
}
void gameObjNode::updatePalettes(){
array<Uint8, 4> p;
bool paletteFound;
palettes.clear();
for(int i = 0; i < tiles.size(); ++i){
paletteFound = false;
for(int j = 0; j < palettes.size(); ++j){
if(palettes[j][0] == tiles[i].id.palette[0] && palettes[j][1] == tiles[i].id.palette[1] && palettes[j][2] == tiles[i].id.palette[2] && palettes[j][3] == tiles[i].id.palette[3]){
paletteFound = true;
}
}
if(!paletteFound){
p[0] = tiles[i].id.palette[0];
p[1] = tiles[i].id.palette[1];
p[2] = tiles[i].id.palette[2];
p[3] = tiles[i].id.palette[3];
palettes.push_back(p);
}
}
}

View file

@ -38,12 +38,16 @@ class gameObjNode : public wxTreeItemData
float brightness;
vector<gameTile> tiles;
vector<paletteSwap> swaps;
vector<array<Uint8, 4>> palettes;
void addTile(gameTile g);
void addToObjectSize(int gIdx);
void clearAllTiles();
void addSwap(paletteSwap g);
void load(fstream& file, wxTreeItemId newItm);
void save(fstream& file, wxTreeItemId newItm);
void updatePalettes();
protected:
private:

View file

@ -9,7 +9,7 @@
<Target title="Debug">
<Option output="bin/Debug/hdnesPackEditor" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
@ -73,6 +73,8 @@
<Unit filename="main.h" />
<Unit filename="mainForm.cpp" />
<Unit filename="mainForm.h" />
<Unit filename="paletteSwap.cpp" />
<Unit filename="paletteSwap.h" />
<Unit filename="tileReference.cpp" />
<Unit filename="tileReference.h" />
<Extensions>

View file

@ -1,13 +1,13 @@
# depslib dependency file v1.0
1519050096 source:c:\work\hdnesr\trunk\hdnespackeditor\main.cpp
1519727291 source:c:\work\hdnesr\trunk\hdnespackeditor\main.cpp
"common.h"
"hdnesPackEditormainForm.h"
"main.h"
1519359034 source:c:\work\hdnesr\trunk\hdnespackeditor\mainform.cpp
1519960893 source:c:\work\hdnesr\trunk\hdnespackeditor\mainform.cpp
"mainForm.h"
1519359034 c:\work\hdnesr\trunk\hdnespackeditor\mainform.h
1519959041 c:\work\hdnesr\trunk\hdnespackeditor\mainform.h
<wx/artprov.h>
<wx/xrc/xmlres.h>
<wx/string.h>
@ -23,16 +23,15 @@
<wx/treectrl.h>
<wx/sizer.h>
<wx/panel.h>
<wx/stattext.h>
<wx/spinctrl.h>
<wx/radiobut.h>
<wx/stattext.h>
<wx/button.h>
<wx/slider.h>
<wx/spinctrl.h>
<wx/scrolbar.h>
<wx/splitter.h>
<wx/listctrl.h>
<wx/textctrl.h>
<wx/notebook.h>
<wx/splitter.h>
<wx/frame.h>
<wx/filepicker.h>
<wx/dialog.h>
@ -2136,7 +2135,7 @@
"begin_code.h"
"close_code.h"
1519374277 source:c:\work\hdnesr\trunk\hdnespackeditor\hdnespackeditormainform.cpp
1519981816 source:c:\work\hdnesr\trunk\hdnespackeditor\hdnespackeditormainform.cpp
"hdnesPackEditormainForm.h"
"hdnesPackEditornewProjectDialog.h"
"hdnesPackEditorcolourSelectDialog.h"
@ -2148,14 +2147,16 @@
<wx/clipbrd.h>
"gameObjNode.h"
"image.h"
"paletteSwap.h"
1519379405 c:\work\hdnesr\trunk\hdnespackeditor\hdnespackeditormainform.h
1519981567 c:\work\hdnesr\trunk\hdnespackeditor\hdnespackeditormainform.h
"common.h"
"mainForm.h"
"colourDialogClient.h"
"gameObjNode.h"
"classList.h"
1519050096 c:\work\hdnesr\trunk\hdnespackeditor\main.h
1519727167 c:\work\hdnesr\trunk\hdnespackeditor\main.h
"common.h"
<wx\wx.h>
<SDL2\SDL.h>
@ -3490,17 +3491,18 @@
"classList.h"
<wx/wx.h>
1512179199 c:\work\hdnesr\trunk\hdnespackeditor\common.h
1519723156 c:\work\hdnesr\trunk\hdnespackeditor\common.h
<fstream>
<sstream>
<string>
<iostream>
<vector>
<array>
<iomanip>
<wx/image.h>
<SDL2/SDL.h>
1515739277 c:\work\hdnesr\trunk\hdnespackeditor\classlist.h
1519722010 c:\work\hdnesr\trunk\hdnespackeditor\classlist.h
1504597737 c:\work\hdnesr\trunk\hdnespackeditor\hdnespackeditornewprojectdialog.h
"mainForm.h"
@ -3669,7 +3671,7 @@
"wx/grid.h"
"wx/datetime.h"
1517994036 source:c:\work\hdnesr\trunk\hdnespackeditor\hdnespackeditorcolourselectdialog.cpp
1519956546 source:c:\work\hdnesr\trunk\hdnespackeditor\hdnespackeditorcolourselectdialog.cpp
"common.h"
"hdnesPackEditorcolourSelectDialog.h"
"coreData.h"
@ -3811,13 +3813,14 @@
"wx/window.h"
"wx/containr.h"
1519360541 source:c:\work\hdnesr\trunk\hdnespackeditor\gameobjnode.cpp
1519979097 source:c:\work\hdnesr\trunk\hdnespackeditor\gameobjnode.cpp
"gameObjNode.h"
"gameTile.h"
"paletteSwap.h"
"main.h"
"hdnesPackEditormainForm.h"
1519360410 c:\work\hdnesr\trunk\hdnespackeditor\gameobjnode.h
1519726054 c:\work\hdnesr\trunk\hdnespackeditor\gameobjnode.h
"common.h"
"gameTile.h"
<wx/treebase.h>
@ -3899,3 +3902,10 @@
"mainForm.h"
"gameTile.h"
1519724692 c:\work\hdnesr\trunk\hdnespackeditor\paletteswap.h
"common.h"
1520007787 source:c:\work\hdnesr\trunk\hdnespackeditor\paletteswap.cpp
"paletteSwap.h"
"main.h"

File diff suppressed because it is too large Load diff

View file

@ -2,461 +2,19 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="colourDialogClient.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="tileReference.h" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="235" topLine="0" />
<Cursor1 position="247" topLine="6" />
</Cursor>
</File>
<File name="condition.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="condition.h" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2527" topLine="68" />
<Cursor1 position="444" topLine="9" />
</Cursor>
</File>
<File name="common.h" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="coreData.cpp" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="226" topLine="0" />
</Cursor>
</File>
<File name="hdnesPackEditormainForm.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="10394" topLine="82" />
</Cursor>
<Folding>
<Collapse line="34" />
<Collapse line="35" />
<Collapse line="37" />
<Collapse line="49" />
<Collapse line="59" />
<Collapse line="62" />
<Collapse line="72" />
<Collapse line="77" />
<Collapse line="86" />
<Collapse line="87" />
<Collapse line="90" />
<Collapse line="93" />
<Collapse line="98" />
<Collapse line="104" />
<Collapse line="109" />
<Collapse line="111" />
<Collapse line="112" />
<Collapse line="120" />
<Collapse line="121" />
<Collapse line="125" />
<Collapse line="129" />
<Collapse line="134" />
<Collapse line="138" />
<Collapse line="143" />
<Collapse line="147" />
<Collapse line="151" />
<Collapse line="152" />
<Collapse line="183" />
<Collapse line="184" />
<Collapse line="192" />
<Collapse line="202" />
<Collapse line="203" />
<Collapse line="207" />
<Collapse line="211" />
<Collapse line="212" />
<Collapse line="215" />
<Collapse line="220" />
<Collapse line="228" />
<Collapse line="237" />
<Collapse line="242" />
<Collapse line="256" />
<Collapse line="262" />
<Collapse line="263" />
<Collapse line="267" />
<Collapse line="271" />
<Collapse line="275" />
<Collapse line="281" />
<Collapse line="305" />
<Collapse line="306" />
<Collapse line="311" />
<Collapse line="321" />
<Collapse line="325" />
<Collapse line="329" />
<Collapse line="333" />
<Collapse line="334" />
<Collapse line="339" />
<Collapse line="340" />
<Collapse line="345" />
<Collapse line="346" />
<Collapse line="351" />
<Collapse line="361" />
<Collapse line="366" />
<Collapse line="369" />
<Collapse line="374" />
<Collapse line="377" />
<Collapse line="382" />
<Collapse line="385" />
<Collapse line="408" />
<Collapse line="412" />
<Collapse line="420" />
<Collapse line="421" />
<Collapse line="422" />
<Collapse line="424" />
<Collapse line="439" />
<Collapse line="444" />
<Collapse line="453" />
<Collapse line="465" />
<Collapse line="470" />
<Collapse line="493" />
<Collapse line="511" />
<Collapse line="512" />
<Collapse line="513" />
<Collapse line="524" />
<Collapse line="525" />
<Collapse line="526" />
<Collapse line="539" />
<Collapse line="540" />
<Collapse line="541" />
<Collapse line="543" />
<Collapse line="546" />
<Collapse line="547" />
<Collapse line="552" />
<Collapse line="566" />
<Collapse line="568" />
<Collapse line="572" />
<Collapse line="574" />
<Collapse line="577" />
<Collapse line="578" />
<Collapse line="585" />
<Collapse line="591" />
<Collapse line="600" />
<Collapse line="604" />
<Collapse line="607" />
<Collapse line="617" />
<Collapse line="623" />
<Collapse line="624" />
<Collapse line="628" />
<Collapse line="630" />
<Collapse line="635" />
<Collapse line="642" />
<Collapse line="643" />
<Collapse line="650" />
<Collapse line="671" />
<Collapse line="686" />
<Collapse line="687" />
<Collapse line="694" />
<Collapse line="697" />
<Collapse line="707" />
<Collapse line="710" />
<Collapse line="712" />
<Collapse line="719" />
<Collapse line="727" />
<Collapse line="731" />
<Collapse line="734" />
<Collapse line="738" />
<Collapse line="740" />
<Collapse line="743" />
<Collapse line="753" />
<Collapse line="761" />
<Collapse line="764" />
<Collapse line="817" />
<Collapse line="824" />
<Collapse line="831" />
<Collapse line="836" />
<Collapse line="842" />
<Collapse line="847" />
<Collapse line="853" />
<Collapse line="855" />
<Collapse line="861" />
<Collapse line="865" />
<Collapse line="869" />
<Collapse line="870" />
<Collapse line="873" />
<Collapse line="881" />
<Collapse line="885" />
<Collapse line="892" />
<Collapse line="897" />
<Collapse line="902" />
<Collapse line="913" />
<Collapse line="923" />
<Collapse line="925" />
<Collapse line="935" />
<Collapse line="937" />
<Collapse line="938" />
<Collapse line="941" />
<Collapse line="947" />
<Collapse line="951" />
<Collapse line="965" />
<Collapse line="969" />
<Collapse line="985" />
<Collapse line="986" />
<Collapse line="989" />
<Collapse line="992" />
<Collapse line="994" />
<Collapse line="1008" />
<Collapse line="1015" />
<Collapse line="1020" />
<Collapse line="1021" />
<Collapse line="1024" />
<Collapse line="1035" />
<Collapse line="1044" />
<Collapse line="1055" />
<Collapse line="1072" />
<Collapse line="1073" />
<Collapse line="1074" />
<Collapse line="1087" />
<Collapse line="1110" />
<Collapse line="1111" />
<Collapse line="1121" />
<Collapse line="1122" />
<Collapse line="1126" />
<Collapse line="1128" />
<Collapse line="1129" />
<Collapse line="1146" />
<Collapse line="1152" />
<Collapse line="1166" />
<Collapse line="1169" />
<Collapse line="1172" />
<Collapse line="1174" />
<Collapse line="1183" />
<Collapse line="1195" />
<Collapse line="1198" />
<Collapse line="1211" />
<Collapse line="1225" />
<Collapse line="1240" />
<Collapse line="1247" />
<Collapse line="1252" />
<Collapse line="1259" />
<Collapse line="1267" />
<Collapse line="1274" />
<Collapse line="1277" />
<Collapse line="1279" />
<Collapse line="1280" />
<Collapse line="1283" />
<Collapse line="1286" />
<Collapse line="1292" />
<Collapse line="1304" />
<Collapse line="1305" />
<Collapse line="1308" />
<Collapse line="1314" />
<Collapse line="1332" />
<Collapse line="1341" />
<Collapse line="1344" />
<Collapse line="1351" />
<Collapse line="1368" />
<Collapse line="1383" />
<Collapse line="1394" />
<Collapse line="1405" />
<Collapse line="1421" />
<Collapse line="1455" />
<Collapse line="1461" />
<Collapse line="1484" />
<Collapse line="1490" />
<Collapse line="1497" />
<Collapse line="1505" />
<Collapse line="1513" />
<Collapse line="1514" />
<Collapse line="1519" />
<Collapse line="1532" />
<Collapse line="1544" />
<Collapse line="1545" />
<Collapse line="1610" />
<Collapse line="1611" />
<Collapse line="1621" />
<Collapse line="1622" />
<Collapse line="1628" />
<Collapse line="1629" />
<Collapse line="1635" />
<Collapse line="1638" />
<Collapse line="1646" />
<Collapse line="1655" />
<Collapse line="1658" />
<Collapse line="1661" />
<Collapse line="1666" />
<Collapse line="1669" />
<Collapse line="1673" />
<Collapse line="1678" />
<Collapse line="1681" />
<Collapse line="1686" />
<Collapse line="1689" />
<Collapse line="1695" />
<Collapse line="1699" />
<Collapse line="1704" />
<Collapse line="1707" />
<Collapse line="1713" />
<Collapse line="1718" />
<Collapse line="1721" />
<Collapse line="1727" />
<Collapse line="1729" />
<Collapse line="1730" />
<Collapse line="1737" />
<Collapse line="1741" />
<Collapse line="1744" />
<Collapse line="1750" />
<Collapse line="1752" />
<Collapse line="1753" />
<Collapse line="1754" />
<Collapse line="1757" />
<Collapse line="1765" />
<Collapse line="1772" />
<Collapse line="1775" />
<Collapse line="1781" />
<Collapse line="1783" />
<Collapse line="1784" />
<Collapse line="1792" />
<Collapse line="1796" />
<Collapse line="1799" />
<Collapse line="1805" />
<Collapse line="1810" />
<Collapse line="1812" />
<Collapse line="1813" />
<Collapse line="1816" />
<Collapse line="1824" />
<Collapse line="1827" />
<Collapse line="1833" />
<Collapse line="1834" />
<Collapse line="1847" />
<Collapse line="1850" />
<Collapse line="1859" />
<Collapse line="1865" />
<Collapse line="1872" />
<Collapse line="1874" />
<Collapse line="1877" />
<Collapse line="1878" />
<Collapse line="1879" />
<Collapse line="1880" />
<Collapse line="1881" />
<Collapse line="1891" />
<Collapse line="1894" />
<Collapse line="1907" />
<Collapse line="1922" />
<Collapse line="1923" />
<Collapse line="1944" />
<Collapse line="1965" />
<Collapse line="1973" />
<Collapse line="1975" />
<Collapse line="1977" />
<Collapse line="1985" />
<Collapse line="1991" />
<Collapse line="1992" />
<Collapse line="1997" />
<Collapse line="2000" />
<Collapse line="2002" />
<Collapse line="2003" />
<Collapse line="2004" />
<Collapse line="2007" />
<Collapse line="2009" />
<Collapse line="2027" />
<Collapse line="2031" />
<Collapse line="2034" />
<Collapse line="2036" />
<Collapse line="2047" />
<Collapse line="2048" />
<Collapse line="2049" />
<Collapse line="2065" />
<Collapse line="2070" />
<Collapse line="2071" />
<Collapse line="2074" />
<Collapse line="2087" />
<Collapse line="2099" />
<Collapse line="2100" />
<Collapse line="2102" />
<Collapse line="2109" />
<Collapse line="2110" />
<Collapse line="2116" />
<Collapse line="2117" />
<Collapse line="2127" />
<Collapse line="2132" />
<Collapse line="2133" />
<Collapse line="2141" />
<Collapse line="2149" />
<Collapse line="2152" />
<Collapse line="2154" />
<Collapse line="2155" />
<Collapse line="2165" />
<Collapse line="2171" />
<Collapse line="2189" />
<Collapse line="2191" />
<Collapse line="2192" />
<Collapse line="2198" />
<Collapse line="2199" />
<Collapse line="2209" />
<Collapse line="2213" />
<Collapse line="2220" />
<Collapse line="2221" />
</Folding>
</File>
<File name="hdnesPackEditorreplacementDialog.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1177" topLine="27" />
</Cursor>
</File>
<File name="tileReference.h" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="397" topLine="4" />
</Cursor>
</File>
<File name="image.cpp" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="303" topLine="0" />
</Cursor>
</File>
<File name="main.h" open="1" top="0" tabpos="15" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="338" topLine="12" />
</Cursor>
</File>
<File name="image.h" open="1" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="249" topLine="1" />
</Cursor>
</File>
<File name="mainForm.cpp" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="34741" topLine="537" />
</Cursor>
</File>
<File name="main.cpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1007" topLine="28" />
</Cursor>
</File>
<File name="tileReference.cpp" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="209" topLine="0" />
</Cursor>
</File>
<File name="classList.h" open="0" top="0" tabpos="20" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="174" topLine="0" />
</Cursor>
</File>
<File name="hdnesPackEditorcolourSelectDialog.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3777" topLine="97" />
</Cursor>
</File>
<File name="coreData.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1106" topLine="42" />
</Cursor>
</File>
<File name="mainForm.h" open="1" top="0" tabpos="16" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="4216" topLine="118" />
</Cursor>
</File>
<File name="gameTile.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="398" topLine="12" />
</Cursor>
</File>
<File name="hdnesPackEditornewProjectDialog.cpp" open="0" top="0" tabpos="16" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="996" topLine="21" />
</Cursor>
</File>
<File name="hdnesPackEditornewProjectDialog.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="229" topLine="7" />
</Cursor>
</File>
<File name="coreData.cpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="10955" topLine="330" />
<Cursor1 position="11077" topLine="59" />
</Cursor>
<Folding>
<Collapse line="10" />
@ -466,21 +24,110 @@
<Collapse line="30" />
<Collapse line="36" />
<Collapse line="42" />
<Collapse line="47" />
<Collapse line="61" />
<Collapse line="62" />
<Collapse line="63" />
<Collapse line="66" />
<Collapse line="69" />
<Collapse line="76" />
<Collapse line="79" />
<Collapse line="82" />
<Collapse line="85" />
<Collapse line="88" />
<Collapse line="91" />
<Collapse line="94" />
<Collapse line="97" />
<Collapse line="102" />
<Collapse line="105" />
<Collapse line="107" />
<Collapse line="108" />
<Collapse line="109" />
<Collapse line="117" />
<Collapse line="120" />
<Collapse line="123" />
<Collapse line="126" />
<Collapse line="130" />
<Collapse line="134" />
</Folding>
</File>
<File name="condition.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="gameObjNode.h" open="0" top="0" tabpos="19" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="444" topLine="9" />
<Cursor1 position="1356" topLine="32" />
</Cursor>
</File>
<File name="gameObjNode.h" open="1" top="0" tabpos="19" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="condition.cpp" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="905" topLine="31" />
<Cursor1 position="128" topLine="3" />
</Cursor>
<Folding>
<Collapse line="6" />
<Collapse line="11" />
<Collapse line="15" />
</Folding>
</File>
<File name="gameTile.cpp" open="0" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="902" topLine="51" />
</Cursor>
</File>
<File name="gameTile.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="gameObjNode.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="794" topLine="21" />
<Cursor1 position="2328" topLine="84" />
</Cursor>
</File>
<File name="colourDialogClient.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="235" topLine="0" />
</Cursor>
</File>
<File name="hdnesPackEditorcolourSelectDialog.cpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3939" topLine="99" />
</Cursor>
</File>
<File name="hdnesPackEditormainForm.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="9496" topLine="237" />
</Cursor>
</File>
<File name="hdnesPackEditorreplacementDialog.cpp" open="0" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="-1" zoom_2="0">
<Cursor>
<Cursor1 position="2646" topLine="41" />
</Cursor>
<Folding>
<Collapse line="35" />
<Collapse line="47" />
</Folding>
</File>
<File name="image.cpp" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="303" topLine="0" />
</Cursor>
</File>
<File name="image.h" open="0" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="249" topLine="0" />
</Cursor>
</File>
<File name="main.h" open="0" top="0" tabpos="15" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="482" topLine="10" />
</Cursor>
</File>
<File name="hdnesPackEditornewProjectDialog.cpp" open="0" top="0" tabpos="16" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="996" topLine="21" />
</Cursor>
</File>
<File name="classList.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="202" topLine="0" />
</Cursor>
</File>
<File name="mainForm.h" open="0" top="0" tabpos="16" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6561" topLine="152" />
</Cursor>
</File>
<File name="hdnesPackEditorcolourSelectDialog.h" open="0" top="0" tabpos="25" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@ -488,23 +135,89 @@
<Cursor1 position="382" topLine="9" />
</Cursor>
</File>
<File name="hdnesPackEditormainForm.h" open="1" top="1" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="hdnesPackEditormainForm.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="4597" topLine="119" />
</Cursor>
</File>
<File name="gameObjNode.cpp" open="1" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2700" topLine="95" />
</Cursor>
</File>
<File name="hdnesPackEditorreplacementDialog.cpp" open="1" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="-1" zoom_2="0">
<Cursor>
<Cursor1 position="2646" topLine="54" />
<Cursor1 position="47786" topLine="134" />
</Cursor>
<Folding>
<Collapse line="35" />
<Collapse line="47" />
<Collapse line="16" />
<Collapse line="31" />
<Collapse line="32" />
<Collapse line="34" />
<Collapse line="46" />
<Collapse line="56" />
<Collapse line="59" />
<Collapse line="69" />
<Collapse line="74" />
<Collapse line="83" />
<Collapse line="84" />
<Collapse line="87" />
<Collapse line="90" />
<Collapse line="95" />
<Collapse line="101" />
<Collapse line="106" />
<Collapse line="108" />
<Collapse line="109" />
<Collapse line="117" />
<Collapse line="118" />
<Collapse line="122" />
<Collapse line="126" />
<Collapse line="131" />
<Collapse line="135" />
<Collapse line="140" />
<Collapse line="144" />
<Collapse line="148" />
<Collapse line="152" />
</Folding>
</File>
<File name="coreData.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="42" topLine="0" />
</Cursor>
</File>
<File name="hdnesPackEditornewProjectDialog.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="229" topLine="7" />
</Cursor>
</File>
<File name="gameTile.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="572" topLine="7" />
</Cursor>
</File>
<File name="hdnesPackEditorreplacementDialog.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1177" topLine="27" />
</Cursor>
</File>
<File name="paletteSwap.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="71" topLine="3" />
</Cursor>
</File>
<File name="mainForm.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="53767" topLine="929" />
</Cursor>
</File>
<File name="tileReference.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="866" topLine="56" />
</Cursor>
</File>
<File name="main.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="995" topLine="97" />
</Cursor>
</File>
<File name="paletteSwap.cpp" open="1" top="1" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1902" topLine="49" />
</Cursor>
</File>
<File name="common.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="171" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>

View file

@ -83,6 +83,7 @@ void hdnesPackEditorcolourSelectDialog::colourSelectInit( wxInitDialogEvent& eve
{
for(int i = 0; i < 64; ++i){
colourPanels[i]->SetBackgroundColour(coreData::cData->palette[i]);
colourPanels[i]->Refresh();
}
}

View file

@ -9,6 +9,7 @@
#include <wx/clipbrd.h>
#include "gameObjNode.h"
#include "image.h"
#include "paletteSwap.h"
hdnesPackEditormainForm::hdnesPackEditormainForm( wxWindow* parent )
:
@ -19,10 +20,6 @@ mainForm( parent )
initGeneral();
initHDImg();
int widths[1];
widths[0] = 500;
m_statusBar->SetStatusWidths(1, widths);
//load config
string configPath;
configPath = main::exeDir + string("\\config.txt");
@ -150,6 +147,9 @@ void hdnesPackEditormainForm::MenuFileExit( wxCommandEvent& event ){
}
void hdnesPackEditormainForm::colourSelected(Uint8 selectedColour){
wxTreeItemId tID;
gameObjNode* data;
switch(colourSelectSource){
case COLOUR_CLIENT_ROM_VIEW_BG:
romViewColours[0] = selectedColour;
@ -172,12 +172,28 @@ void hdnesPackEditormainForm::colourSelected(Uint8 selectedColour){
refreshROMView();
break;
case COLOUR_CLIENT_GAME_OBJ_BG:
wxTreeItemId tID = treeGameObjs->GetFocusedItem();
gameObjNode* data = (gameObjNode*)(treeGameObjs->GetItemData(tID));
tID = treeGameObjs->GetFocusedItem();
data = (gameObjNode*)(treeGameObjs->GetItemData(tID));
data->bgColour = selectedColour;
refreshGameObj();
coreData::cData->dataChanged();
break;
case COLOUR_CLIENT_NEW_SWAP_BG:
swapNewColours[0] = selectedColour;
updateNewSwapText();
break;
case COLOUR_CLIENT_NEW_SWAP_1:
swapNewColours[1] = selectedColour;
updateNewSwapText();
break;
case COLOUR_CLIENT_NEW_SWAP_2:
swapNewColours[2] = selectedColour;
updateNewSwapText();
break;
case COLOUR_CLIENT_NEW_SWAP_3:
swapNewColours[3] = selectedColour;
updateNewSwapText();
break;
}
}
@ -667,6 +683,15 @@ void hdnesPackEditormainForm::initGameObjs(){
gameObjRawImageDisplay = wxImage(pnlGameObjRaw->GetSize().x, pnlGameObjRaw->GetSize().y);
gameObjNewImageDisplay = wxImage(pnlGameObjNew->GetSize().x, pnlGameObjNew->GetSize().y);
gameObjBaseTile = wxImage(8, 8);
lstSwaps->AppendColumn(wxString("Name"));
lstSwaps->AppendColumn(wxString("New palettes"));
lstSwaps->AppendColumn(wxString("New brightness %"));
lstSwaps->AppendColumn(wxString("Rotate hue degrees"));
lstSwaps->AppendColumn(wxString("New saturation %"));
lstPalettes->AppendColumn(wxString("Original palette"));
lstPalettes->AppendColumn(wxString("New Palette"));
}
void hdnesPackEditormainForm::gameObjsROMChanged(){
@ -965,13 +990,13 @@ void hdnesPackEditormainForm::gameObjsRawMenu( wxCommandEvent& event ){
//set bg colour this is the first tiles to be added
if(ndata->tiles.size() == 0 && gameObjPasteData.tiles[0].id.palette[0] < 64 && !ndata->isSprite){
ndata->bgColour = gameObjPasteData.tiles[0].id.palette[0];
}
for(int i = 0; i < gameObjPasteData.tiles.size(); ++i){
gameObjPasteData.tiles[i].objCoordX += gameObjRawCurrPos.x;
gameObjPasteData.tiles[i].objCoordY += gameObjRawCurrPos.y;
ndata->addTile(gameObjPasteData.tiles[i]);
}
ndata->updatePalettes();
gameObjPasteData.clearAllTiles();
refreshGameObj();
coreData::cData->dataChanged();
@ -1026,6 +1051,7 @@ void hdnesPackEditormainForm::gameObjsRawMenu( wxCommandEvent& event ){
++i;
}
}
ndata->updatePalettes();
gameObjSelectedTiles.clear();
refreshGameObj();
coreData::cData->dataChanged();
@ -1188,8 +1214,7 @@ void hdnesPackEditormainForm::refreshGameObj(){
rbnObjectSprite->SetValue(ndata->isSprite);
rbnObjectBG->SetValue(!ndata->isSprite);
dialReplaceBrightness->SetValue(ndata->brightness * 100);
lblReplaceBrightness->SetLabel(wxString(main::intToStr(dialReplaceBrightness->GetValue()).c_str()));
spnBrightness->SetValue(ndata->brightness * 100);
//refresh bg colour button
btnGameObjBGColour->SetBackgroundColour(coreData::cData->palette[ndata->bgColour]);
@ -1207,6 +1232,26 @@ void hdnesPackEditormainForm::refreshGameObj(){
drawGameObj();
adjustGameObjSize();
drawGameObjEdits();
loadSwaps();
}
void hdnesPackEditormainForm::loadSwaps(){
gameObjNode* ndata = getGameObjsSelectedObjectTreeNode();
if(!ndata) return;
//add palette swaps
long j;
lstSwaps->DeleteAllItems();
for(int i = 0; i < ndata->swaps.size(); ++i){
j = lstSwaps->InsertItem(i, wxString(ndata->swaps[i].name.c_str()), 0);
lstSwaps->SetItem(j, 1, wxString(main::paletteToStr(ndata->swaps[i].newPalettes).c_str()));
lstSwaps->SetItem(j, 2, wxString(main::intToStr(ndata->swaps[i].brightness * 100).c_str()));
lstSwaps->SetItem(j, 3, wxString(main::intToStr(ndata->swaps[i].hueRotation * 360).c_str()));
lstSwaps->SetItem(j, 4, wxString(main::intToStr(ndata->swaps[i].saturation * 100).c_str()));
}
selectedSwap = -1;
showSwap();
}
void hdnesPackEditormainForm::clearGameObj(){
@ -1512,9 +1557,14 @@ void hdnesPackEditormainForm::gameObjBGClicked( wxCommandEvent& event ){
}
void hdnesPackEditormainForm::gameObjBGColour( wxCommandEvent& event ){
if(getGameObjsSelectedObjectTreeNode()){
gameObjNode* ndata = getGameObjsSelectedObjectTreeNode();
if(!ndata) return;
if(ndata->isSprite){
openColourDialog(COLOUR_CLIENT_GAME_OBJ_BG);
}
else{
wxMessageBox("Only background color of sprite objects can be changed.", "Action invalid", wxICON_ERROR);
}
}
void hdnesPackEditormainForm::gameObjsRawMove( wxMouseEvent& event ){
@ -1582,7 +1632,7 @@ void hdnesPackEditormainForm::gameObjsRawLUp( wxMouseEvent& event ){
&& ld.x >= ndata->tiles[i].objCoordX
&& ld.y <= ndata->tiles[i].objCoordY + 8
&& ld.y >= ndata->tiles[i].objCoordY){
m_statusBar->SetStatusText(wxString((ndata->tiles[i].id.writeID() + ", " + ndata->tiles[i].id.writePalette()).c_str()));
m_statusBar->SetLabel(wxString((ndata->tiles[i].id.writeID() + ", " + ndata->tiles[i].id.writePalette()).c_str()));
}
if(corner1.x <= ndata->tiles[i].objCoordX + 8
&& corner2.x >= ndata->tiles[i].objCoordX
@ -1647,8 +1697,7 @@ void hdnesPackEditormainForm::zoomGameObjsChanged( wxSpinEvent& event ){
void hdnesPackEditormainForm::replaceBrightnessChanged( wxScrollEvent& event ){
gameObjNode* ndata = getGameObjsSelectedObjectTreeNode();
if(ndata){
ndata->brightness = (float)dialReplaceBrightness->GetValue() / 100.0;
lblReplaceBrightness->SetLabel(wxString(main::intToStr(dialReplaceBrightness->GetValue()).c_str()));
ndata->brightness = (float)spnBrightness->GetValue() / 100.0;
dataChanged();
}
}
@ -1763,6 +1812,20 @@ void hdnesPackEditormainForm::removeChildGameObjItemImage(wxTreeItemId item, int
removeChildGameObjImage(item, index);
}
void hdnesPackEditormainForm::applySwap(Uint8* palette, paletteSwap& s){
for(int i = 0; i < s.orgPalettes.size(); ++i){
if(palette[0] == s.orgPalettes[i][0]
&& palette[1] == s.orgPalettes[i][1]
&& palette[2] == s.orgPalettes[i][2]
&& palette[3] == s.orgPalettes[i][3]){
palette[0] = s.newPalettes[i][0];
palette[1] = s.newPalettes[i][1];
palette[2] = s.newPalettes[i][2];
palette[3] = s.newPalettes[i][3];
}
}
}
void hdnesPackEditormainForm::genGameObjsConditionPack(fstream& file){
genGameObjItemConditionPack(file, tItmGameObjRoot);
gameObjectGenImageCnt = 0;
@ -1785,6 +1848,12 @@ void hdnesPackEditormainForm::genGameObjItemConditionPack(fstream& file, wxTreeI
for(int j = 0; j < node->tiles[i].conditions.size(); ++j){
node->tiles[i].conditions[j].conditionType = (node->isSprite ? "spriteNearby" : "tileNearby");
file << "<condition>" << node->tiles[i].conditions[j].writeLine() << "\n";
for(int k = 0; k < node->swaps.size(); ++k){
condition tmpC = node->tiles[i].conditions[j];
applySwap(tmpC.id.palette, node->swaps[k]);
tmpC.name = tmpC.name + "_" + main::intToStr(k);
file << "<condition>" << tmpC.writeLine() << "\n";
}
}
}
genChildGameObjsConditionPack(file, item);
@ -1805,60 +1874,14 @@ void hdnesPackEditormainForm::genChildGameObjsTilePack(fstream& file, wxTreeItem
void hdnesPackEditormainForm::genGameObjItemTilePack(fstream& file, wxTreeItemId item, bool withCondition){
gameObjNode* node = (gameObjNode*)(treeGameObjs->GetItemData(item));
wxImage tmp;
gameTile newTile;
int replaceSize = 8 * coreData::cData->scale;
for(int i = 0; i < node->tiles.size(); ++i){
node->tiles[i].brightness = node->brightness;
if(node->tiles[i].hasReplacement && (withCondition == (node->tiles[i].conditions.size() > 0))){
if(node->isSprite && (node->tiles[i].hFlip || node->tiles[i].vFlip)){
//generate mirrored tile
//create if not yet
if(gameObjectGenImageX == 0 && gameObjectGenImageY == 0){
gameObjectGenImage = wxImage(32 * replaceSize, 32 * replaceSize, true);
gameObjectGenImage.InitAlpha();
memset(gameObjectGenImage.GetAlpha(), 0, 32 * replaceSize * 32 * replaceSize);
file << "<img>editorGenImage" + main::intToStr(gameObjectGenImageCnt) + ".png\n";
}
//add flipped tile to image
tmp = coreData::cData->images[node->tiles[i].img]->imageData.GetSubImage(wxRect(node->tiles[i].x, node->tiles[i].y, replaceSize, replaceSize));
if(node->tiles[i].hFlip){
tmp = tmp.Mirror(true);
}
if(node->tiles[i].vFlip){
tmp = tmp.Mirror(false);
}
//copy pixel data
gameObjectGenImage.Paste(tmp, gameObjectGenImageX * replaceSize, gameObjectGenImageY * replaceSize);
//copy alpha data
for(int dx = 0; dx < replaceSize; ++dx){
for(int dy = 0; dy < replaceSize; ++dy){
gameObjectGenImage.SetAlpha(gameObjectGenImageX * replaceSize + dx, gameObjectGenImageY * replaceSize + dy, tmp.GetAlpha(dx, dy));
}
}
//create tmp tile
newTile = node->tiles[i];
newTile.img = coreData::cData->images.size() + gameObjectGenImageCnt;
newTile.x = gameObjectGenImageX * replaceSize;
newTile.y = gameObjectGenImageY * replaceSize;
file << newTile.writeConditionNames() << "<tile>" << newTile.writeLine() << "\n";
//move position
gameObjectGenImageX += 1;
if(gameObjectGenImageX == 32){
gameObjectGenImageY += 1;
gameObjectGenImageX = 0;
if(gameObjectGenImageY == 32){
//save image file
gameObjectGenImage.SaveFile(wxString((coreData::cData->packPath + "\\editorGenImage" + main::intToStr(gameObjectGenImageCnt) + ".png").c_str()));
gameObjectGenImageCnt ++;
gameObjectGenImageY = 0;
}
}
}
else{
file << node->tiles[i].writeConditionNames() << "<tile>" << node->tiles[i].writeLine() << "\n";
paletteSwap s = paletteSwap();
s.brightness = node->brightness;
genCustomImage(file, node->tiles[i], s, node->isSprite, -1);
for(int j = 0; j < node->swaps.size(); ++j){
genCustomImage(file, node->tiles[i], node->swaps[j], node->isSprite, j);
}
}
}
@ -1870,6 +1893,81 @@ void hdnesPackEditormainForm::genGameObjItemTilePack(fstream& file, wxTreeItemId
}
void hdnesPackEditormainForm::genCustomImage(fstream& file, gameTile t, paletteSwap s, bool isSprite, int swapID){
int replaceSize = 8 * coreData::cData->scale;
wxImage tmp;
t.brightness = s.brightness;
if(swapID >= 0){
applySwap(t.id.palette, s);
for(int i = 0; i < t.conditions.size(); ++i){
t.conditions[i].name = t.conditions[i].name + "_" + main::intToStr(swapID);
}
}
if((isSprite && (t.hFlip || t.vFlip)) || (s.hueRotation != 0.0) || (s.saturation != 1.0)){
//generate mirrored tile
//create if not yet
if(gameObjectGenImageX == 0 && gameObjectGenImageY == 0){
gameObjectGenImage = wxImage(32 * replaceSize, 32 * replaceSize, true);
gameObjectGenImage.InitAlpha();
memset(gameObjectGenImage.GetAlpha(), 0, 32 * replaceSize * 32 * replaceSize);
file << "<img>editorGenImage" + main::intToStr(gameObjectGenImageCnt) + ".png\n";
}
//add flipped tile to image
tmp = coreData::cData->images[t.img]->imageData.GetSubImage(wxRect(t.x, t.y, replaceSize, replaceSize));
if(t.hFlip){
tmp = tmp.Mirror(true);
}
if(t.vFlip){
tmp = tmp.Mirror(false);
}
if(s.hueRotation != 0.0){
tmp.RotateHue(s.hueRotation);
}
if(s.saturation != 1.0){
for(int dx = 0; dx < replaceSize; ++dx){
for(int dy = 0; dy < replaceSize; ++dy){
wxImage::RGBValue rgbC = wxImage::RGBValue(tmp.GetRed(dx, dy), tmp.GetGreen(dx, dy), tmp.GetBlue(dx, dy));
wxImage::HSVValue hsvC = wxImage::RGBtoHSV(rgbC);
hsvC.saturation = hsvC.saturation * s.saturation;
rgbC = wxImage::HSVtoRGB(hsvC);
tmp.SetRGB(dx, dy, rgbC.red, rgbC.green, rgbC.blue);
}
}
}
//copy pixel data
gameObjectGenImage.Paste(tmp, gameObjectGenImageX * replaceSize, gameObjectGenImageY * replaceSize);
//copy alpha data
for(int dx = 0; dx < replaceSize; ++dx){
for(int dy = 0; dy < replaceSize; ++dy){
gameObjectGenImage.SetAlpha(gameObjectGenImageX * replaceSize + dx, gameObjectGenImageY * replaceSize + dy, tmp.GetAlpha(dx, dy));
}
}
//create tmp tile
t.img = coreData::cData->images.size() + gameObjectGenImageCnt;
t.x = gameObjectGenImageX * replaceSize;
t.y = gameObjectGenImageY * replaceSize;
file << t.writeConditionNames() << "<tile>" << t.writeLine() << "\n";
//move position
gameObjectGenImageX += 1;
if(gameObjectGenImageX == 32){
gameObjectGenImageY += 1;
gameObjectGenImageX = 0;
if(gameObjectGenImageY == 32){
//save image file
gameObjectGenImage.SaveFile(wxString((coreData::cData->packPath + "\\editorGenImage" + main::intToStr(gameObjectGenImageCnt) + ".png").c_str()));
gameObjectGenImageCnt ++;
gameObjectGenImageY = 0;
}
}
}
else{
file << t.writeConditionNames() << "<tile>" << t.writeLine() << "\n";
}
}
void hdnesPackEditormainForm::findGameObjNotUniqueTile(){
gameObjNode* ndata = (gameObjNode*)(treeGameObjs->GetItemData(tItmGameObjMenu));
for(int i = 0; i < ndata->tiles.size(); ++i){
@ -1892,6 +1990,214 @@ void hdnesPackEditormainForm::findGameObjNotUniqueTile(){
void hdnesPackEditormainForm::addGameObjNotUniqueTileCondition(){
}
void hdnesPackEditormainForm::SwapSeleted( wxListEvent& event ){
selectedSwap = event.GetIndex();
showSwap();
}
void hdnesPackEditormainForm::showSwap(){
gameObjNode* ndata = getGameObjsSelectedObjectTreeNode();
if(!ndata) return;
paletteSwap p;
if(selectedSwap >= 0){
p = ndata->swaps[selectedSwap];
}
txtSwapName->SetValue(wxString(p.name.c_str()));
spnSwapNewBrightness->SetValue(p.brightness * 100);
spnSwapRotateHue->SetValue(p.hueRotation * 360);
spnSwapNewSaturation->SetValue(p.saturation * 100);
lstPalettes->DeleteAllItems();
stringstream s;
long j;
for(int i = 0; i < ndata->palettes.size(); ++i){
s.str(std::string());
s.clear();
s << main::intToHex(ndata->palettes[i][0]);
s << main::intToHex(ndata->palettes[i][1]);
s << main::intToHex(ndata->palettes[i][2]);
s << main::intToHex(ndata->palettes[i][3]);
j = lstPalettes->InsertItem(i, wxString(s.str().c_str()), 0);
lstPalettes->SetItem(j, 1, wxString(s.str().c_str()));
for(int k = 0; k < p.orgPalettes.size(); ++k){
if(ndata->palettes[i][0] == p.orgPalettes[k][0] && ndata->palettes[i][1] == p.orgPalettes[k][1] && ndata->palettes[i][2] == p.orgPalettes[k][2] && ndata->palettes[i][3] == p.orgPalettes[k][3]){
s.str(std::string());
s.clear();
s << main::intToHex(p.newPalettes[k][0]);
s << main::intToHex(p.newPalettes[k][1]);
s << main::intToHex(p.newPalettes[k][2]);
s << main::intToHex(p.newPalettes[k][3]);
lstPalettes->SetItem(j, 1, wxString(s.str().c_str()));
}
}
}
if(ndata->palettes.size() > 0){
selectedSwapPalette = 0;
lstPalettes->SetItemState(selectedSwapPalette, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
showSwapPalette();
}
else{
selectedSwapPalette = -1;
}
}
void hdnesPackEditormainForm::SwapPaletteSelected( wxListEvent& event ){
selectedSwapPalette = event.GetIndex();
showSwapPalette();
}
void hdnesPackEditormainForm::showSwapPalette(){
Uint8 tmpPalette[4];
lblOrgPalette->SetLabel(lstPalettes->GetItemText(selectedSwapPalette));
main::hexToByteArray(lstPalettes->GetItemText(selectedSwapPalette).ToStdString(), (Uint8*)tmpPalette);
if(tmpPalette[0] < 64){
pnlOrgPaletteBG->SetBackgroundColour(coreData::cData->palette[tmpPalette[0]]);
}
else{
pnlOrgPaletteBG->SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ));
}
pnlOrgPaletteBG->Refresh();
pnlOrgPalette1->SetBackgroundColour(coreData::cData->palette[tmpPalette[1]]);
pnlOrgPalette1->Refresh();
pnlOrgPalette2->SetBackgroundColour(coreData::cData->palette[tmpPalette[2]]);
pnlOrgPalette2->Refresh();
pnlOrgPalette3->SetBackgroundColour(coreData::cData->palette[tmpPalette[3]]);
pnlOrgPalette3->Refresh();
txtSwapPaletteNew->SetValue(lstPalettes->GetItemText(selectedSwapPalette, 1));
}
void hdnesPackEditormainForm::SwapPaletteNewChanged( wxCommandEvent& event ){
showNewSwapPalette();
lstPalettes->SetItem(selectedSwapPalette, 1, txtSwapPaletteNew->GetValue());
}
void hdnesPackEditormainForm::SwapNewPaletteBGClicked( wxCommandEvent& event ){
openColourDialog(COLOUR_CLIENT_NEW_SWAP_BG);
}
void hdnesPackEditormainForm::SwapNewPalette1Clicked( wxCommandEvent& event ){
openColourDialog(COLOUR_CLIENT_NEW_SWAP_1);
}
void hdnesPackEditormainForm::SwapNewPalette2Clicked( wxCommandEvent& event ){
openColourDialog(COLOUR_CLIENT_NEW_SWAP_2);
}
void hdnesPackEditormainForm::SwapNewPalette3Clicked( wxCommandEvent& event ){
openColourDialog(COLOUR_CLIENT_ROM_VIEW_3);
}
void hdnesPackEditormainForm::AddSwapClicked( wxCommandEvent& event ){
gameObjNode* ndata = getGameObjsSelectedObjectTreeNode();
if(!ndata) return;
paletteSwap p;
updateSwapData(p);
ndata->addSwap(p);
loadSwaps();
coreData::cData->dataChanged();
}
void hdnesPackEditormainForm::UpdateSwapClicked( wxCommandEvent& event ){
gameObjNode* ndata = getGameObjsSelectedObjectTreeNode();
if(!ndata) return;
if(selectedSwap >= 0){
updateSwapData(ndata->swaps[selectedSwap]);
loadSwaps();
coreData::cData->dataChanged();
}
}
void hdnesPackEditormainForm::DeleteSwapClicked( wxCommandEvent& event ){
gameObjNode* ndata = getGameObjsSelectedObjectTreeNode();
if(!ndata) return;
if(selectedSwap >= 0){
ndata->swaps.erase (ndata->swaps.begin()+selectedSwap);
loadSwaps();
coreData::cData->dataChanged();
}
}
void hdnesPackEditormainForm::showNewSwapPalette(){
main::hexToByteArray(txtSwapPaletteNew->GetValue().ToStdString(), (Uint8*)swapNewColours);
if(swapNewColours[0] < 64){
btnNewPaletteBG->SetBackgroundColour(coreData::cData->palette[swapNewColours[0]]);
if(coreData::cData->palette[swapNewColours[0]].Red() + coreData::cData->palette[swapNewColours[0]].Green() + coreData::cData->palette[swapNewColours[0]].Blue() > 256){
btnNewPaletteBG->SetForegroundColour(wxColour(0,0,0));
}
else{
btnNewPaletteBG->SetForegroundColour(wxColour(255,255,255));
}
}
else{
btnNewPaletteBG->SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ));
btnNewPaletteBG->SetForegroundColour(wxColour(0,0,0));
}
btnNewPalette1->SetBackgroundColour(coreData::cData->palette[swapNewColours[1]]);
if(coreData::cData->palette[swapNewColours[1]].Red() + coreData::cData->palette[swapNewColours[1]].Green() + coreData::cData->palette[swapNewColours[1]].Blue() > 256){
btnNewPalette1->SetForegroundColour(wxColour(0,0,0));
}
else{
btnNewPalette1->SetForegroundColour(wxColour(255,255,255));
}
btnNewPalette2->SetBackgroundColour(coreData::cData->palette[swapNewColours[2]]);
if(coreData::cData->palette[swapNewColours[2]].Red() + coreData::cData->palette[swapNewColours[2]].Green() + coreData::cData->palette[swapNewColours[2]].Blue() > 256){
btnNewPalette2->SetForegroundColour(wxColour(0,0,0));
}
else{
btnNewPalette2->SetForegroundColour(wxColour(255,255,255));
}
btnNewPalette3->SetBackgroundColour(coreData::cData->palette[swapNewColours[3]]);
if(coreData::cData->palette[swapNewColours[3]].Red() + coreData::cData->palette[swapNewColours[3]].Green() + coreData::cData->palette[swapNewColours[3]].Blue() > 256){
btnNewPalette3->SetForegroundColour(wxColour(0,0,0));
}
else{
btnNewPalette3->SetForegroundColour(wxColour(255,255,255));
}
}
void hdnesPackEditormainForm::updateNewSwapText(){
stringstream s;
s.str(std::string());
s.clear();
s << main::intToHex(swapNewColours[0]);
s << main::intToHex(swapNewColours[1]);
s << main::intToHex(swapNewColours[2]);
s << main::intToHex(swapNewColours[3]);
txtSwapPaletteNew->SetValue(wxString(s.str().c_str()));
}
void hdnesPackEditormainForm::updateSwapData(paletteSwap& s){
s.name = txtSwapName->GetValue().ToStdString();
s.brightness = (float)spnSwapNewBrightness->GetValue() / 100.0;
s.hueRotation = (float)spnSwapRotateHue->GetValue() / 360.0;
s.saturation = (float)spnSwapNewSaturation->GetValue() / 100.0;
s.orgPalettes.clear();
s.newPalettes.clear();
Uint8 tmpPalette[4];
array<Uint8, 4> arr;
for(int i = 0; i < lstPalettes->GetItemCount(); ++i){
main::hexToByteArray(lstPalettes->GetItemText(i).ToStdString(), (Uint8*)tmpPalette);
for(int j = 0; j < 4; ++j){
arr[j] = tmpPalette[j];
}
s.orgPalettes.push_back(arr);
main::hexToByteArray(lstPalettes->GetItemText(i, 1).ToStdString(), (Uint8*)tmpPalette);
for(int j = 0; j < 4; ++j){
arr[j] = tmpPalette[j];
}
s.newPalettes.push_back(arr);
}
}
void hdnesPackEditormainForm::initHDImg(){
lstHDImg->AppendColumn(wxString("Name"));
lstHDImg->AppendColumn(wxString("Width"));

View file

@ -6,6 +6,10 @@
#define COLOUR_CLIENT_ROM_VIEW_2 2
#define COLOUR_CLIENT_ROM_VIEW_3 3
#define COLOUR_CLIENT_GAME_OBJ_BG 4
#define COLOUR_CLIENT_NEW_SWAP_BG 5
#define COLOUR_CLIENT_NEW_SWAP_1 6
#define COLOUR_CLIENT_NEW_SWAP_2 7
#define COLOUR_CLIENT_NEW_SWAP_3 8
#define GAME_OBJ_PNL_PASTE 0
#define GAME_OBJ_PNL_COPY 1
@ -30,6 +34,7 @@ Subclass of mainForm, which is generated by wxFormBuilder.
#include "mainForm.h"
#include "colourDialogClient.h"
#include "gameObjNode.h"
#include "classList.h"
//// end generated include
@ -77,6 +82,17 @@ class hdnesPackEditormainForm : public mainForm, public colourDialogClient
void gameObjsRawLDown( wxMouseEvent& event );
void gameObjsRawLUp( wxMouseEvent& event );
void replaceBrightnessChanged( wxScrollEvent& event );
void SwapSeleted( wxListEvent& event );
void SwapPaletteSelected( wxListEvent& event );
void SwapPaletteNewChanged( wxCommandEvent& event );
void SwapNewPaletteBGClicked( wxCommandEvent& event );
void SwapNewPalette1Clicked( wxCommandEvent& event );
void SwapNewPalette2Clicked( wxCommandEvent& event );
void SwapNewPalette3Clicked( wxCommandEvent& event );
void AddSwapClicked( wxCommandEvent& event );
void UpdateSwapClicked( wxCommandEvent& event );
void DeleteSwapClicked( wxCommandEvent& event );
void HDImgSelected( wxListEvent& event );
void HDImgSizeChanged( wxSizeEvent& event );
@ -202,7 +218,9 @@ class hdnesPackEditormainForm : public mainForm, public colourDialogClient
wxImage gameObjImageWithSelection;
wxImage gameObjBaseTile;
wxImage gameObjBaseTileNew;
int selectedSwap;
int selectedSwapPalette;
Uint8 swapNewColours[4];
void initGameObjs();
void configGameObjs(string lineHdr, string lineTail);
@ -225,6 +243,7 @@ class hdnesPackEditormainForm : public mainForm, public colourDialogClient
void genGameObjsTilePack(fstream& file, bool withCondition);
void genChildGameObjsTilePack(fstream& file, wxTreeItemId item, bool withCondition);
void genGameObjItemTilePack(fstream& file, wxTreeItemId item, bool withCondition);
void genCustomImage(fstream& file, gameTile t, paletteSwap s, bool isSprite, int swapID);
void gameObjsROMChanged();
void gameObjsTreeMenu( wxCommandEvent& event );
@ -250,6 +269,13 @@ class hdnesPackEditormainForm : public mainForm, public colourDialogClient
void findGameObjNotUniqueTile();
void addGameObjNotUniqueTileCondition();
void loadSwaps();
void showSwap();
void showSwapPalette();
void showNewSwapPalette();
void updateNewSwapText();
void updateSwapData(paletteSwap& s);
void applySwap(Uint8* palette, paletteSwap& s);
//--end game objs session

View file

@ -27,6 +27,20 @@ string main::floatToStr(float value){
return stream.str();
}
string main::paletteToStr(vector<array<Uint8, 4>> p){
stringstream stream;
for(int i = 0; i < p.size(); ++i){
stream << main::intToHex(p[i][0]);
stream << main::intToHex(p[i][1]);
stream << main::intToHex(p[i][2]);
stream << main::intToHex(p[i][3]);
if(i < (p.size() - 1)){
stream << ",";
}
}
return stream.str();
}
vector<string> main::split(const string &s, char delim, vector<string> &elems) {
stringstream ss(s);
string item;

View file

@ -17,6 +17,7 @@ public:
static string intToHex(int value);
static string intToStr(int value);
static string floatToStr(float value);
static string paletteToStr(vector<array<Uint8, 4>> p);
static vector<string> split(const string &s, char delim, vector<string> &elems);
static void hexToByteArray(const string &s, UINT8* ar);
static void drawRect(wxImage &img, wxPoint pt, wxPoint rectSize, wxColour c);

View file

@ -79,37 +79,29 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons
m_panel70->Layout();
bSizer131->Fit( m_panel70 );
m_panel71 = new wxPanel( m_splitter2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer38;
bSizer38 = new wxBoxSizer( wxVERTICAL );
m_notebook2 = new wxNotebook( m_panel71, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_panel78 = new wxPanel( m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer14;
bSizer14 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer15;
bSizer15 = new wxBoxSizer( wxHORIZONTAL );
m_staticText61 = new wxStaticText( m_panel71, wxID_ANY, wxT("Zoom:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText61->Wrap( -1 );
bSizer15->Add( m_staticText61, 0, wxALL, 5 );
zoomGameObjs = new wxSpinCtrl( m_panel71, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 10, 1 );
zoomGameObjs->SetMinSize( wxSize( 50,-1 ) );
bSizer15->Add( zoomGameObjs, 0, wxALL, 5 );
m_staticText91 = new wxStaticText( m_panel71, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_staticText91->Wrap( -1 );
bSizer15->Add( m_staticText91, 0, wxALL, 5 );
rbnObjectSprite = new wxRadioButton( m_panel71, wxID_ANY, wxT("Sprite"), wxDefaultPosition, wxDefaultSize, 0 );
rbnObjectSprite = new wxRadioButton( m_panel78, wxID_ANY, wxT("Sprite"), wxDefaultPosition, wxDefaultSize, 0 );
rbnObjectSprite->SetValue( true );
bSizer15->Add( rbnObjectSprite, 0, wxALL, 5 );
rbnObjectBG = new wxRadioButton( m_panel71, wxID_ANY, wxT("Back Ground"), wxDefaultPosition, wxDefaultSize, 0 );
rbnObjectBG = new wxRadioButton( m_panel78, wxID_ANY, wxT("Back Ground"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer15->Add( rbnObjectBG, 0, wxALL, 5 );
m_staticText101 = new wxStaticText( m_panel71, wxID_ANY, wxT("BG colour: "), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText101 = new wxStaticText( m_panel78, wxID_ANY, wxT("BG colour: "), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText101->Wrap( -1 );
bSizer15->Add( m_staticText101, 0, wxALL, 5 );
btnGameObjBGColour = new wxButton( m_panel71, wxID_ANY, wxT("..."), wxDefaultPosition, wxSize( 50,-1 ), 0 );
btnGameObjBGColour = new wxButton( m_panel78, wxID_ANY, wxT("..."), wxDefaultPosition, wxSize( 50,-1 ), 0 );
bSizer15->Add( btnGameObjBGColour, 0, wxALL, 5 );
@ -121,32 +113,39 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons
wxBoxSizer* bSizer34;
bSizer34 = new wxBoxSizer( wxHORIZONTAL );
m_staticText11 = new wxStaticText( m_panel71, wxID_ANY, wxT("Original:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11 = new wxStaticText( m_panel78, wxID_ANY, wxT("Original:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11->Wrap( -1 );
bSizer34->Add( m_staticText11, 0, wxALL, 5 );
m_staticText61 = new wxStaticText( m_panel78, wxID_ANY, wxT("Zoom"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText61->Wrap( -1 );
bSizer34->Add( m_staticText61, 0, wxALL, 5 );
zoomGameObjs = new wxSpinCtrl( m_panel78, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 10, 1 );
zoomGameObjs->SetMinSize( wxSize( 50,-1 ) );
bSizer34->Add( zoomGameObjs, 0, wxALL, 5 );
bSizer33->Add( bSizer34, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer36;
bSizer36 = new wxBoxSizer( wxHORIZONTAL );
m_staticText12 = new wxStaticText( m_panel71, wxID_ANY, wxT("Replacement:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12 = new wxStaticText( m_panel78, wxID_ANY, wxT("Replacement:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12->Wrap( -1 );
bSizer36->Add( m_staticText12, 0, wxALL, 5 );
m_staticText16 = new wxStaticText( m_panel71, wxID_ANY, wxT("Brightness"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText16 = new wxStaticText( m_panel78, wxID_ANY, wxT("Brightness"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText16->Wrap( -1 );
bSizer36->Add( m_staticText16, 0, wxALL, 5 );
dialReplaceBrightness = new wxSlider( m_panel71, wxID_ANY, 100, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
bSizer36->Add( dialReplaceBrightness, 0, wxALL, 5 );
spnBrightness = new wxSpinCtrl( m_panel78, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 100 );
spnBrightness->SetMaxSize( wxSize( 50,-1 ) );
lblReplaceBrightness = new wxStaticText( m_panel71, wxID_ANY, wxT("100"), wxDefaultPosition, wxDefaultSize, 0 );
lblReplaceBrightness->Wrap( -1 );
bSizer36->Add( lblReplaceBrightness, 0, wxALL, 5 );
bSizer36->Add( spnBrightness, 0, wxALL, 5 );
m_staticText18 = new wxStaticText( m_panel71, wxID_ANY, wxT("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText18 = new wxStaticText( m_panel78, wxID_ANY, wxT("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText18->Wrap( -1 );
bSizer36->Add( m_staticText18, 0, wxALL, 5 );
@ -169,7 +168,7 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons
fgSizer11->SetFlexibleDirection( wxBOTH );
fgSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
pnlGameObjRaw = new wxPanel( m_panel71, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
pnlGameObjRaw = new wxPanel( m_panel78, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
pnlGameObjRaw->SetBackgroundColour( wxColour( 0, 0, 0 ) );
fgSizer11->Add( pnlGameObjRaw, 1, wxEXPAND | wxALL, 5 );
@ -177,7 +176,7 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons
wxBoxSizer* bSizer101;
bSizer101 = new wxBoxSizer( wxVERTICAL );
scrGameObjRawV = new wxScrollBar( m_panel71, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL );
scrGameObjRawV = new wxScrollBar( m_panel78, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL );
bSizer101->Add( scrGameObjRawV, 1, wxALL, 5 );
@ -186,7 +185,7 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons
wxBoxSizer* bSizer132;
bSizer132 = new wxBoxSizer( wxHORIZONTAL );
scrGameObjRawH = new wxScrollBar( m_panel71, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL );
scrGameObjRawH = new wxScrollBar( m_panel78, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL );
bSizer132->Add( scrGameObjRawH, 1, wxALL, 5 );
@ -208,7 +207,7 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons
fgSizer12->SetFlexibleDirection( wxBOTH );
fgSizer12->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
pnlGameObjNew = new wxPanel( m_panel71, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
pnlGameObjNew = new wxPanel( m_panel78, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
pnlGameObjNew->SetBackgroundColour( wxColour( 0, 0, 0 ) );
fgSizer12->Add( pnlGameObjNew, 1, wxEXPAND | wxALL, 5 );
@ -216,7 +215,7 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons
wxBoxSizer* bSizer102;
bSizer102 = new wxBoxSizer( wxVERTICAL );
scrGameObjNewV = new wxScrollBar( m_panel71, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL );
scrGameObjNewV = new wxScrollBar( m_panel78, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL );
bSizer102->Add( scrGameObjNewV, 1, wxALL, 5 );
@ -225,7 +224,7 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons
wxBoxSizer* bSizer133;
bSizer133 = new wxBoxSizer( wxHORIZONTAL );
scrGameObjNewH = new wxScrollBar( m_panel71, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL );
scrGameObjNewH = new wxScrollBar( m_panel78, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL );
bSizer133->Add( scrGameObjNewH, 1, wxALL, 5 );
@ -241,9 +240,222 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons
bSizer14->Add( bSizer16, 1, wxEXPAND, 5 );
m_panel71->SetSizer( bSizer14 );
m_panel78->SetSizer( bSizer14 );
m_panel78->Layout();
bSizer14->Fit( m_panel78 );
m_notebook2->AddPage( m_panel78, wxT("Object information"), true );
m_panel79 = new wxPanel( m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer40;
bSizer40 = new wxBoxSizer( wxVERTICAL );
lstSwaps = new wxListCtrl( m_panel79, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
bSizer40->Add( lstSwaps, 2, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer43;
bSizer43 = new wxBoxSizer( wxHORIZONTAL );
m_staticText181 = new wxStaticText( m_panel79, wxID_ANY, wxT("Palette swap name:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText181->Wrap( -1 );
bSizer43->Add( m_staticText181, 0, wxALL, 5 );
txtSwapName = new wxTextCtrl( m_panel79, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer43->Add( txtSwapName, 0, wxALL, 5 );
bSizer40->Add( bSizer43, 0, wxEXPAND, 5 );
wxBoxSizer* bSizer41;
bSizer41 = new wxBoxSizer( wxHORIZONTAL );
lstPalettes = new wxListCtrl( m_panel79, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
bSizer41->Add( lstPalettes, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer42;
bSizer42 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer44;
bSizer44 = new wxBoxSizer( wxHORIZONTAL );
m_staticText19 = new wxStaticText( m_panel79, wxID_ANY, wxT("Original palette:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText19->Wrap( -1 );
bSizer44->Add( m_staticText19, 0, wxALL, 5 );
lblOrgPalette = new wxStaticText( m_panel79, wxID_ANY, wxT("00000000"), wxDefaultPosition, wxDefaultSize, 0 );
lblOrgPalette->Wrap( -1 );
bSizer44->Add( lblOrgPalette, 0, wxALL, 5 );
bSizer42->Add( bSizer44, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer45;
bSizer45 = new wxBoxSizer( wxHORIZONTAL );
pnlOrgPaletteBG = new wxPanel( m_panel79, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
bSizer45->Add( pnlOrgPaletteBG, 1, wxALL|wxEXPAND, 5 );
pnlOrgPalette1 = new wxPanel( m_panel79, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
bSizer45->Add( pnlOrgPalette1, 1, wxEXPAND | wxALL, 5 );
pnlOrgPalette2 = new wxPanel( m_panel79, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
bSizer45->Add( pnlOrgPalette2, 1, wxEXPAND | wxALL, 5 );
pnlOrgPalette3 = new wxPanel( m_panel79, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
bSizer45->Add( pnlOrgPalette3, 1, wxEXPAND | wxALL, 5 );
bSizer42->Add( bSizer45, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer511;
bSizer511 = new wxBoxSizer( wxVERTICAL );
m_staticText261 = new wxStaticText( m_panel79, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_staticText261->Wrap( -1 );
bSizer511->Add( m_staticText261, 0, wxALL|wxEXPAND, 5 );
bSizer42->Add( bSizer511, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer46;
bSizer46 = new wxBoxSizer( wxHORIZONTAL );
m_staticText21 = new wxStaticText( m_panel79, wxID_ANY, wxT("New palette:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText21->Wrap( -1 );
bSizer46->Add( m_staticText21, 0, wxALL, 5 );
txtSwapPaletteNew = new wxTextCtrl( m_panel79, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
#ifdef __WXGTK__
if ( !txtSwapPaletteNew->HasFlag( wxTE_MULTILINE ) )
{
txtSwapPaletteNew->SetMaxLength( 8 );
}
#else
txtSwapPaletteNew->SetMaxLength( 8 );
#endif
bSizer46->Add( txtSwapPaletteNew, 0, wxALL, 5 );
bSizer42->Add( bSizer46, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer48;
bSizer48 = new wxBoxSizer( wxHORIZONTAL );
btnNewPaletteBG = new wxButton( m_panel79, wxID_ANY, wxT("BG"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bSizer48->Add( btnNewPaletteBG, 1, wxALL|wxEXPAND, 5 );
btnNewPalette1 = new wxButton( m_panel79, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bSizer48->Add( btnNewPalette1, 1, wxALL|wxEXPAND, 5 );
btnNewPalette2 = new wxButton( m_panel79, wxID_ANY, wxT("2"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bSizer48->Add( btnNewPalette2, 1, wxALL|wxEXPAND, 5 );
btnNewPalette3 = new wxButton( m_panel79, wxID_ANY, wxT("3"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bSizer48->Add( btnNewPalette3, 1, wxALL|wxEXPAND, 5 );
bSizer42->Add( bSizer48, 1, wxEXPAND, 5 );
bSizer41->Add( bSizer42, 1, wxEXPAND, 5 );
bSizer40->Add( bSizer41, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer52;
bSizer52 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer53;
bSizer53 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizer49;
bSizer49 = new wxBoxSizer( wxHORIZONTAL );
m_staticText22 = new wxStaticText( m_panel79, wxID_ANY, wxT("New brightness"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText22->Wrap( -1 );
bSizer49->Add( m_staticText22, 0, wxALL, 5 );
spnSwapNewBrightness = new wxSpinCtrl( m_panel79, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 100 );
spnSwapNewBrightness->SetMaxSize( wxSize( 50,-1 ) );
bSizer49->Add( spnSwapNewBrightness, 0, wxALL, 5 );
m_staticText23 = new wxStaticText( m_panel79, wxID_ANY, wxT("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText23->Wrap( -1 );
bSizer49->Add( m_staticText23, 0, wxALL, 5 );
bSizer53->Add( bSizer49, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer50;
bSizer50 = new wxBoxSizer( wxHORIZONTAL );
m_staticText24 = new wxStaticText( m_panel79, wxID_ANY, wxT("Rotate hue"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText24->Wrap( -1 );
bSizer50->Add( m_staticText24, 0, wxALL, 5 );
spnSwapRotateHue = new wxSpinCtrl( m_panel79, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -360, 360, 0 );
spnSwapRotateHue->SetMaxSize( wxSize( 70,-1 ) );
bSizer50->Add( spnSwapRotateHue, 0, wxALL, 5 );
m_staticText26 = new wxStaticText( m_panel79, wxID_ANY, wxT("degrees"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText26->Wrap( -1 );
bSizer50->Add( m_staticText26, 0, wxALL, 5 );
bSizer53->Add( bSizer50, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer51;
bSizer51 = new wxBoxSizer( wxHORIZONTAL );
m_staticText27 = new wxStaticText( m_panel79, wxID_ANY, wxT("New saturation"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText27->Wrap( -1 );
bSizer51->Add( m_staticText27, 0, wxALL, 5 );
spnSwapNewSaturation = new wxSpinCtrl( m_panel79, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 100 );
spnSwapNewSaturation->SetMaxSize( wxSize( 50,-1 ) );
bSizer51->Add( spnSwapNewSaturation, 0, wxALL, 5 );
m_staticText28 = new wxStaticText( m_panel79, wxID_ANY, wxT("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText28->Wrap( -1 );
bSizer51->Add( m_staticText28, 0, wxALL, 5 );
bSizer53->Add( bSizer51, 1, wxEXPAND, 5 );
bSizer52->Add( bSizer53, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer54;
bSizer54 = new wxBoxSizer( wxHORIZONTAL );
btnAddSwap = new wxButton( m_panel79, wxID_ANY, wxT("Add"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer54->Add( btnAddSwap, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5 );
btnUpdateSwap = new wxButton( m_panel79, wxID_ANY, wxT("Update"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer54->Add( btnUpdateSwap, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5 );
btnDeleteSwap = new wxButton( m_panel79, wxID_ANY, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer54->Add( btnDeleteSwap, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5 );
bSizer52->Add( bSizer54, 1, wxEXPAND, 5 );
bSizer40->Add( bSizer52, 0, wxEXPAND, 5 );
m_panel79->SetSizer( bSizer40 );
m_panel79->Layout();
bSizer40->Fit( m_panel79 );
m_notebook2->AddPage( m_panel79, wxT("Palette swaps"), false );
bSizer38->Add( m_notebook2, 1, wxEXPAND | wxALL, 5 );
m_panel71->SetSizer( bSizer38 );
m_panel71->Layout();
bSizer14->Fit( m_panel71 );
bSizer38->Fit( m_panel71 );
m_splitter2->SplitVertically( m_panel70, m_panel71, 150 );
bSizer12->Add( m_splitter2, 1, wxEXPAND, 5 );
@ -418,19 +630,11 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons
treeGameObjs->Connect( wxEVT_COMMAND_TREE_END_LABEL_EDIT, wxTreeEventHandler( mainForm::gameObjTItemChangeName ), NULL, this );
treeGameObjs->Connect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( mainForm::gameObjTItemOpenMenu ), NULL, this );
treeGameObjs->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( mainForm::gameObjTItemSelected ), NULL, this );
zoomGameObjs->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::zoomGameObjsChanged ), NULL, this );
rbnObjectSprite->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( mainForm::gameObjSpriteClicked ), NULL, this );
rbnObjectBG->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( mainForm::gameObjBGClicked ), NULL, this );
btnGameObjBGColour->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::gameObjBGColour ), NULL, this );
dialReplaceBrightness->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
zoomGameObjs->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::zoomGameObjsChanged ), NULL, this );
spnBrightness->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
pnlGameObjRaw->Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( mainForm::gameObjsRawEnter ), NULL, this );
pnlGameObjRaw->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( mainForm::gameObjsRawLDown ), NULL, this );
pnlGameObjRaw->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( mainForm::gameObjsRawLUp ), NULL, this );
@ -479,6 +683,19 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons
scrGameObjNewH->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( mainForm::gameObjsNewHScrolled ), NULL, this );
scrGameObjNewH->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( mainForm::gameObjsNewHScrolled ), NULL, this );
scrGameObjNewH->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( mainForm::gameObjsNewHScrolled ), NULL, this );
lstSwaps->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( mainForm::SwapSeleted ), NULL, this );
lstPalettes->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( mainForm::SwapPaletteSelected ), NULL, this );
txtSwapPaletteNew->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::SwapPaletteNewChanged ), NULL, this );
btnNewPaletteBG->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::SwapNewPaletteBGClicked ), NULL, this );
btnNewPalette1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::SwapNewPalette1Clicked ), NULL, this );
btnNewPalette2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::SwapNewPalette2Clicked ), NULL, this );
btnNewPalette3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::SwapNewPalette3Clicked ), NULL, this );
spnSwapNewBrightness->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::SwapNewBrightnessChanged ), NULL, this );
spnSwapRotateHue->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::SwapRotateHueChanged ), NULL, this );
spnSwapNewSaturation->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::SwapNewSaturationChanged ), NULL, this );
btnAddSwap->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::AddSwapClicked ), NULL, this );
btnUpdateSwap->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::UpdateSwapClicked ), NULL, this );
btnDeleteSwap->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::DeleteSwapClicked ), NULL, this );
lstHDImg->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( mainForm::HDImgSelected ), NULL, this );
btnHDImgAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::HDImgAdd ), NULL, this );
btnHDImgRemove->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::HDImgRemove ), NULL, this );
@ -536,19 +753,11 @@ mainForm::~mainForm()
treeGameObjs->Disconnect( wxEVT_COMMAND_TREE_END_LABEL_EDIT, wxTreeEventHandler( mainForm::gameObjTItemChangeName ), NULL, this );
treeGameObjs->Disconnect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( mainForm::gameObjTItemOpenMenu ), NULL, this );
treeGameObjs->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( mainForm::gameObjTItemSelected ), NULL, this );
zoomGameObjs->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::zoomGameObjsChanged ), NULL, this );
rbnObjectSprite->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( mainForm::gameObjSpriteClicked ), NULL, this );
rbnObjectBG->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( mainForm::gameObjBGClicked ), NULL, this );
btnGameObjBGColour->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::gameObjBGColour ), NULL, this );
dialReplaceBrightness->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
dialReplaceBrightness->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
zoomGameObjs->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::zoomGameObjsChanged ), NULL, this );
spnBrightness->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::replaceBrightnessChanged ), NULL, this );
pnlGameObjRaw->Disconnect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( mainForm::gameObjsRawEnter ), NULL, this );
pnlGameObjRaw->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( mainForm::gameObjsRawLDown ), NULL, this );
pnlGameObjRaw->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( mainForm::gameObjsRawLUp ), NULL, this );
@ -597,6 +806,19 @@ mainForm::~mainForm()
scrGameObjNewH->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( mainForm::gameObjsNewHScrolled ), NULL, this );
scrGameObjNewH->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( mainForm::gameObjsNewHScrolled ), NULL, this );
scrGameObjNewH->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( mainForm::gameObjsNewHScrolled ), NULL, this );
lstSwaps->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( mainForm::SwapSeleted ), NULL, this );
lstPalettes->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( mainForm::SwapPaletteSelected ), NULL, this );
txtSwapPaletteNew->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::SwapPaletteNewChanged ), NULL, this );
btnNewPaletteBG->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::SwapNewPaletteBGClicked ), NULL, this );
btnNewPalette1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::SwapNewPalette1Clicked ), NULL, this );
btnNewPalette2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::SwapNewPalette2Clicked ), NULL, this );
btnNewPalette3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::SwapNewPalette3Clicked ), NULL, this );
spnSwapNewBrightness->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::SwapNewBrightnessChanged ), NULL, this );
spnSwapRotateHue->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::SwapRotateHueChanged ), NULL, this );
spnSwapNewSaturation->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::SwapNewSaturationChanged ), NULL, this );
btnAddSwap->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::AddSwapClicked ), NULL, this );
btnUpdateSwap->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::UpdateSwapClicked ), NULL, this );
btnDeleteSwap->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::DeleteSwapClicked ), NULL, this );
lstHDImg->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( mainForm::HDImgSelected ), NULL, this );
btnHDImgAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::HDImgAdd ), NULL, this );
btnHDImgRemove->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::HDImgRemove ), NULL, this );

View file

@ -23,16 +23,15 @@
#include <wx/treectrl.h>
#include <wx/sizer.h>
#include <wx/panel.h>
#include <wx/stattext.h>
#include <wx/spinctrl.h>
#include <wx/radiobut.h>
#include <wx/stattext.h>
#include <wx/button.h>
#include <wx/slider.h>
#include <wx/spinctrl.h>
#include <wx/scrolbar.h>
#include <wx/splitter.h>
#include <wx/listctrl.h>
#include <wx/textctrl.h>
#include <wx/notebook.h>
#include <wx/splitter.h>
#include <wx/frame.h>
#include <wx/filepicker.h>
#include <wx/dialog.h>
@ -59,18 +58,18 @@ class mainForm : public wxFrame
wxPanel* m_panel70;
wxTreeCtrl* treeGameObjs;
wxPanel* m_panel71;
wxStaticText* m_staticText61;
wxSpinCtrl* zoomGameObjs;
wxStaticText* m_staticText91;
wxNotebook* m_notebook2;
wxPanel* m_panel78;
wxRadioButton* rbnObjectSprite;
wxRadioButton* rbnObjectBG;
wxStaticText* m_staticText101;
wxButton* btnGameObjBGColour;
wxStaticText* m_staticText11;
wxStaticText* m_staticText61;
wxSpinCtrl* zoomGameObjs;
wxStaticText* m_staticText12;
wxStaticText* m_staticText16;
wxSlider* dialReplaceBrightness;
wxStaticText* lblReplaceBrightness;
wxSpinCtrl* spnBrightness;
wxStaticText* m_staticText18;
wxPanel* pnlGameObjRaw;
wxScrollBar* scrGameObjRawV;
@ -78,6 +77,36 @@ class mainForm : public wxFrame
wxPanel* pnlGameObjNew;
wxScrollBar* scrGameObjNewV;
wxScrollBar* scrGameObjNewH;
wxPanel* m_panel79;
wxListCtrl* lstSwaps;
wxStaticText* m_staticText181;
wxTextCtrl* txtSwapName;
wxListCtrl* lstPalettes;
wxStaticText* m_staticText19;
wxStaticText* lblOrgPalette;
wxPanel* pnlOrgPaletteBG;
wxPanel* pnlOrgPalette1;
wxPanel* pnlOrgPalette2;
wxPanel* pnlOrgPalette3;
wxStaticText* m_staticText261;
wxStaticText* m_staticText21;
wxTextCtrl* txtSwapPaletteNew;
wxButton* btnNewPaletteBG;
wxButton* btnNewPalette1;
wxButton* btnNewPalette2;
wxButton* btnNewPalette3;
wxStaticText* m_staticText22;
wxSpinCtrl* spnSwapNewBrightness;
wxStaticText* m_staticText23;
wxStaticText* m_staticText24;
wxSpinCtrl* spnSwapRotateHue;
wxStaticText* m_staticText26;
wxStaticText* m_staticText27;
wxSpinCtrl* spnSwapNewSaturation;
wxStaticText* m_staticText28;
wxButton* btnAddSwap;
wxButton* btnUpdateSwap;
wxButton* btnDeleteSwap;
wxPanel* m_panel72;
wxSplitterWindow* m_splitter21;
wxPanel* m_panel741;
@ -115,11 +144,11 @@ class mainForm : public wxFrame
virtual void gameObjTItemChangeName( wxTreeEvent& event ) { event.Skip(); }
virtual void gameObjTItemOpenMenu( wxTreeEvent& event ) { event.Skip(); }
virtual void gameObjTItemSelected( wxTreeEvent& event ) { event.Skip(); }
virtual void zoomGameObjsChanged( wxSpinEvent& event ) { event.Skip(); }
virtual void gameObjSpriteClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void gameObjBGClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void gameObjBGColour( wxCommandEvent& event ) { event.Skip(); }
virtual void replaceBrightnessChanged( wxScrollEvent& event ) { event.Skip(); }
virtual void zoomGameObjsChanged( wxSpinEvent& event ) { event.Skip(); }
virtual void replaceBrightnessChanged( wxSpinEvent& event ) { event.Skip(); }
virtual void gameObjsRawEnter( wxMouseEvent& event ) { event.Skip(); }
virtual void gameObjsRawLDown( wxMouseEvent& event ) { event.Skip(); }
virtual void gameObjsRawLUp( wxMouseEvent& event ) { event.Skip(); }
@ -136,6 +165,19 @@ class mainForm : public wxFrame
virtual void gameObjsNewSizeChanged( wxSizeEvent& event ) { event.Skip(); }
virtual void gameObjsNewVScrolled( wxScrollEvent& event ) { event.Skip(); }
virtual void gameObjsNewHScrolled( wxScrollEvent& event ) { event.Skip(); }
virtual void SwapSeleted( wxListEvent& event ) { event.Skip(); }
virtual void SwapPaletteSelected( wxListEvent& event ) { event.Skip(); }
virtual void SwapPaletteNewChanged( wxCommandEvent& event ) { event.Skip(); }
virtual void SwapNewPaletteBGClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void SwapNewPalette1Clicked( wxCommandEvent& event ) { event.Skip(); }
virtual void SwapNewPalette2Clicked( wxCommandEvent& event ) { event.Skip(); }
virtual void SwapNewPalette3Clicked( wxCommandEvent& event ) { event.Skip(); }
virtual void SwapNewBrightnessChanged( wxSpinEvent& event ) { event.Skip(); }
virtual void SwapRotateHueChanged( wxSpinEvent& event ) { event.Skip(); }
virtual void SwapNewSaturationChanged( wxSpinEvent& event ) { event.Skip(); }
virtual void AddSwapClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void UpdateSwapClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void DeleteSwapClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void HDImgSelected( wxListEvent& event ) { event.Skip(); }
virtual void HDImgAdd( wxCommandEvent& event ) { event.Skip(); }
virtual void HDImgRemove( wxCommandEvent& event ) { event.Skip(); }
@ -164,7 +206,7 @@ class mainForm : public wxFrame
public:
mainForm( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("HDNes Graphics Pack Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 816,626 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
mainForm( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("HDNes Graphics Pack Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 980,626 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
~mainForm();