activity_sdk_native_pack_internal.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #pragma once
  2. #include <cstdint>
  3. #include <memory>
  4. #include <vector>
  5. #include "activity_sdk_authored_scene_inventory.h"
  6. #include "activity_sdk_native_pack_pipeline.h"
  7. #include "activity_sdk_squad_inventory.h"
  8. #include "activity_sdk_topology_enrichment.h"
  9. namespace sunrise::client::content::activity::sdk_generation::native_pack_pipeline {
  10. namespace reader = middleware::content::packages::reader;
  11. namespace authored_scene = authored_scene_inventory;
  12. namespace squads = squad_inventory;
  13. namespace topology_enrichment = sdk_generation::topology_enrichment;
  14. /** One cache-owning package reader shared by squad and authored-scene extraction. */
  15. struct PackageContext final {
  16. const reader::Source* source{};
  17. std::unique_ptr<reader::Scratch> scratch{};
  18. CancelProbe cancel{};
  19. void* cancelContext{};
  20. ~PackageContext() noexcept {
  21. if (scratch != nullptr) {
  22. reader::close_files(*scratch);
  23. }
  24. }
  25. };
  26. /** @return True when the caller asked this pass to stop. */
  27. [[nodiscard]] bool cancelled(CancelProbe probe, void* context) noexcept;
  28. /** Adapts the checked package reader to the squad and authored-scene boundaries. */
  29. [[nodiscard]] bool read_tag(void* opaque,
  30. std::uint32_t tag,
  31. std::vector<std::byte>& bytes,
  32. std::uint32_t& classId) noexcept;
  33. /** Reads one tag only when its physical class matches the typed edge being followed. */
  34. [[nodiscard]] bool read_localized_tag(void* opaque,
  35. std::uint32_t tag,
  36. std::uint32_t expectedClass,
  37. std::vector<std::byte>& bytes) noexcept;
  38. /** Extracts localized dialogue aliases and safe authored directive elements. */
  39. [[nodiscard]] bool attach_authored_text(const topology_inventory::Snapshot& topology,
  40. const squads::Facts& facts,
  41. PackageContext& packageContext,
  42. authored_scene::Snapshot& output);
  43. /** Extracts the groups each exact combat objective can assign to a squad. */
  44. [[nodiscard]] bool attach_combat_objective_groups(const topology_inventory::Snapshot& topology,
  45. const squads::Facts& facts,
  46. PackageContext& packageContext,
  47. authored_scene::Snapshot& output);
  48. /** Resolves the native type-53 authored list and attaches its exact bound to the SDK slot row. */
  49. [[nodiscard]] bool attach_dialogue_cue_counts(const topology_inventory::Snapshot& topology,
  50. const squads::Facts& facts,
  51. PackageContext& packageContext,
  52. topology_enrichment::Snapshot& enrichment,
  53. authored_scene::Snapshot& authored);
  54. /** Marks the SDK slot row of every type-43 scene whose descriptor names no resource. */
  55. [[nodiscard]] bool attach_unresourced_scenes(const topology_inventory::Snapshot& topology,
  56. const authored_scene::Snapshot& scenes,
  57. topology_enrichment::Snapshot& enrichment) noexcept;
  58. } // namespace sunrise::client::content::activity::sdk_generation::native_pack_pipeline