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

Function zPlatform_Tremble

src/SB/Game/zPlatform.cpp:1055–1092  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1053}
1054
1055static void zPlatform_Tremble(zPlatform* plat, F32 ampl, F32 freq, F32 dur)
1056{
1057 xFFXShakeState* ss;
1058 xFFX* sfkt;
1059 xParEmitterCustomSettings info;
1060 S32 i;
1061
1062 ss = xFFXShakeAlloc();
1063 if (ss != NULL)
1064 {
1065 sfkt = xFFXAlloc();
1066 if (sfkt == NULL)
1067 {
1068 xFFXShakeFree(ss);
1069 return;
1070 }
1071
1072 xVec3SMul(&ss->disp, (xVec3*)&globals.camera.mat, ampl);
1073 ss->dur = dur;
1074 ss->alpha = 1.0f / dur;
1075 ss->freq = freq;
1076 ss->tmr = 0.0f;
1077 sfkt->doEffect = xFFXShakeUpdateEnt;
1078 sfkt->fdata = ss;
1079 xFFXAddEffect(plat, sfkt);
1080 }
1081
1082 if (sEmitTremble != NULL)
1083 {
1084 info.custom_flags = 0x100;
1085 info.pos = *xEntGetCenter(plat);
1086 for (i = 0; i < 25; i++)
1087 {
1088 // Emit a particle at every 30 frames?
1089 xParEmitterEmitCustom(sEmitTremble, 1.0f / 30, &info);
1090 }
1091 }
1092}
1093
1094void zPlatform_BreakawayFallFX(zPlatform* ent, F32 dt)
1095{

Callers 3

zPlatform_UpdateFunction · 0.70
zPlatform_MountFunction · 0.70
zPlatformEventCBFunction · 0.70

Calls 7

xFFXShakeAllocFunction · 0.85
xFFXAllocFunction · 0.85
xFFXShakeFreeFunction · 0.85
xVec3SMulFunction · 0.85
xFFXAddEffectFunction · 0.85
xEntGetCenterFunction · 0.85
xParEmitterEmitCustomFunction · 0.50

Tested by

no test coverage detected