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

Function zUI_PreUpdate

src/SB/Game/zUI.cpp:459–599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459void zUI_PreUpdate(_zUI* ent, xScene*, F32)
460{
461 _zUI* ui = ent;
462
463 ent->uiButton = 0;
464 // This matches perfectly with inlining enabled
465 for (S32 i = 0; i < (globals.firstStartPressed ? 1 : 1); i++)
466 {
467 _tagxPad* pad;
468
469 switch (i)
470 {
471 case 0:
472 {
473 pad = globals.pad0;
474 break;
475 }
476 case 1:
477 {
478 pad = globals.pad1;
479 break;
480 }
481 case 2:
482 {
483 pad = globals.pad2;
484 break;
485 }
486 default:
487 {
488 pad = globals.pad3;
489 break;
490 }
491 }
492
493 if (pad && pad->pressed && ui->uiFlags & 0x8 && (ui->uiFlags & 0x2 || ui->uiFlags & 0x1))
494 {
495 if (gTrcPad[0].state == TRC_PadInserted)
496 {
497 if (pad->pressed & XPAD_BUTTON_UP)
498 {
499 ui->uiButton |= XPAD_BUTTON_UP;
500 }
501 else if (pad->pressed & XPAD_BUTTON_DOWN)
502 {
503 ui->uiButton |= XPAD_BUTTON_DOWN;
504 }
505 else if (pad->pressed & XPAD_BUTTON_LEFT)
506 {
507 ui->uiButton |= XPAD_BUTTON_LEFT;
508 }
509 else if (pad->pressed & XPAD_BUTTON_RIGHT)
510 {
511 ui->uiButton |= XPAD_BUTTON_RIGHT;
512 }
513
514 if (pad->pressed & XPAD_BUTTON_START)
515 {
516 ui->uiButton |= XPAD_BUTTON_START;

Callers 2

zUIFont_PreUpdateFunction · 0.70
PreUpdateMethod · 0.70

Calls 4

xTRCResetFunction · 0.85
xStrHashFunction · 0.50
iPadEnableFunction · 0.50
xPadRumbleEnableFunction · 0.50

Tested by

no test coverage detected