Files
af/src/code/m_pause.c
T
Prakxo 8aa8fb893a m_pause OK (#47)
* m_pause OK

* yeah now it's OK lol

* refactor

* refactor 2
2023-08-12 09:55:42 -07:00

23 lines
673 B
C

#include "m_pause.h"
#include "m_controller.h"
#include "libc/stdbool.h"
void Pause_ct(Pause* pause) {
pause->timer = 0;
pause->enabled = 0;
}
s32 Pause_proc(Pause* pause, Input* input) {
if (CHECK_BTN_ALL(input->cur.button, R_TRIG) && CHECK_BTN_ALL(input->press.button, D_JPAD)) {
pause->enabled = !pause->enabled;
}
if ((!pause->enabled) || (CHECK_BTN_ALL(input->cur.button, Z_TRIG) &&
(CHECK_BTN_ALL(input->press.button, R_TRIG) ||
(CHECK_BTN_ALL(input->cur.button, R_TRIG) && (++pause->timer >= 9))))) {
pause->timer = 0;
return true;
}
return false;
}