summaryrefslogtreecommitdiff
path: root/meme/gui.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2014-09-13 14:00:29 (GMT)
committerWerner Almesberger <werner@almesberger.net>2014-09-13 14:00:29 (GMT)
commitc89544e48b120d2808b55ec2840bbe5f9b41f67f (patch)
treeb00d229f1969c854e8f572d00f4d28d7c1e54d5a /meme/gui.c
parent98275d5c8507482a6c49b05afd0b3076df6fbf91 (diff)
downloadmisc-c89544e48b120d2808b55ec2840bbe5f9b41f67f.zip
misc-c89544e48b120d2808b55ec2840bbe5f9b41f67f.tar.gz
misc-c89544e48b120d2808b55ec2840bbe5f9b41f67f.tar.bz2
meme/gui.c (event_loop): we don't need the "redraw" flag - just return 0
Diffstat (limited to 'meme/gui.c')
-rw-r--r--meme/gui.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/meme/gui.c b/meme/gui.c
index 1339e7c..bc36211 100644
--- a/meme/gui.c
+++ b/meme/gui.c
@@ -1,5 +1,4 @@
-/*
- * gui.c - User interface
+/* * gui.c - User interface
*
* Written 2014 by Werner Almesberger
* Copyright 2014 by Werner Almesberger
@@ -762,10 +761,9 @@ static void delayed_motion(void *user)
static bool event_loop(SDL_Surface *s)
{
SDL_Event event;
- bool redraw = 0;
cancel_timer(&motion_timer);
- while (!redraw) {
+ while (1) {
sdl_event(&event);
switch (event.type) {
@@ -781,17 +779,15 @@ static bool event_loop(SDL_Surface *s)
break;
case SDL_MOUSEBUTTONDOWN:
button_event(&event.button);
- redraw = 1;
- break;
+ return 0;
case SDL_KEYDOWN:
switch (event.key.keysym.sym) {
case SDLK_g:
show_grid = !show_grid;
- redraw = 1;
- break;
+ return 0;
case SDLK_p:
show_profiles = !show_profiles;
- redraw = 1;
+ return 0;
break;
case SDLK_q:
return 1;