Quellcode durchsuchen

Move the unresourced scene flags next to their caller

attach_unresourced_scenes sets slot flags and reads no text, so it moves
from the authored text source to the pipeline source that calls it. The
text source stays under the 40 KiB file limit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
stan vor 5 Tagen
Ursprung
Commit
f86409ece2

+ 22 - 0
Sunrise/src/client/content/activity/activity_sdk_native_pack_pipeline.cpp

@@ -220,6 +220,28 @@ lua_source(const state::activity_sdk::identity::Expected& identity,
 
 } // namespace
 
+/** Flags the slot rows of the scenes the inventory found without a resource. */
+bool attach_unresourced_scenes(const topology_inventory::Snapshot& topology,
+                               const authored_scene::Snapshot& scenes,
+                               topology_enrichment::Snapshot& enrichment) noexcept {
+    if (enrichment.slots.size() != topology.slots.size()) {
+        return false;
+    }
+    for (const std::uint32_t slotRow : scenes.unresourcedSlots) {
+        if (slotRow >= topology.slots.size()
+            || topology.slots[slotRow].slotType != format::kAuthoredSceneSlotType) {
+            return false;
+        }
+        topology_enrichment::Slot& enriched = enrichment.slots[slotRow];
+        if (enriched.componentClass != format::kAuthoredSceneComponentClass
+            || (enriched.flags & format::kSlotSchemaJoinExact) == 0) {
+            return false;
+        }
+        enriched.flags |= format::kSlotAuthoredSceneUnresourced;
+    }
+    return true;
+}
+
 /** Returns the stable log token for each pipeline result. */
 const char* status_name(Status value) noexcept {
     switch (value) {

+ 0 - 22
Sunrise/src/client/content/activity/activity_sdk_native_pack_text.cpp

@@ -798,26 +798,4 @@ bool attach_dialogue_cue_counts(const topology_inventory::Snapshot& topology,
     }
 }
 
-/** Flags the slot rows of the scenes the inventory found without a resource. */
-bool attach_unresourced_scenes(const topology_inventory::Snapshot& topology,
-                               const authored_scene::Snapshot& scenes,
-                               topology_enrichment::Snapshot& enrichment) noexcept {
-    if (enrichment.slots.size() != topology.slots.size()) {
-        return false;
-    }
-    for (const std::uint32_t slotRow : scenes.unresourcedSlots) {
-        if (slotRow >= topology.slots.size()
-            || topology.slots[slotRow].slotType != format::kAuthoredSceneSlotType) {
-            return false;
-        }
-        topology_enrichment::Slot& enriched = enrichment.slots[slotRow];
-        if (enriched.componentClass != format::kAuthoredSceneComponentClass
-            || (enriched.flags & format::kSlotSchemaJoinExact) == 0) {
-            return false;
-        }
-        enriched.flags |= format::kSlotAuthoredSceneUnresourced;
-    }
-    return true;
-}
-
 } // namespace sunrise::client::content::activity::sdk_generation::native_pack_pipeline