diff options
author | Jens Arnold <amiconn@rockbox.org> | 2004-05-21 19:54:22 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2004-05-21 19:54:22 +0000 |
commit | 3e00f527fe12aac610daae0856d74ea7d8a4efb6 (patch) | |
tree | 3dbcded536fd54d73bbf67a71d4c32b1e711452e /apps | |
parent | 7cdab5c91c5095bad030136c6b6c837bce50395d (diff) | |
download | rockbox-3e00f527fe12aac610daae0856d74ea7d8a4efb6.tar.gz rockbox-3e00f527fe12aac610daae0856d74ea7d8a4efb6.zip |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/jpeg.c | 12 |
1 files 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; | |||
1470 | /* interactively scroll around the image */ | 1470 | /* interactively scroll around the image */ |
1471 | int scroll_bmp(struct t_disp* pdisp) | 1471 | int scroll_bmp(struct t_disp* pdisp) |
1472 | { | 1472 | { |
1473 | /*empty the button queue first, to avoid unwanted scrolling */ | ||
1474 | while(rb->button_get(false) != BUTTON_NONE); | ||
1475 | |||
1473 | while (true) | 1476 | while (true) |
1474 | { | 1477 | { |
1475 | int button; | 1478 | int button; |
1476 | int move; | 1479 | int move; |
1477 | 1480 | ||
1478 | /* we're unfortunately slower than key repeat, | ||
1479 | so empty the button queue, to avoid post-scroll */ | ||
1480 | while(rb->button_get(false) != BUTTON_NONE); | ||
1481 | |||
1482 | button = rb->button_get(true); | 1481 | button = rb->button_get(true); |
1483 | 1482 | ||
1484 | if (button == SYS_USB_CONNECTED) | 1483 | if (button == SYS_USB_CONNECTED) |
1485 | { | ||
1486 | gray_release_buffer(); /* switch off overlay and deinitialize */ | ||
1487 | return PLUGIN_USB_CONNECTED; | 1484 | return PLUGIN_USB_CONNECTED; |
1488 | } | ||
1489 | 1485 | ||
1490 | switch(button & ~(BUTTON_REPEAT)) | 1486 | switch(button & ~(BUTTON_REPEAT)) |
1491 | { | 1487 | { |
@@ -1885,7 +1881,7 @@ int main(char* filename) | |||
1885 | gray_show_display(false); /* switch off overlay */ | 1881 | gray_show_display(false); /* switch off overlay */ |
1886 | 1882 | ||
1887 | } | 1883 | } |
1888 | while (status > 0 && status != SYS_USB_CONNECTED); | 1884 | while (status != PLUGIN_OK && status != PLUGIN_USB_CONNECTED); |
1889 | 1885 | ||
1890 | gray_release_buffer(); /* deinitialize */ | 1886 | gray_release_buffer(); /* deinitialize */ |
1891 | 1887 | ||