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

Function zPlatform_Shake

src/SB/Game/zPlatform.cpp:1025–1053  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1023}
1024
1025void zPlatform_Shake(zPlatform* plat, F32 _unused, F32 ampl, F32 freq)
1026{
1027 xFFXShakeState* ss;
1028 xFFX* sfkt;
1029
1030 ss = xFFXShakeAlloc();
1031 if (ss != NULL)
1032 {
1033 sfkt = xFFXAlloc();
1034 if (sfkt == NULL)
1035 {
1036 xFFXShakeFree(ss);
1037 ss = NULL;
1038 }
1039 else
1040 {
1041 ss->disp.x = 0.0f;
1042 ss->disp.y = -ampl;
1043 ss->disp.z = 0.0f;
1044 ss->dur = 1.0f;
1045 ss->alpha = -7.0f / ss->dur;
1046 ss->freq = freq;
1047 ss->tmr = 0.0f;
1048 sfkt->doEffect = xFFXShakeUpdateEnt;
1049 sfkt->fdata = ss;
1050 xFFXAddEffect(plat, sfkt);
1051 }
1052 }
1053}
1054
1055static void zPlatform_Tremble(zPlatform* plat, F32 ampl, F32 freq, F32 dur)
1056{

Callers

nothing calls this directly

Calls 4

xFFXShakeAllocFunction · 0.85
xFFXAllocFunction · 0.85
xFFXShakeFreeFunction · 0.85
xFFXAddEffectFunction · 0.85

Tested by

no test coverage detected