From 3e00f527fe12aac610daae0856d74ea7d8a4efb6 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Fri, 21 May 2004 19:54:22 +0000 Subject: Fixed behaviour when connecting USB, made scrolling a bit faster by not emptying the button queue every time git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4675 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/jpeg.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c index be9e4db5e2..99cdf5ba61 100644 --- a/apps/plugins/jpeg.c +++ b/apps/plugins/jpeg.c @@ -1470,22 +1470,18 @@ int root_size; /* interactively scroll around the image */ int scroll_bmp(struct t_disp* pdisp) { + /*empty the button queue first, to avoid unwanted scrolling */ + while(rb->button_get(false) != BUTTON_NONE); + while (true) { int button; int move; - /* we're unfortunately slower than key repeat, - so empty the button queue, to avoid post-scroll */ - while(rb->button_get(false) != BUTTON_NONE); - button = rb->button_get(true); if (button == SYS_USB_CONNECTED) - { - gray_release_buffer(); /* switch off overlay and deinitialize */ return PLUGIN_USB_CONNECTED; - } switch(button & ~(BUTTON_REPEAT)) { @@ -1885,7 +1881,7 @@ int main(char* filename) gray_show_display(false); /* switch off overlay */ } - while (status > 0 && status != SYS_USB_CONNECTED); + while (status != PLUGIN_OK && status != PLUGIN_USB_CONNECTED); gray_release_buffer(); /* deinitialize */ -- cgit v1.2.3