summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/asset_packer.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/asset_packer.cc b/tools/asset_packer.cc
index 4aaa0e7..5646716 100644
--- a/tools/asset_packer.cc
+++ b/tools/asset_packer.cc
@@ -6,6 +6,7 @@
#include <cmath>
#include <cstdio> // for simplicity, use fprintf() for output generation
#include <cstring> // For std::memcpy
+#include <filesystem> // For path normalization
#include <fstream>
#include <map>
#include <regex> // For std::regex
@@ -320,7 +321,9 @@ int main(int argc, char* argv[]) {
if (!info.is_procedural) {
std::string base_dir =
assets_txt_path.substr(0, assets_txt_path.find_last_of("/\\") + 1);
- std::string full_path = base_dir + info.filename;
+ std::filesystem::path base_path = std::filesystem::absolute(base_dir);
+ std::filesystem::path combined_path = base_path / info.filename;
+ std::string full_path = combined_path.lexically_normal().string();
std::vector<uint8_t> buffer;
bool is_image = HasImageExtension(info.filename);