WwiseSwitchContainerLeafCookedData.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*******************************************************************************
  2. The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
  3. Technology released in source code form as part of the game integration package.
  4. The content of this file may not be used without valid licenses to the
  5. AUDIOKINETIC Wwise Technology.
  6. Note that the use of the game engine is subject to the Unreal(R) Engine End User
  7. License Agreement at https://www.unrealengine.com/en-US/eula/unreal
  8. License Usage
  9. Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
  10. this file in accordance with the end user license agreement provided with the
  11. software or, alternatively, in accordance with the terms contained
  12. in a written agreement between you and Audiokinetic Inc.
  13. Copyright (c) 2023 Audiokinetic Inc.
  14. *******************************************************************************/
  15. #include "Wwise/CookedData/WwiseSwitchContainerLeafCookedData.h"
  16. #include "Wwise/Stats/ResourceLoader.h"
  17. #include <inttypes.h>
  18. FWwiseSwitchContainerLeafCookedData::FWwiseSwitchContainerLeafCookedData():
  19. GroupValueSet(),
  20. SoundBanks(),
  21. Media(),
  22. ExternalSources()
  23. {}
  24. void FWwiseSwitchContainerLeafCookedData::Serialize(FArchive& Ar)
  25. {
  26. UStruct* Struct = StaticStruct();
  27. check(Struct);
  28. if (Ar.WantBinaryPropertySerialization())
  29. {
  30. Struct->SerializeBin(Ar, this);
  31. }
  32. else
  33. {
  34. Struct->SerializeTaggedProperties(Ar, (uint8*)this, Struct, nullptr);
  35. }
  36. }
  37. bool FWwiseSwitchContainerLeafCookedData::operator==(const FWwiseSwitchContainerLeafCookedData& Rhs) const
  38. {
  39. if (GroupValueSet.Num() != Rhs.GroupValueSet.Num() ||
  40. Media.Num() != Rhs.Media.Num() ||
  41. ExternalSources.Num() != Rhs.ExternalSources.Num() ||
  42. SoundBanks.Num() != Rhs.SoundBanks.Num() ||
  43. GroupValueSet.Difference(Rhs.GroupValueSet).Num() != 0)
  44. {
  45. return false;
  46. }
  47. for (int i = 0; i < Media.Num(); ++i)
  48. {
  49. if (Media[i] != Rhs.Media[i])
  50. {
  51. return false;
  52. }
  53. }
  54. for (int i = 0;i < ExternalSources.Num(); ++i)
  55. {
  56. if (ExternalSources[i] != Rhs.ExternalSources[i])
  57. {
  58. return false;
  59. }
  60. }
  61. for (int i = 0; i < SoundBanks.Num(); ++i)
  62. {
  63. if (SoundBanks[i] != Rhs.SoundBanks[i])
  64. {
  65. return false;
  66. }
  67. }
  68. return true;
  69. }
  70. FString FWwiseSwitchContainerLeafCookedData::GetDebugString() const
  71. {
  72. FString Result = TEXT("[");
  73. bool Add = false;
  74. for (const auto& GroupValue : GroupValueSet)
  75. {
  76. if (Add)
  77. {
  78. Result += TEXT(",");
  79. }
  80. else
  81. {
  82. Add = true;
  83. }
  84. Result += GroupValue.GetDebugString();
  85. }
  86. Result += TEXT("]");
  87. return Result;
  88. }