From 460b99583bcf6da4462f13ad75856283849904e7 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 4 Nov 2024 02:37:02 -0500 Subject: main.cpp does work for standalone entry --- wizard.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'wizard.cpp') diff --git a/wizard.cpp b/wizard.cpp index 4eaefb3..1541fed 100644 --- a/wizard.cpp +++ b/wizard.cpp @@ -38,13 +38,9 @@ class pix_deleter { using pix_ptr = std::unique_ptr; -wizard::wizard(std::string cardsPath, std::string cachePath, - std::string outputPath, std::string jsonPath, std::mt19937& rng) - : cards_(cardsPath), - images_(cachePath), - outputPath_(outputPath), - jsonPath_(jsonPath), - rng_(rng) { +wizard::wizard(const cardset& cards, const imagestore& images, std::string text, + std::mt19937& rng) + : cards_(cards), images_(images), text_(text), rng_(rng()) { std::cout << "Characters: "; for (char ch : cards_.getCharacters()) { @@ -54,8 +50,8 @@ wizard::wizard(std::string cardsPath, std::string cachePath, std::cout << std::endl; } -void wizard::run() { - std::string text = "what the heck, it's just some gay guy"; +Magick::Image wizard::run() { + std::string text = text_; //"what the heck, it's just some gay guy"; // getline(std::cin, text); if (text.back() == '\r') { text.pop_back(); @@ -252,5 +248,6 @@ void wizard::run() { } endImage.magick("PNG"); - endImage.write(outputPath_); + + return endImage; } -- cgit 1.4.1