aboutsummaryrefslogtreecommitdiff
path: root/sources/TZR_PollEvent.c
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2024-04-11 03:55:22 +0200
committerkdx <kikoodx@paranoici.org>2024-04-11 03:58:05 +0200
commit10526f2f4ecc8168f060bd8c4cf6cc3b111bd306 (patch)
treeefd1a0f09d829abd99505604efd8361118c8342e /sources/TZR_PollEvent.c
parent690e41f34e1ee5b3afad0d6dd64c07a5eda7fc58 (diff)
downloadtzr-main.tar.gz
LatestInputEventHEADmain
Diffstat (limited to 'sources/TZR_PollEvent.c')
-rw-r--r--sources/TZR_PollEvent.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sources/TZR_PollEvent.c b/sources/TZR_PollEvent.c
index 9560600..15e287b 100644
--- a/sources/TZR_PollEvent.c
+++ b/sources/TZR_PollEvent.c
@@ -2,7 +2,6 @@
#include "TZR_globals.h"
#include "sdl_error.h"
#include "reserve.h"
-#include "getbind.h"
#include <SDL2/SDL_events.h>
#include <SDL2/SDL_gamecontroller.h>
@@ -32,10 +31,12 @@ TZR_PollEvent(TZR_Event *e)
___tzr_keystates[e->button] = TZR_KEYSTATE_RELEASE;
return 1;
case SDL_MOUSEBUTTONDOWN:
+ e->type = TZR_EV_MOUSEDOWN;
+ e->button = se.button.button;
___tzr_mouse_x = se.button.x;
___tzr_mouse_y = se.button.y;
- ___tzr_mousestates[se.button.button] = TZR_KEYSTATE_PRESS;
- break;
+ ___tzr_mousestates[e->button] = TZR_KEYSTATE_PRESS;
+ return 1;
case SDL_MOUSEBUTTONUP:
___tzr_mouse_x = se.button.x;
___tzr_mouse_y = se.button.y;