diff --git a/CMakeLists.txt b/CMakeLists.txt index 741d0404..ba346f9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # You will most likely get a message about being unable to open hunspell-1.7.lib because pkgconf forgets to add the actual path to # HUNSPELL_LIBRARIES. If so, uncomment the below line and point it to the correct vcpkg root folder/library. -set(HUNSPELL_LIBRARIES "C:\\src\\vcpkg\\installed\\${VCPKG_TARGET_TRIPLET}\\lib\\hunspell-1.7.lib") +#set(HUNSPELL_LIBRARIES "C:\\PATH\\TO\\ROOT\\vcpkg\\installed\\${VCPKG_TARGET_TRIPLET}\\lib\\hunspell-1.7.lib") message("-- Does this have a full path? If not, and it's just a file name, it's broken: Found Hunspell at ${HUNSPELL_LIBRARIES}") include_directories("${PROJECT_BINARY_DIR}/src") diff --git a/src/data/format/clipboard.cpp b/src/data/format/clipboard.cpp index a85bfa10..200ce221 100644 --- a/src/data/format/clipboard.cpp +++ b/src/data/format/clipboard.cpp @@ -71,7 +71,6 @@ CardsDataObject::CardsDataObject(const SetP& set, const vector& cards) { } WrappedCards data = { set->game.get(), set->game->name(), cards }; SetText(serialize_for_clipboard(*set, data)); - queue_message(MESSAGE_WARNING, GetText()); // restore cards for (size_t i = 0 ; i < cards.size() ; ++i) { if (has_styling[i]) { @@ -148,9 +147,6 @@ CardsOnClipboard::CardsOnClipboard(const SetP& set, const vector& cards) else if (cards.size() < 6) { Add(new wxImageDataObject(export_image(set, cards, true, 0, 1.0, 0.0))); } - else if (cards.size() < 6) { - Add(new wxBitmapDataObject(export_bitmap(set, cards, true, 0, 1.0, 0.0))); - } // Conversion to serialized card format Add(new CardsDataObject(set, cards), true); } diff --git a/src/data/format/formats.hpp b/src/data/format/formats.hpp index a5001a46..2eee7742 100644 --- a/src/data/format/formats.hpp +++ b/src/data/format/formats.hpp @@ -98,8 +98,9 @@ Image export_image(const SetP& set, const CardP& card); Image export_image(const SetP& set, const CardP& card, const double zoom, const Radians angle_radians = 0.0); Image export_image(const SetP& set, const vector& cards, bool scale_to_lowest_dpi, int padding, const double zoom, const Radians angle_radians = 0.0); -/// Export the image of a single card to a given filename -void export_image(const SetP& set, const CardP& card, const String& filename); +/// Export the image of one or more cards to a given filename +void export_image(const SetP& set, const CardP& card, const String& filename); +void export_image(const SetP& set, const vector& cards, const String& path, const String& filename_template, FilenameConflicts conflicts); /// Export a set to Magic Workstation format void export_mws(Window* parent, const SetP& set); diff --git a/src/data/format/image.cpp b/src/data/format/image.cpp index 61056862..99953ab5 100644 --- a/src/data/format/image.cpp +++ b/src/data/format/image.cpp @@ -19,8 +19,6 @@ #include #include -#define wxIMAGE_OPTION_PNG_DESCRIPTION wxString("PngDescription") - // ----------------------------------------------------------------------------- : Card export class UnzoomedDataViewer : public DataViewer { @@ -101,7 +99,6 @@ Bitmap export_bitmap(const SetP& set, const CardP& card, const double zoom, cons return bitmap; } -// put multiple card images into one bitmap Bitmap export_bitmap(const SetP& set, const vector& cards, bool scale_to_lowest_dpi, int padding, const double zoom, const Radians angle_radians) { if (!set) throw Error(_("no set")); vector bitmaps; @@ -186,7 +183,7 @@ void export_image(const SetP& set, const CardP& card, const String& filename) { // but image.saveFile determines it automagicly } -void export_images(const SetP& set, const vector& cards, +void export_image(const SetP& set, const vector& cards, const String& path, const String& filename_template, FilenameConflicts conflicts) { wxBusyCursor busy; diff --git a/src/gui/add_json_window.cpp b/src/gui/add_json_window.cpp index 8c225b42..547bfc39 100644 --- a/src/gui/add_json_window.cpp +++ b/src/gui/add_json_window.cpp @@ -172,19 +172,6 @@ void AddJSONWindow::onBrowseFiles(wxCommandEvent&) { } void AddJSONWindow::onOk(wxCommandEvent&) { - - - - // debug test shit - export_image(set, set->cards.front(), "C:\\Users\\Oli\\Desktop\\tetest\\test.png"); - auto extImg = make_intrusive("C:/Users/Oli/Desktop/tetest/test.png"); - Image img = extImg->generate(GeneratedImage::Options(0, 0, set->stylesheet.get(), set.get())); - if (img.HasOption(wxIMAGE_OPTION_FILENAME)) queue_message(MESSAGE_ERROR, img.GetOption(wxIMAGE_OPTION_FILENAME)); - else queue_message(MESSAGE_ERROR, _("no dice")); - return; - - - /// Perform the import wxBusyCursor wait; // Read the file diff --git a/src/gui/images_export_window.cpp b/src/gui/images_export_window.cpp index b6a00092..865ab675 100644 --- a/src/gui/images_export_window.cpp +++ b/src/gui/images_export_window.cpp @@ -65,7 +65,7 @@ void ImagesExportWindow::onOk(wxCommandEvent&) { if (name.empty()) return; settings.default_export_dir = wxPathOnly(name); // Export - export_images(set, getSelection(), name, gs.images_export_filename, gs.images_export_conflicts); + export_image(set, getSelection(), name, gs.images_export_filename, gs.images_export_conflicts); // Done EndModal(wxID_OK); } diff --git a/src/main.cpp b/src/main.cpp index e8452565..7f680d19 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -253,7 +253,7 @@ int MSE::OnRun() { out = out.substr(pos + 1); } // export - export_images(set, set->cards, path, out, CONFLICT_NUMBER_OVERWRITE); + export_image(set, set->cards, path, out, CONFLICT_NUMBER_OVERWRITE); return EXIT_SUCCESS; } else if (args[0] == _("--export")) { if (args.size() < 2) {