Add CAudioSoundEffect

This commit is contained in:
Phillip Stephens
2023-03-04 17:15:30 -08:00
parent 377ae23d66
commit 5119de575a
6 changed files with 225 additions and 27 deletions
+141
View File
@@ -0,0 +1,141 @@
#ifndef _CAUDIOSOUNDEFFECT
#define _CAUDIOSOUNDEFFECT
#include "CMayaSpline.bt"
#include "CVector3f.bt"
#include "Common.bt"
typedef struct STimelineEvent {
uint unk1;
float unk2;
} STimelineEvent;
typedef struct SFilterSettings {
ubyte type;
switch (type) {
case 1:
case 2:
case 3:
case 4:
uint unk1;
uint unk2;
break;
case 5:
uint unk1;
uint unk2;
break;
case 6:
case 7:
uint unk;
break;
case 8:
uint unk;
break;
case 0xFF:
case 9:
break;
default:
uint unk;
break;
}
} SFilterSettings;
typedef struct CAudioMetaSample {
GUID csmp;
float unk1;
uint unk2;
float unk3;
float unk4;
float unk5;
float unk6;
float unk7;
float unk8;
float unk9;
float unk10;
float unk11;
float unk12;
int unk13;
float unk14;
int unk15;
float unk16;
float unk17;
float unk18;
float unk19;
float unk20;
float unk21;
bool unk22;
bool unk23;
bool unk24;
bool unk25;
bool unk26;
CMayaSpline spline1<optimize = false>;
CMayaSpline spline2<optimize = false>;
CMayaSpline spline3<optimize = false>;
CMayaSpline spline4<optimize = false>;
uint timelineEventCount;
STimelineEvent timelineEvents[timelineEventCount];
uint unk27;
float unk28;
CMayaSpline spline5<optimize = false>;
CVector3f unk29;
SFilterSettings filterSettings1;
SFilterSettings filterSettings2;
} CAudioMetaSample;
typedef struct STimelineEventPairs {
uint unk1;
uint timelineEventCount;
STimelineEvent timelineEvents[timelineEventCount];
} STimelineEventPairs;
typedef struct CAudioSoundEffectEvent {
GUID guid;
uint unk1;
uint unk2;
char unk3[unk2];
} CAudioSoundEffectEvent;
typedef struct CAudioSoundEffect {
uint nameLen;
char name[nameLen];
float unk1;
// Loaded by CAudioSoundEffect::FinishConstructing
float unk2;
uint unk3<format = binary>;
if (((unk3 << 1) >> 6) & 1) {
ubyte unk4;
float unk5;
} else if ((unk3 & 4)) {
float unk5;
}
if ((unk3 >> 3) & 1) {
float unk6;
}
uchar unk7;
GUID objectId;
uint gobCount;
typedef struct CGobData {
byte unk1;
byte unk2;
float unk3;
uint metaSampleCount;
CAudioMetaSample metaSamples[metaSampleCount]<optimize = false>;
uint timelineEventPairCount;
STimelineEventPairs
timelineEventPairs[timelineEventPairCount]<optimize = false>;
if (unk1 != 0) {
uint eventDataCount;
typedef struct CEventData {
CAudioSoundEffectEvent effectEvent;
uint timelineEventCount;
STimelineEvent timelineEvents[timelineEventCount];
} CEventData;
CEventData eventData[eventDataCount]<optimize = false>;
}
} CGobData;
CGobData gobs[gobCount]<optimize = false>;
} CAudioSoundEffect;
#endif // _CAUDIOSOUNDEFFECT
+37 -26
View File
@@ -54,16 +54,27 @@ struct CCharInfo
{
CPooledNameData namePool;
}
byte unk;
byte unk; //boolean
byte unk;
byte unk;
byte unk1;
byte unk2; //boolean
char data[(unk1 & 0x7FFF) * 2];
byte unk3;
byte unk4;
if (isDKCTF)
{
byte unk2[12];
byte flags1;
uint16 flags2;
} else {
uint16 unk5;
uint16 unk6;
uint16 unk7;
char animData1[unk3 * 6];
char animData2[unk5];
byte unk8;
uint16 unk9;
uint16 unk10;
uint16 unk11;
uint16 unk12;
}
};
@@ -76,13 +87,13 @@ struct CAnimationIdMap
struct CCharacterModelSet
{
if (ReadByte() == 0)
{
CStringFixed name;
}
else
{
CString name;
if (ReadByte() == 0)
{
CStringFixed name;
}
else
{
CString name;
}
GUID skeletonID;
CAABox aabox;
@@ -90,13 +101,13 @@ struct CCharacterModelSet
struct CAnimationInfo
{
if (ReadByte() == 0)
{
CStringFixed name;
}
else
{
CString name;
if (ReadByte() == 0)
{
CStringFixed name;
}
else
{
CString name;
}
GUID skeletonID;
FourCC chunkID;
@@ -112,13 +123,13 @@ struct FCharInf
if (isDKCTF)
{
CCharInfo charInfo<optimize=false>;
if (ReadByte() == 0)
{
CStringFixed name;
}
else
{
CString name;
if (ReadByte() == 0)
{
CStringFixed name;
}
else
{
CString name;
}
GUID skeletonID;
uint32 modelSets;
+32
View File
@@ -0,0 +1,32 @@
#ifndef _CMAYASPLINE
#define _CMAYASPLINE
#include "Common.bt"
#include "CVector2f.bt"
typedef struct CMayaSplineKnot {
float unk1;
float unk2;
byte unk3;
byte unk4;
if (unk3 == 5) {
CVector2f tangentA;
}
if (unk4 == 5) {
CVector2f tangentB;
}
} CMayaSplineKnot;
typedef struct CMayaSpline {
uint knotCount;
CMayaSplineKnot knots[knotCount] <optimize = false>;
float minAmplitudeTime;
float maxAmplitudeTime;
byte unk1;
byte unk2;
byte unk3;
} CMayaSpline;
#endif// _CMAYASPLINE
+10
View File
@@ -0,0 +1,10 @@
#ifndef _CVECTOR2F
#define _CVECTOR2F
typedef struct {
float x, y;
} CVector2f;
#endif// _CVECTOR2F
+1 -1
View File
@@ -17,7 +17,7 @@ struct CVectorField {
Printf("v %f %f %f\n", vectors[i].x, vectors[i].y, vectors[i].z);
Printf("v %f %f %f\n", vectors[i].x + 0.00005, vectors[i].y + 0.00005, vectors[i].z + 0.00005);
}
for (i = 0; i < vectorCount; ++i) {
for (i = 0; i < vectorCount * 3; i += 3) {
Printf("f %i %i %i\n", i + 1, i + 2, i + 3);
}
};
+4
View File
@@ -16,6 +16,7 @@ if (!exists(isDKCTF)) {
// Files
#include "CAudioBusHierarchy.bt"
#include "CAudioSampleBank.bt"
#include "CAudioSoundEffect.bt"
#include "CCharInfo.bt"
#include "CCollisionTree.bt"
#include "CDataEnumObject.bt"
@@ -53,6 +54,9 @@ typedef struct {
case "MATI":
CMaterialInstanceResource materialInstance;
break;
case "CAUD":
CAudioSoundEffect audioSoundEffect;
break;
case "CBNK":
CAudioSampleBank audioSampleBank;
break;