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

Function zPlatform_Reset

src/SB/Game/zPlatform.cpp:175–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175void zPlatform_Reset(zPlatform* plat, xScene* sc)
176{
177 if (plat->subType == ePlatformTypeBreakaway) {
178 plat->model = plat->am;
179 plat->collModel = NULL;
180 }
181
182 zEntReset(plat);
183
184 xEntMotionInit(&plat->motion, plat, (xEntMotionAsset*)(plat->passet + 1));
185 xEntMotionReset(&plat->motion, sc);
186
187 plat->plat_flags = 0x1;
188
189 if (plat->subType == ePlatformTypeER) {
190 plat->state = 3;
191 } else if (plat->subType == ePlatformTypeBreakaway) {
192 plat->tmr = plat->passet->ba.ba_delay;
193 plat->state = 0;
194 plat->pflags &= (U8)~(XENT_PFLAGS_HAS_VELOCITY | XENT_PFLAGS_HAS_GRAVITY);
195 plat->collis->chk = 0;
196
197 xVec3Copy(&plat->frame->vel, &g_O3);
198
199 plat->bound.mat = (xMat4x3*)plat->model->Mat;
200 } else if (plat->subType == ePlatformTypeMech) {
201 plat->state = plat->motion.mech.state;
202 } else if (plat->subType == ePlatformTypeSpringboard) {
203 plat->tmr = -1.0f;
204 plat->ctr = 0;
205 } else if (plat->subType == ePlatformTypePaddle) {
206 plat->tmr = 1e-9f;
207 plat->state = 2;
208 plat->ctr = plat->passet->paddle.startOrient;
209 } else if (plat->subType == ePlatformTypeFM) {
210 for (S32 i = 0; i < 12; i++) {
211 plat->fmrt->flags = 0;
212 plat->fmrt->tmrs[i] = 0.0f;
213 plat->fmrt->ttms[i] = 0.0f;
214 plat->fmrt->atms[i] = 0.0f;
215 plat->fmrt->dtms[i] = 0.0f;
216 plat->fmrt->vms[i] = 0.0f;
217 plat->fmrt->dss[i] = 0.0f;
218 }
219 }
220
221 if (plat->motion.type == k_XENTMOTIONTYPE_MP) {
222 plat->src = plat->motion.mp.src;
223 }
224
225 plat->chkby &= (U8)~(XENT_COLLTYPE_PLYR | XENT_COLLTYPE_NPC | XENT_COLLTYPE_DYN);
226
227 if (plat->passet->flags & 0x4) {
228 plat->chkby |= (XENT_COLLTYPE_PLYR | XENT_COLLTYPE_NPC);
229 }
230
231 plat->bupdate(plat, (xVec3*)&plat->model->Mat->pos);
232 plat->moving = 0;

Callers 4

zSceneResetFunction · 0.70
zSceneSetupFunction · 0.70
zPlatform_UpdateFunction · 0.70
zPlatformEventCBFunction · 0.70

Calls 5

xVec3CopyFunction · 0.85
zEntResetFunction · 0.70
xEntMotionInitFunction · 0.50
xEntMotionResetFunction · 0.50
xStrHashFunction · 0.50

Tested by

no test coverage detected