forked from jaildesigner-jailgames/jaildoctors_dilemma
fix: coreció de rutes en resource_helper.cpp
This commit is contained in:
@@ -107,6 +107,13 @@ auto getPackPath(const std::string& asset_path) -> std::string {
|
||||
// Convert backslashes to forward slashes
|
||||
std::ranges::replace(path, '\\', '/');
|
||||
|
||||
// If it's an absolute path containing "/data/", extract everything after "/data/"
|
||||
// This handles paths like: /Users/sergio/.../data/palette/file.pal -> palette/file.pal
|
||||
size_t data_pos = path.find("/data/");
|
||||
if (data_pos != std::string::npos) {
|
||||
return path.substr(data_pos + 6); // +6 to skip "/data/"
|
||||
}
|
||||
|
||||
// Remove leading slashes
|
||||
while (!path.empty() && path[0] == '/') {
|
||||
path = path.substr(1);
|
||||
|
||||
Reference in New Issue
Block a user