back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/img_handler.cpp
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2024-11-21 23:01:56 +0300
committerscratko <m@scratko.xyz>2024-11-21 23:01:56 +0300
commite9078b6980eaf22c1f6352930bd36d4a9e85a4b0 (patch)
treedea9e3659bd18dbd52dc3eedb55ac6acfcc14370 /img_handler.cpp
parentca449b813cef6c8f7348ff51302f125587a90a53 (diff)
downloadpicture-puzzle-e9078b6980eaf22c1f6352930bd36d4a9e85a4b0.tar.gz
picture-puzzle-e9078b6980eaf22c1f6352930bd36d4a9e85a4b0.tar.bz2
picture-puzzle-e9078b6980eaf22c1f6352930bd36d4a9e85a4b0.zip
Including resources in the object file
Convert pictures to array data (image_converter/converter.c) Resources are located in image_converter/resources.o
Diffstat (limited to 'img_handler.cpp')
-rw-r--r--img_handler.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/img_handler.cpp b/img_handler.cpp
index 8285de6..921f639 100644
--- a/img_handler.cpp
+++ b/img_handler.cpp
@@ -12,10 +12,18 @@
#include <filesystem>
#include <stdio.h>
#include <iostream>
+#include <string>
ImageHandler::ImageHandler(const char *p) : path_to_file(p) {
img_data = nullptr;
resized_data = nullptr;
+ /*
+ * creating resources directory (if it didn't exist)
+ */
+ std::filesystem::path res_path = std::string("resources");
+ if(!std::filesystem::exists(res_path))
+ std::filesystem::create_directory(res_path);
+
#if defined(_WIN32)
auto it = path_to_file.find_last_of('\\');
#else