diff --git a/src/scenedit/scen.core.cpp b/src/scenedit/scen.core.cpp index d5976954..98cff4ba 100644 --- a/src/scenedit/scen.core.cpp +++ b/src/scenedit/scen.core.cpp @@ -3378,9 +3378,10 @@ void edit_custom_sheets() { spec_scen_g.clear(); spec_scen_g.sheets = new sf::Texture[1]; spec_scen_g.numSheets = 1; - spec_scen_g.sheets[0].create(280, 360); + spec_scen_g.init_sheet(0); spec_scen_g.sheets[0].copyToImage().saveToFile((pic_dir/"sheet0.png").string().c_str()); all_pics.insert(all_pics.begin(), 0); + ResMgr::pushPath(pic_dir); } set_cursor(watch_curs); @@ -3468,7 +3469,7 @@ void edit_custom_sheets() { sf::Texture* wasSheets = spec_scen_g.sheets; spec_scen_g.sheets = new sf::Texture[spec_scen_g.numSheets + 1]; std::copy_n(wasSheets, spec_scen_g.numSheets, spec_scen_g.sheets); - spec_scen_g.sheets[newSheet].create(280,360); + spec_scen_g.init_sheet(newSheet); spec_scen_g.sheets[newSheet].copyToImage().saveToFile(sheetPath.string().c_str()); spec_scen_g.numSheets++; auto iter = all_pics.insert(std::upper_bound(all_pics.begin(), all_pics.end(), newSheet), newSheet); diff --git a/src/tools/graphtool.cpp b/src/tools/graphtool.cpp index 89fd29e3..3cd29798 100644 --- a/src/tools/graphtool.cpp +++ b/src/tools/graphtool.cpp @@ -535,6 +535,22 @@ void cCustomGraphics::replace_sheet(size_t num, sf::Image& newSheet) { ResMgr::free(sheetname); } +void cCustomGraphics::init_sheet(size_t num) { + sheets[num].create(280,360); + sf::Image fill1, fill2; + fill1.create(28,36,{0xff,0xff,0xc0}); + fill2.create(28,36,{0xc0,0xff,0xc0}); + for(int y = 0; y < 10; y++) { + for(int x = 0; x < 10; x++) { + if(x % 2 == y % 2) { + sheets[num].update(fill1.getPixelsPtr(), 28, 36, x * 28, y * 36); + } else { + sheets[num].update(fill2.getPixelsPtr(), 28, 36, x * 28, y * 36); + } + } + } +} + // TODO: This doesn't belong in this file std::string get_str(std::string list, short j){ if(j == 0) return list; diff --git a/src/tools/graphtool.hpp b/src/tools/graphtool.hpp index ff412f20..acb84b19 100644 --- a/src/tools/graphtool.hpp +++ b/src/tools/graphtool.hpp @@ -83,6 +83,7 @@ struct cCustomGraphics { graf_pos find_graphic(pic_num_t pic, bool party = false); size_t count(bool party = false); void replace_sheet(size_t num, sf::Image& newSheet); + void init_sheet(size_t num); }; struct snippet_t {