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

Function zPlatFM_EventSetup

src/SB/Game/zPlatform.cpp:1138–1184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1136}
1137
1138static void zPlatFM_EventSetup(zPlatform* plat, const F32* toParam, S32 idx)
1139{
1140 F32 ds, atm, ttm, dtm;
1141
1142 zPlatFMRunTime* fmrt = plat->fmrt;
1143 if (fmrt->flags & (1 << idx))
1144 {
1145 return;
1146 }
1147
1148 ds = toParam[0];
1149 atm = toParam[1];
1150 ttm = toParam[2];
1151 dtm = toParam[3];
1152
1153 if (atm <= 0.0f)
1154 {
1155 return;
1156 }
1157
1158 if (ttm > atm)
1159 {
1160 ttm = atm;
1161 }
1162 else if (ttm < 0.0f)
1163 {
1164 ttm = 0.0f;
1165 }
1166
1167 ttm = atm - ttm;
1168 if (dtm > ttm)
1169 {
1170 dtm = ttm;
1171 }
1172 else if (dtm < 0.0f)
1173 {
1174 dtm = 0.0f;
1175 }
1176
1177 fmrt->tmrs[idx] = atm;
1178 fmrt->ttms[idx] = atm;
1179 fmrt->atms[idx] = ttm;
1180 fmrt->dtms[idx] = dtm;
1181 fmrt->vms[idx] = 2.0f * ds / (atm - dtm + ttm);
1182 fmrt->dss[idx] = ds;
1183 fmrt->flags |= (1 << idx);
1184}
1185
1186S32 zPlatformEventCB(xBase* from, xBase* to, U32 toEvent, const F32* toParam, xBase* toParamWidget)
1187{

Callers 1

zPlatformEventCBFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected