commit a12781f23a930a8b60ff07dc8dd9abe77dad626b
parent a8944f36ec3774e4a349ef504d43b86ba653178a
Author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
Date: Mon, 27 Dec 2021 15:24:22 +0100
get_button: do not pass the whole event struct on the stack
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/uxnemu.c b/src/uxnemu.c
@@ -394,9 +394,9 @@ restart(Uxn *u)
}
Uint8
-get_button(SDL_Event event)
+get_button(SDL_Event *event)
{
- switch(event.key.keysym.sym) {
+ switch(event->key.keysym.sym) {
case SDLK_LCTRL: return 0x01;
case SDLK_LALT: return 0x02;
case SDLK_LSHIFT: return 0x04;
@@ -483,9 +483,9 @@ run(Uxn *u)
clamp(event.motion.x - PAD, 0, ppu.width - 1),
clamp(event.motion.y - PAD, 0, ppu.height - 1));
else if(event.type == SDL_KEYDOWN)
- controller_down(devctrl, get_button(event));
+ controller_down(devctrl, get_button(&event));
else if(event.type == SDL_KEYUP)
- controller_up(devctrl, get_button(event));
+ controller_up(devctrl, get_button(&event));
/* continue */
switch(event.type) {
case SDL_DROPFILE: