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-22 01:48:47 +0300
commit2f17165bd4c86885a75424d4f0ce6198c46c84b4 (patch)
treeadca6245c4f5859f271bd5880175fd56c603fd2c /img_handler.cpp
parentca449b813cef6c8f7348ff51302f125587a90a53 (diff)
downloadpicture-puzzle-2f17165bd4c86885a75424d4f0ce6198c46c84b4.tar.gz
picture-puzzle-2f17165bd4c86885a75424d4f0ce6198c46c84b4.tar.bz2
picture-puzzle-2f17165bd4c86885a75424d4f0ce6198c46c84b4.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