From be5c7263406aef867501c7965bcced6a7e2898a6 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 29 Sep 2024 16:39:31 +1000 Subject: animation, player movement, physics etc. --- plat.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'plat.c') diff --git a/plat.c b/plat.c index 7c5c9f8..cc351ff 100644 --- a/plat.c +++ b/plat.c @@ -3,6 +3,18 @@ #include "memory.h" #include "plat.h" +int btn_pressed(const App* a, Btn btn) { + return a->btn_states[btn] & btn_state_pressed; +} + +int btn_just_pressed(const App* a, Btn btn) { + return a->btn_states[btn] & btn_state_just_pressed; +} + +int btn_just_released(const App* a, Btn btn) { + return a->btn_states[btn] & btn_state_just_released; +} + #ifdef plat_posix #define _POSIX_SOURCE #define _GNU_SOURCE -- cgit v1.2.3-54-g00ecf