chore(release): v0.21.0 — empaquetat de recursos (AE26) i neteja de fonts
- Nou format de pack AE26 v1 (XOR + djb2), eina `pack_resources`, regeneració automàtica de `build/resources.pack` a cada build. - `Resource::Helper` amb init/shutdown, fallback a disc només en Debug (apunta al source tree); Release exigeix pack present. - Callers de YAML migrats a `loadFile`+deserialize des de buffer. - Arrel neta: el pack viu a `build/`, eliminat `sync_data`. - Placeholder font -> `ari-w9500-condensed-display`; esborrades variants bold/condensed no usades a `data/fonts/`.
This commit is contained in:
1 parent
aeed0e01c2
commit
4da05b3d76
24 files changed
+574
-625
No files matched your search
@@ -13,17 +13,18 @@ auto KeyConfig::get() -> KeyConfig& {
|
||||
}
|
||||
|
||||
void KeyConfig::load(const std::string& file_path) {
|
||||
const auto FULL = Resource::Helper::resolve(file_path);
|
||||
std::ifstream file(FULL);
|
||||
if (!file.is_open()) {
|
||||
std::cerr << "KeyConfig: no s'ha pogut obrir " << FULL << '\n';
|
||||
auto bytes = Resource::Helper::loadFile(file_path);
|
||||
if (bytes.empty()) {
|
||||
std::cerr << "KeyConfig: no s'ha pogut obrir " << file_path << '\n';
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
auto yaml = fkyaml::node::deserialize(file);
|
||||
const auto* begin = reinterpret_cast<const char*>(bytes.data());
|
||||
const auto* end = begin + bytes.size();
|
||||
auto yaml = fkyaml::node::deserialize(begin, end);
|
||||
if (!yaml.contains("keys") || !yaml["keys"].is_sequence()) {
|
||||
std::cerr << "KeyConfig: falta la secció 'keys' a " << FULL << '\n';
|
||||
std::cerr << "KeyConfig: falta la secció 'keys' a " << file_path << '\n';
|
||||
return;
|
||||
}
|
||||
bindings_.clear();
|
||||
@@ -38,9 +39,9 @@ void KeyConfig::load(const std::string& file_path) {
|
||||
}
|
||||
bindings_[ID] = SC;
|
||||
}
|
||||
std::cout << "KeyConfig: " << bindings_.size() << " bindings des de " << FULL << '\n';
|
||||
std::cout << "KeyConfig: " << bindings_.size() << " bindings des de " << file_path << '\n';
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << "KeyConfig: error parsejant " << FULL << ": " << e.what() << '\n';
|
||||
std::cerr << "KeyConfig: error parsejant " << file_path << ": " << e.what() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user