Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
Z2Audience.h
Go to the documentation of this file.
1#ifndef Z2AUDIENCE_H
2#define Z2AUDIENCE_H
3
10#include "JSystem/TPosition3.hh"
11
12struct Z2Audible;
13
15 /* 802BBCDC */ void calc(JGeometry::TVec3<f32> const&);
16 /* 802BBD18 */ void init(JGeometry::TVec3<f32>*, JGeometry::TVec3<f32> const&,
18
21};
22
24 /* 802BC758 */ Z2AudioCamera();
25 /* 802BC788 */ void init();
26 /* 802BC8AC */ void setCameraState(f32 (*)[4], Vec&, Vec&, f32, f32, bool, bool);
27 /* 802BC7DC */ void setCameraState(f32 const (*)[4], Vec&, bool);
28 /* 802BCBEC */ void convertAbsToRel(Z2Audible*, int);
29 /* 802BCC7C */ bool convertAbsToRel(Vec&, Vec*) const;
30 /* 802BCCC0 */ bool isInSight(Vec&) const;
32 f32 getVolCenterZ() const { return mVolCenterZ; }
33 void setMainCamera() { mSetMainCamera = true; }
35 if (volume < 0.0f) {
36 volume = 0.0f;
37 }
39 }
40 f32 getDolbyCenterZ() const { return mDolbyCenterZ; }
41 f32 getFovySin() const { return mFovySin; }
42 const JGeometry::TVec3<f32>* getVel() const { return &mVel; }
43
44
49 /* 0x54 */ f32 mFovySin;
50 /* 0x58 */ f32 mVolCenterZ;
51 /* 0x5C */ f32 mTargetVolume;
52 /* 0x60 */ f32 mDolbyCenterZ;
53 /* 0x64 */ f32 mCamDist;
54 /* 0x68 */ f32 field_0x68;
55 /* 0x6C */ f32 field_0x6c;
56 /* 0x70 */ bool mSetMainCamera;
57}; // Size: 0x74
58
59struct Z2SpotMic {
60 /* 802BCD28 */ Z2SpotMic();
61 /* 802BCDA8 */ void clearMicState(int);
62 /* 802BCDE8 */ void calcVolumeFactor(int);
63 /* 802BCE14 */ void setMicState(Z2AudioCamera*, int);
64 /* 802BCF5C */ f32 calcMicDist(Z2Audible*);
65 /* 802BCFE4 */ u32 calcMicPriority(f32);
66 /* 802BD03C */ f32 calcMicVolume(f32, int, f32);
67
69 bool isOn() const { return mMicOn; }
70
71 /* 0x00 */ f32 field_0x0;
72 /* 0x04 */ f32 field_0x4;
73 /* 0x08 */ f32 field_0x8;
74 /* 0x0C */ f32 field_0xc;
75 /* 0x10 */ Z2AudioCamera* field_0x10[1];
76 /* 0x14 */ Vec* mPosPtr;
77 /* 0x18 */ f32 field_0x18[1];
78 /* 0x1C */ f32 field_0x1c;
79 /* 0x20 */ f32 field_0x20[1];
80 /* 0x24 */ bool mIgnoreIfOut;
81 /* 0x25 */ bool mMicOn;
82 /* 0x26 */ u8 field_0x26[1];
83}; // Size: 0x28
84
86 /* 802BC248 */ Z2Audience3DSetting();
87 /* 802BC284 */ void init();
88 /* 802BC308 */ void initVolumeDist();
89 /* 802BC4D0 */ void updateVolumeDist(f32);
90 /* 802BC6A4 */ void initDolbyDist();
91 /* 802BC6F8 */ void updateDolbyDist(f32, f32);
92
94 field_0x0[1] = 1.25f * field_0x0[0];
95 field_0x0[2] = 1.5f * field_0x0[0];
96 field_0x0[3] = 2.0f * field_0x0[0];
97 field_0x0[4] = 3.0f * field_0x0[0];
98 field_0x0[5] = 4.0f * field_0x0[0];
99 field_0x0[6] = 6.0f * field_0x0[0];
100 field_0x0[7] = 8.0f * field_0x0[0];
101 field_0x0[8] = 0.9f * field_0x0[0];
102 field_0x0[9] = 0.8f * field_0x0[0];
103 field_0x0[10] = 0.7f * field_0x0[0];
104 field_0x0[11] = 0.6f * field_0x0[0];
105 field_0x0[12] = 0.5f * field_0x0[0];
106 field_0x0[13] = 0.4f * field_0x0[0];
107 field_0x0[14] = 0.3f * field_0x0[0];
108 for (int i = 0; i < 15; i++) {
109 field_0x70[i] = (field_0x40 - 1.0f) / (field_0x0[i] - field_0x3c);
110 }
111 }
112
114 for (int i = 0; i < 15; i++) {
116 }
117 }
118
120 for (int i = 0; i < 15; i++) {
122 }
123 }
124
125 /* 0x000 */ f32 field_0x0[15];
126 /* 0x03C */ f32 field_0x3c;
127 /* 0x040 */ f32 field_0x40;
128 /* 0x044 */ f32 field_0x44;
129 /* 0x048 */ f32 field_0x48;
130 /* 0x04C */ f32 field_0x4c;
131 /* 0x050 */ f32 field_0x50;
132 /* 0x054 */ f32 field_0x54;
133 /* 0x058 */ f32 field_0x58;
134 /* 0x05C */ f32 field_0x5c;
135 /* 0x060 */ f32 field_0x60;
136 /* 0x064 */ u32 field_0x64;
137 /* 0x068 */ f32 field_0x68;
138 /* 0x06C */ f32 field_0x6c;
139 /* 0x070 */ f32 field_0x70[15];
140 /* 0x0AC */ f32 field_0xac[15];
141 /* 0x0E8 */ f32 field_0xe8[15];
142 /* 0x124 */ bool mVolumeDistInit;
143 /* 0x125 */ bool mDolbyDistInit;
144}; // Size: 0x128
145
148 /* 0x0C */ f32 field_0xC;
149 /* 0x10 */ f32 field_0x10;
150};
151
153 /* 802BBE74 */ Z2AudibleChannel();
154 void init() {
155 field_0x0.init();
156 field_0x28 = -1.0f;
157 mPan = 0.5f;
158 mDolby = 0.0f;
159 field_0x34 = 1.0f;
160 }
161
164 /* 0x28 */ f32 field_0x28;
165 /* 0x2c */ f32 mPan;
166 /* 0x30 */ f32 mDolby;
167 /* 0x34 */ f32 field_0x34;
168};
169
170struct Z2Audible : public JAIAudible, public JASPoolAllocObject<Z2Audible> {
171 /* 802BBD94 */ Z2Audible(JGeometry::TVec3<f32> const&, JGeometry::TVec3<f32> const*, u32, bool);
172 /* 802BBE98 */ void calc();
173 /* 802BBED0 */ JASSoundParams* getOuterParams(int);
174 /* 802BBEE4 */ void setOuterParams(JASSoundParams const&, JASSoundParams const&, int);
175 /* 802BC204 */ Z2AudibleChannel* getChannel(int);
176 /* 802BC218 */ u32 getDistVolBit();
177 /* 802BD510 */ ~Z2Audible();
178 bool isDoppler() {
179 return ((*(u8*)&field_0x10.field_0x0) >> 4) & 0xf;
180 }
182 const JAUAudibleParam* getAudibleParam() const { return &field_0x10; }
185
189 /* 0x64 */ f32 field_0x64[1];
190};
191
192struct Z2Audience : public JAIAudience, public JASGlobalInstance<Z2Audience> {
193 /* 802BD130 */ Z2Audience();
194 /* 802BD2DC */ void setAudioCamera(f32 (*)[4], Vec&, Vec&, f32, f32, bool, int, bool);
195 /* 802BD704 */ f32 calcOffMicSound(f32);
196 /* 802BD90C */ void setTargetVolume(f32, int);
197 /* 802BD92C */ bool convertAbsToRel(Vec&, Vec*, int);
198 /* 802BD95C */ f32 calcRelPosVolume(Vec const&, f32, int);
199 /* 802BDA44 */ f32 calcRelPosPan(Vec const&, int);
200 /* 802BDB44 */ f32 calcRelPosDolby(Vec const&, int);
201 /* 802BDBDC */ f32 calcVolume_(f32, int) const;
202 /* 802BDC44 */ u32 calcDeltaPriority_(f32, int, bool) const;
203 /* 802BDCB0 */ f32 calcPitchDoppler_(JGeometry::TVec3<f32> const&,
205 JGeometry::TVec3<f32> const&, f32) const;
206 /* 802BDD00 */ f32 calcFxMix_(f32, int) const;
207 /* 802BDD48 */ f32 calcPitch_(Z2AudibleChannel*, Z2Audible const*, Z2AudioCamera const*) const;
208
209 /* 802BD1FC */ virtual ~Z2Audience();
210 /* 802BD338 */ virtual JAIAudible* newAudible(JGeometry::TVec3<f32> const&, JAISoundID,
211 JGeometry::TVec3<f32> const*, u32);
212 /* 802BDED4 */ virtual int getMaxChannels();
213 /* 802BD4D4 */ virtual void deleteAudible(JAIAudible*);
214 /* 802BD5B8 */ virtual u32 calcPriority(JAIAudible*);
215 /* 802BD71C */ virtual void mixChannelOut(JASSoundParams const&, JAIAudible*, int);
216
222
223 /* 0x004 */ f32 field_0x4;
224 /* 0x008 */ u8 field_0x8;
227 /* 0x1A8 */ Z2SpotMic mSpotMic[1];
228 /* 0x1D0 */ Z2SpotMic* mLinkMic;
229 /* 0x1D4 */ s32 mMaxChannels;
230 /* 0x1D8 */ u8 field_0x1d8[4];
231 /* 0x1DC */ bool mUsingOffMicVol;
232}; // Size: 0x1E0
233
237
238extern s8 data_80451358;
239extern s8 data_80451359;
240
241#endif /* Z2AUDIENCE_H */
s8 data_80451358
Definition Z2Audience.cpp:869
Z2Audience * Z2GetAudience()
Definition Z2Audience.h:234
s8 data_80451359
Definition Z2Audience.cpp:870
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition JAIAudible.h:12
Definition JASGadget.h:12
static T * getInstance()
Definition JASGadget.h:31
Definition JASHeapCtrl.h:239
static initFunc init[]
Definition d_menu_collect.cpp:42
int i
Definition e_pow.c:165
Definition JAIAudience.h:14
Definition d_a_obj_sekizoa.cpp:447
Definition JASSoundParams.h:10
void init()
Definition JASSoundParams.h:19
Definition JAUAudibleParam.h:8
union JAUAudibleParam::@115 field_0x0
Definition TPosition3.hh:78
Definition JGeometry.h:55
Definition d_a_hozelda.cpp:18
Definition Z2Audience.h:14
JGeometry::TVec3< f32 > field_0xc
Definition Z2Audience.h:20
JGeometry::TVec3< f32 > field_0x0
Definition Z2Audience.h:19
void calc(JGeometry::TVec3< f32 > const &)
Definition Z2Audience.cpp:18
Definition Z2Audience.h:152
JASSoundParams field_0x0
Definition Z2Audience.h:162
Z2AudibleChannel()
Definition Z2Audience.cpp:55
void init()
Definition Z2Audience.h:154
f32 field_0x34
Definition Z2Audience.h:167
f32 mPan
Definition Z2Audience.h:165
f32 mDolby
Definition Z2Audience.h:166
f32 field_0x28
Definition Z2Audience.h:164
Z2AudibleRelPos field_0x14
Definition Z2Audience.h:163
Definition Z2Audience.h:146
JGeometry::TVec3< f32 > field_0x00
Definition Z2Audience.h:147
f32 field_0xC
Definition Z2Audience.h:148
f32 field_0x10
Definition Z2Audience.h:149
Definition Z2Audience.h:170
JASSoundParams * getOuterParams(int)
Definition Z2Audience.cpp:67
u32 getDistVolBit()
Definition Z2Audience.cpp:152
JAUAudibleParam * getAudibleParam()
Definition Z2Audience.h:181
bool isDoppler()
Definition Z2Audience.h:178
~Z2Audible()
Definition Z2Audience.cpp:566
Z2AudibleAbsPos field_0x14
Definition Z2Audience.h:187
void setOuterParams(JASSoundParams const &, JASSoundParams const &, int)
Definition Z2Audience.cpp:74
void calc()
Definition Z2Audience.cpp:60
Z2AudibleChannel field_0x2c[1]
Definition Z2Audience.h:188
const JGeometry::TVec3< f32 > * getVel() const
Definition Z2Audience.h:184
Z2AudibleChannel * getChannel(int)
Definition Z2Audience.cpp:147
const JAUAudibleParam * getAudibleParam() const
Definition Z2Audience.h:182
JAUAudibleParam field_0x10
Definition Z2Audience.h:186
void setAudibleParam(JAUAudibleParam param)
Definition Z2Audience.h:183
f32 field_0x64[1]
Definition Z2Audience.h:189
Definition Z2Audience.h:85
f32 field_0x3c
Definition Z2Audience.h:126
f32 field_0x44
Definition Z2Audience.h:128
f32 field_0x54
Definition Z2Audience.h:132
f32 field_0x5c
Definition Z2Audience.h:134
void initVolumeDist()
Definition Z2Audience.cpp:189
f32 field_0x6c
Definition Z2Audience.h:138
Z2Audience3DSetting()
Definition Z2Audience.cpp:166
f32 field_0x40
Definition Z2Audience.h:127
void updateDolbyDist(f32, f32)
Definition Z2Audience.cpp:229
void init()
Definition Z2Audience.cpp:173
f32 field_0xac[15]
Definition Z2Audience.h:140
f32 field_0x4c
Definition Z2Audience.h:130
f32 field_0x0[15]
Definition Z2Audience.h:125
f32 field_0x60
Definition Z2Audience.h:135
f32 field_0x58
Definition Z2Audience.h:133
void calcPriorityFactorAll()
Definition Z2Audience.h:113
f32 field_0x50
Definition Z2Audience.h:131
f32 field_0x70[15]
Definition Z2Audience.h:139
void updateVolumeDist(f32)
Definition Z2Audience.cpp:204
f32 field_0xe8[15]
Definition Z2Audience.h:141
void initDolbyDist()
Definition Z2Audience.cpp:218
bool mVolumeDistInit
Definition Z2Audience.h:142
bool mDolbyDistInit
Definition Z2Audience.h:143
void calcFxMixFactorAll()
Definition Z2Audience.h:119
void calcVolumeFactorAll()
Definition Z2Audience.h:93
f32 field_0x48
Definition Z2Audience.h:129
f32 field_0x68
Definition Z2Audience.h:137
u32 field_0x64
Definition Z2Audience.h:136
Definition Z2Audience.h:192
u8 field_0x8
Definition Z2Audience.h:224
virtual u32 calcPriority(JAIAudible *)
Definition Z2Audience.cpp:570
bool mUsingOffMicVol
Definition Z2Audience.h:231
f32 field_0x4
Definition Z2Audience.h:223
virtual ~Z2Audience()
Definition Z2Audience.cpp:517
JGeometry::TVec3< f32 > getAudioCamPos()
Definition Z2Audience.h:218
u32 calcDeltaPriority_(f32, int, bool) const
Definition Z2Audience.cpp:785
virtual JAIAudible * newAudible(JGeometry::TVec3< f32 > const &, JAISoundID, JGeometry::TVec3< f32 > const *, u32)
Definition Z2Audience.cpp:529
Z2Audience()
Definition Z2Audience.cpp:508
bool convertAbsToRel(Vec &, Vec *, int)
Definition Z2Audience.cpp:684
f32 calcFxMix_(f32, int) const
Definition Z2Audience.cpp:812
void setTargetVolume(f32, int)
Definition Z2Audience.cpp:678
Z2Audience3DSetting mSetting
Definition Z2Audience.h:225
Z2SpotMic mSpotMic[1]
Definition Z2Audience.h:227
virtual void deleteAudible(JAIAudible *)
Definition Z2Audience.cpp:561
Z2SpotMic * mLinkMic
Definition Z2Audience.h:228
Z2Audience3DSetting * getSetting()
Definition Z2Audience.h:221
f32 calcPitch_(Z2AudibleChannel *, Z2Audible const *, Z2AudioCamera const *) const
Definition Z2Audience.cpp:824
f32 calcVolume_(f32, int) const
Definition Z2Audience.cpp:764
virtual void mixChannelOut(JASSoundParams const &, JAIAudible *, int)
Definition Z2Audience.cpp:617
u8 field_0x1d8[4]
Definition Z2Audience.h:230
f32 calcOffMicSound(f32)
Definition Z2Audience.cpp:607
virtual int getMaxChannels()
Definition Z2Audience.cpp:854
void setAudioCamera(f32(*)[4], Vec &, Vec &, f32, f32, bool, int, bool)
Definition Z2Audience.cpp:521
Z2AudioCamera mAudioCamera[1]
Definition Z2Audience.h:226
f32 calcRelPosPan(Vec const &, int)
Definition Z2Audience.cpp:711
f32 calcRelPosVolume(Vec const &, f32, int)
Definition Z2Audience.cpp:689
f32 calcRelPosDolby(Vec const &, int)
Definition Z2Audience.cpp:743
f32 calcPitchDoppler_(JGeometry::TVec3< f32 > const &, JGeometry::TVec3< f32 > const &, JGeometry::TVec3< f32 > const &, f32) const
Definition Z2Audience.cpp:803
Z2SpotMic * getLinkMic()
Definition Z2Audience.h:217
s32 mMaxChannels
Definition Z2Audience.h:229
Definition Z2Audience.h:23
f32 getDolbyCenterZ() const
Definition Z2Audience.h:40
f32 getVolCenterZ() const
Definition Z2Audience.h:32
f32 getFovySin() const
Definition Z2Audience.h:41
Z2AudioCamera()
Definition Z2Audience.cpp:247
JGeometry::TVec3< f32 > * getPos()
Definition Z2Audience.h:31
void init()
Definition Z2Audience.cpp:259
f32 mVolCenterZ
Definition Z2Audience.h:50
void convertAbsToRel(Z2Audible *, int)
Definition Z2Audience.cpp:338
JGeometry::TVec3< f32 > field_0x48
Definition Z2Audience.h:48
const JGeometry::TVec3< f32 > * getVel() const
Definition Z2Audience.h:42
f32 mCamDist
Definition Z2Audience.h:53
f32 mTargetVolume
Definition Z2Audience.h:51
f32 field_0x68
Definition Z2Audience.h:54
f32 mDolbyCenterZ
Definition Z2Audience.h:52
f32 mFovySin
Definition Z2Audience.h:49
f32 field_0x6c
Definition Z2Audience.h:55
JGeometry::TPosition3f32 field_0x0
Definition Z2Audience.h:45
void setMainCamera()
Definition Z2Audience.h:33
void setCameraState(f32(*)[4], Vec &, Vec &, f32, f32, bool, bool)
Definition Z2Audience.cpp:284
JGeometry::TVec3< f32 > mVel
Definition Z2Audience.h:46
JGeometry::TVec3< f32 > mPos
Definition Z2Audience.h:47
void setTargetVolume(f32 volume)
Definition Z2Audience.h:34
bool isInSight(Vec &) const
Definition Z2Audience.cpp:361
bool mSetMainCamera
Definition Z2Audience.h:56
Definition Z2Audience.h:59
f32 field_0x18[1]
Definition Z2Audience.h:77
void clearMicState(int)
Definition Z2Audience.cpp:395
void setMicState(Z2AudioCamera *, int)
Definition Z2Audience.cpp:408
f32 field_0x1c
Definition Z2Audience.h:78
void calcVolumeFactor(int)
Definition Z2Audience.cpp:403
f32 calcMicDist(Z2Audible *)
Definition Z2Audience.cpp:437
bool mIgnoreIfOut
Definition Z2Audience.h:80
u32 calcMicPriority(f32)
Definition Z2Audience.cpp:456
f32 field_0x8
Definition Z2Audience.h:73
bool isOn() const
Definition Z2Audience.h:69
bool mMicOn
Definition Z2Audience.h:81
f32 field_0x4
Definition Z2Audience.h:72
Z2AudioCamera * field_0x10[1]
Definition Z2Audience.h:75
f32 field_0x20[1]
Definition Z2Audience.h:79
void setPosPtr(Vec *i_posPtr)
Definition Z2Audience.h:68
u8 field_0x26[1]
Definition Z2Audience.h:82
f32 field_0xc
Definition Z2Audience.h:74
f32 field_0x0
Definition Z2Audience.h:71
Z2SpotMic()
Definition Z2Audience.cpp:382
Vec * mPosPtr
Definition Z2Audience.h:76
f32 calcMicVolume(f32, int, f32)
Definition Z2Audience.cpp:469
signed char s8
Definition types.h:4
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8