MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xSFXEventCB

Function xSFXEventCB

src/SB/Core/x/xSFX.cpp:185–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185S32 xSFXEventCB(xBase* to, xBase* from, U32 toEvent, const F32* toParam, xBase* toParamWidget)
186{
187 xSFX* t = (xSFX*)from;
188
189 switch (toEvent)
190 {
191 case eEventReset:
192 xSFXReset(t);
193 break;
194 case eEventPlay:
195 t->asset->flagsSFX |= 0x1000;
196 if (!(t->asset->flagsSFX & 0x200))
197 {
198 xSFXPlay(t);
199 }
200 break;
201 case eEventPlayMaybe:
202 if (xrand() % 100 >= toParam[0])
203 {
204 t->asset->flagsSFX |= 0x1000;
205 if (!(t->asset->flagsSFX & 0x200))
206 {
207 xSFXPlay(t);
208 }
209 }
210 break;
211 case eEventStop:
212 if (t->sndID != 0)
213 {
214 t->asset->flagsSFX &= 0xEFFF;
215 if (!(t->asset->flagsSFX & 0x200))
216 {
217 xSFXStop(t);
218 }
219 }
220
221 break;
222 case eEventPause:
223 while (true)
224 {
225 }
226 break;
227 }
228
229 return 1;
230}
231
232static void xSFXPlay(xSFX* t)
233{

Callers

nothing calls this directly

Calls 4

xSFXResetFunction · 0.85
xrandFunction · 0.85
xSFXStopFunction · 0.85
xSFXPlayFunction · 0.70

Tested by

no test coverage detected