refactor(data): reorganitza data/ i centralitza paths a defaults.hpp
This commit is contained in:
1 parent
9949096fba
commit
05465b791e
54 files changed
+368
-304
No files matched your search
@@ -6,6 +6,7 @@
|
||||
#include <string_view>
|
||||
|
||||
#include "core/resources/resource_pack.hpp"
|
||||
#include "utils/defaults.hpp"
|
||||
|
||||
namespace Resource::Helper {
|
||||
|
||||
@@ -92,7 +93,7 @@ namespace Resource::Helper {
|
||||
// carpeta `data/`).
|
||||
const auto FROM_PACK = [&filepath]() -> std::vector<std::uint8_t> {
|
||||
if (!g_pack_loaded) { return {}; }
|
||||
constexpr std::string_view PREFIX = "data/";
|
||||
const std::string_view PREFIX{Defaults::Paths::DATA_ROOT};
|
||||
std::string key = filepath;
|
||||
if (key.starts_with(PREFIX)) { key.erase(0, PREFIX.size()); }
|
||||
if (g_pack.hasResource(key)) { return g_pack.getResource(key); }
|
||||
|
||||
Reference in new issue
Block a user