summaryrefslogtreecommitdiff
path: root/apps/plugins/jpeg.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2004-05-21 19:54:22 +0000
committerJens Arnold <amiconn@rockbox.org>2004-05-21 19:54:22 +0000
commit3e00f527fe12aac610daae0856d74ea7d8a4efb6 (patch)
tree3dbcded536fd54d73bbf67a71d4c32b1e711452e /apps/plugins/jpeg.c
parent7cdab5c91c5095bad030136c6b6c837bce50395d (diff)
downloadrockbox-3e00f527fe12aac610daae0856d74ea7d8a4efb6.zip
rockbox-3e00f527fe12aac610daae0856d74ea7d8a4efb6.tar.gz
rockbox-3e00f527fe12aac610daae0856d74ea7d8a4efb6.tar.bz2
rockbox-3e00f527fe12aac610daae0856d74ea7d8a4efb6.tar.xz
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/plugins/jpeg.c')
-rw-r--r--apps/plugins/jpeg.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index be9e4db..99cdf5b 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 */