From b53018acc54a7b8812a0b9830562879071d05fa6 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 21 Sep 2025 12:44:50 -0400 Subject: [Data] Annotate shuffleable ports --- tools/datapacker/main.cpp | 8 +++++++- tools/validator/validator.cpp | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/datapacker/main.cpp b/tools/datapacker/main.cpp index 596259b..33e4cfe 100644 --- a/tools/datapacker/main.cpp +++ b/tools/datapacker/main.cpp @@ -239,7 +239,13 @@ class DataPacker { Port& port = *container_.all_objects().mutable_ports(port_id); port.set_path(h_port.path()); - port.set_orientation(h_port.orientation()); + + if (h_port.no_shuffle()) { + port.set_no_shuffle(h_port.no_shuffle()); + } else { + *port.mutable_destination() = h_port.destination(); + port.set_rotation(h_port.rotation()); + } // Setting this explicitly because the Godot protobuf doesn't support // custom defaults. diff --git a/tools/validator/validator.cpp b/tools/validator/validator.cpp index dd41f5c..93efdc6 100644 --- a/tools/validator/validator.cpp +++ b/tools/validator/validator.cpp @@ -273,6 +273,21 @@ class Validator { } } } + + for (const HumanPort& port : port_info.definitions) { + if (!port.no_shuffle()) { + if (!port.has_destination()) { + std::cout << "Port " << port_identifier.ShortDebugString() + << " is shuffleable and missing a destination." + << std::endl; + } + if (!port.has_rotation()) { + std::cout << "Port " << port_identifier.ShortDebugString() + << " is shuffleable and missing a rotation." + << std::endl; + } + } + } } void ValidatePainting(const PaintingIdentifier& painting_identifier, -- cgit 1.4.1