summary refs log tree commit diff stats
path: root/tools/datapacker
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-08-19 20:19:48 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-08-19 20:19:48 -0400
commit724f8092c4808cdad47316e00949c04ee797acb5 (patch)
tree758d598fbc2d62c4620956b71b2a851791fd2dbf /tools/datapacker
parent511d813113b6e7986aff665603ca0196799e232d (diff)
downloadlingo2-archipelago-724f8092c4808cdad47316e00949c04ee797acb5.tar.gz
lingo2-archipelago-724f8092c4808cdad47316e00949c04ee797acb5.tar.bz2
lingo2-archipelago-724f8092c4808cdad47316e00949c04ee797acb5.zip
Store IDs in a yaml file
This is much more efficient than the txtpb format, and we only need an interface for it in C++ since the IDs will be packed into the binary proto representation.
Diffstat (limited to 'tools/datapacker')
-rw-r--r--tools/datapacker/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/datapacker/main.cpp b/tools/datapacker/main.cpp index 860d3c0..0beb304 100644 --- a/tools/datapacker/main.cpp +++ b/tools/datapacker/main.cpp
@@ -14,6 +14,7 @@
14#include "container.h" 14#include "container.h"
15#include "proto/data.pb.h" 15#include "proto/data.pb.h"
16#include "proto/human.pb.h" 16#include "proto/human.pb.h"
17#include "util/ids_yaml_format.h"
17 18
18namespace com::fourisland::lingo2_archipelago { 19namespace com::fourisland::lingo2_archipelago {
19namespace { 20namespace {
@@ -42,7 +43,7 @@ class DataPacker {
42 43
43 ProcessConnectionsFile(datadir_path / "connections.txtpb", std::nullopt); 44 ProcessConnectionsFile(datadir_path / "connections.txtpb", std::nullopt);
44 ProcessMaps(datadir_path); 45 ProcessMaps(datadir_path);
45 ProcessIdsFile(datadir_path / "ids.txtpb"); 46 ProcessIdsFile(datadir_path / "ids.yaml");
46 47
47 { 48 {
48 std::ofstream outputfile(outputpath_); 49 std::ofstream outputfile(outputpath_);
@@ -490,7 +491,7 @@ class DataPacker {
490 } 491 }
491 492
492 void ProcessIdsFile(std::filesystem::path path) { 493 void ProcessIdsFile(std::filesystem::path path) {
493 auto ids = ReadMessageFromFile<IdMappings>(path.string()); 494 auto ids = ReadIdsFromYaml(path.string());
494 495
495 for (const auto& [map_name, map] : ids.maps()) { 496 for (const auto& [map_name, map] : ids.maps()) {
496 for (const auto& [door_name, ap_id] : map.doors()) { 497 for (const auto& [door_name, ap_id] : map.doors()) {