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

Function zEntButton_Hold

src/SB/Game/zEntButton.cpp:336–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336void zEntButton_Hold(_zEntButton* ent, U32 mask)
337{
338 if (!(ent->basset->buttonActFlags & mask))
339 {
340 return;
341 }
342
343 if (mask & (1 << 10))
344 {
345 switch (ent->bound.type)
346 {
347 case XBOUND_TYPE_CYL:
348 break;
349 case XBOUND_TYPE_OBB:
350 xVec3 vec;
351 xMat4x3Tolocal(&vec, ent->bound.mat, (xVec3*)&globals.player.ent.model->Mat->pos);
352 vec.y = 0.0f;
353 if (!xPointInBox(&ent->bound.box.box, &vec))
354 {
355 return;
356 }
357 break;
358 }
359 }
360
361 if (ent->state == 0)
362 {
363 zEntEvent((xBase*)ent, eEventPress);
364 _PressButtonSound(0);
365 }
366 else
367 {
368 ent->hold = 1;
369 }
370}
371
372// Equivalent(?): sda loads, regalloc
373void zEntButton_SceneUpdate(F32 dt)

Callers 3

ProcessMethod · 0.70
CollideReviewMethod · 0.70
xEntBoulder_UpdateFunction · 0.50

Calls 4

xMat4x3TolocalFunction · 0.85
xPointInBoxFunction · 0.85
_PressButtonSoundFunction · 0.85
zEntEventFunction · 0.50

Tested by

no test coverage detected