diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/datapacker/main.cpp | 7 | ||||
-rw-r--r-- | tools/validator/human_processor.cpp | 11 | ||||
-rw-r--r-- | tools/validator/structs.h | 3 | ||||
-rw-r--r-- | tools/validator/validator.cpp | 12 |
4 files changed, 31 insertions, 2 deletions
diff --git a/tools/datapacker/main.cpp b/tools/datapacker/main.cpp index e807d74..9b487e4 100644 --- a/tools/datapacker/main.cpp +++ b/tools/datapacker/main.cpp | |||
@@ -91,6 +91,13 @@ class DataPacker { | |||
91 | if (metadata.has_display_name()) { | 91 | if (metadata.has_display_name()) { |
92 | map.set_display_name(metadata.display_name()); | 92 | map.set_display_name(metadata.display_name()); |
93 | } | 93 | } |
94 | |||
95 | if (metadata.has_worldport_entrance()) { | ||
96 | map.set_worldport_entrance(container_.FindOrAddPort( | ||
97 | metadata.worldport_entrance().map(), | ||
98 | metadata.worldport_entrance().room(), | ||
99 | metadata.worldport_entrance().name(), map_name, std::nullopt)); | ||
100 | } | ||
94 | } | 101 | } |
95 | 102 | ||
96 | void ProcessRooms(std::filesystem::path path, | 103 | void ProcessRooms(std::filesystem::path path, |
diff --git a/tools/validator/human_processor.cpp b/tools/validator/human_processor.cpp index 2c978bf..de80db0 100644 --- a/tools/validator/human_processor.cpp +++ b/tools/validator/human_processor.cpp | |||
@@ -77,6 +77,17 @@ class HumanProcessor { | |||
77 | for (const std::string& path : metadata.excluded_nodes()) { | 77 | for (const std::string& path : metadata.excluded_nodes()) { |
78 | map_info.game_nodes[path].uses++; | 78 | map_info.game_nodes[path].uses++; |
79 | } | 79 | } |
80 | |||
81 | if (metadata.has_worldport_entrance()) { | ||
82 | auto port_identifier = GetCompletePortIdentifier( | ||
83 | metadata.worldport_entrance(), current_map_name, std::nullopt); | ||
84 | if (port_identifier) { | ||
85 | PortInfo& port_info = info_.ports[*port_identifier]; | ||
86 | port_info.map_worldport_entrances.push_back(current_map_name); | ||
87 | } else { | ||
88 | map_info.malformed_worldport_entrance = metadata.worldport_entrance(); | ||
89 | } | ||
90 | } | ||
80 | } | 91 | } |
81 | 92 | ||
82 | void ProcessRooms(std::filesystem::path path, | 93 | void ProcessRooms(std::filesystem::path path, |
diff --git a/tools/validator/structs.h b/tools/validator/structs.h index d1d45f2..a6787cf 100644 --- a/tools/validator/structs.h +++ b/tools/validator/structs.h | |||
@@ -27,6 +27,8 @@ struct GameNodeInfo { | |||
27 | 27 | ||
28 | struct MapInfo { | 28 | struct MapInfo { |
29 | std::map<std::string, GameNodeInfo> game_nodes; | 29 | std::map<std::string, GameNodeInfo> game_nodes; |
30 | |||
31 | std::optional<PortIdentifier> malformed_worldport_entrance; | ||
30 | }; | 32 | }; |
31 | 33 | ||
32 | struct RoomInfo { | 34 | struct RoomInfo { |
@@ -57,6 +59,7 @@ struct PortInfo { | |||
57 | 59 | ||
58 | std::vector<HumanConnection> connections_referenced_by; | 60 | std::vector<HumanConnection> connections_referenced_by; |
59 | std::vector<HumanConnection> target_connections_referenced_by; | 61 | std::vector<HumanConnection> target_connections_referenced_by; |
62 | std::vector<std::string> map_worldport_entrances; | ||
60 | }; | 63 | }; |
61 | 64 | ||
62 | struct PaintingInfo { | 65 | struct PaintingInfo { |
diff --git a/tools/validator/validator.cpp b/tools/validator/validator.cpp index 93efdc6..c048bab 100644 --- a/tools/validator/validator.cpp +++ b/tools/validator/validator.cpp | |||
@@ -69,6 +69,11 @@ class Validator { | |||
69 | << " is not defined in the game file." << std::endl; | 69 | << " is not defined in the game file." << std::endl; |
70 | } | 70 | } |
71 | } | 71 | } |
72 | |||
73 | if (map_info.malformed_worldport_entrance) { | ||
74 | std::cout << "The worldport entrance for map " << map_name | ||
75 | << " is malformed." << std::endl; | ||
76 | } | ||
72 | } | 77 | } |
73 | 78 | ||
74 | void ValidateRoom(const RoomIdentifier& room_identifier, | 79 | void ValidateRoom(const RoomIdentifier& room_identifier, |
@@ -253,6 +258,10 @@ class Validator { | |||
253 | std::cout << " CONNECTION " << connection.ShortDebugString() | 258 | std::cout << " CONNECTION " << connection.ShortDebugString() |
254 | << std::endl; | 259 | << std::endl; |
255 | } | 260 | } |
261 | |||
262 | for (const std::string& map_name : port_info.map_worldport_entrances) { | ||
263 | std::cout << " MAP (worldport_entrance) " << map_name << std::endl; | ||
264 | } | ||
256 | } else if (port_info.definitions.size() > 1) { | 265 | } else if (port_info.definitions.size() > 1) { |
257 | std::cout << "Port " << port_identifier.ShortDebugString() | 266 | std::cout << "Port " << port_identifier.ShortDebugString() |
258 | << " was defined multiple times." << std::endl; | 267 | << " was defined multiple times." << std::endl; |
@@ -283,8 +292,7 @@ class Validator { | |||
283 | } | 292 | } |
284 | if (!port.has_rotation()) { | 293 | if (!port.has_rotation()) { |
285 | std::cout << "Port " << port_identifier.ShortDebugString() | 294 | std::cout << "Port " << port_identifier.ShortDebugString() |
286 | << " is shuffleable and missing a rotation." | 295 | << " is shuffleable and missing a rotation." << std::endl; |
287 | << std::endl; | ||
288 | } | 296 | } |
289 | } | 297 | } |
290 | } | 298 | } |