Skip to content

Commit b10ac82

Browse files
committed
Add adjustments for ARK's streamed SoundWaves
1 parent 7506d21 commit b10ac82

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Unreal/UnSound.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ class USoundWave : public UObject // actual parent is USoundBase
143143
DECLARE_CLASS(USoundWave, UObject);
144144
public:
145145
bool bStreaming;
146+
#if ARK
147+
bool bReallyUseStreamingReserved;
148+
#endif
146149
FByteBulkData RawData;
147150
FGuid CompressedDataGuid;
148151
TArray<FSoundFormatData> CompressedFormatData; // FFormatContainer in UE4
@@ -155,12 +158,18 @@ class USoundWave : public UObject // actual parent is USoundBase
155158

156159
USoundWave()
157160
: bStreaming(false)
161+
#if ARK
162+
, bReallyUseStreamingReserved(false)
163+
#endif
158164
{}
159165

160166
BEGIN_PROP_TABLE
161167
PROP_INT(NumChannels)
162168
PROP_INT(SampleRate)
163169
PROP_BOOL(bStreaming)
170+
#if ARK
171+
PROP_BOOL(bReallyUseStreamingReserved) // equivalent of bStreaming in ARK
172+
#endif
164173
PROP_DROP(bHasVirtualizeWhenSilent)
165174
PROP_DROP(bVirtualizeWhenSilent)
166175
PROP_DROP(Duration)
@@ -173,6 +182,13 @@ class USoundWave : public UObject // actual parent is USoundBase
173182

174183
Super::Serialize(Ar);
175184

185+
#if ARK
186+
if (Ar.Game == GAME_Ark)
187+
{
188+
bStreaming = bReallyUseStreamingReserved;
189+
}
190+
#endif
191+
176192
bool bCooked;
177193
Ar << bCooked;
178194

@@ -200,6 +216,14 @@ class USoundWave : public UObject // actual parent is USoundBase
200216

201217
if (bStreaming)
202218
{
219+
#if ARK
220+
if (Ar.Game == GAME_Ark)
221+
{
222+
// another bCooked. this one is relevant for streaming.
223+
// if negative, there's no data after it, but that won't happen with client assets.
224+
Ar << bCooked;
225+
}
226+
#endif
203227
int32 NumChunks;
204228
FName AudioFormat;
205229
Ar << NumChunks << StreamedFormat;

0 commit comments

Comments
 (0)