From 6340a4c9ed80e1a04e688be7578161583d886892 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 13 Dec 2008 07:36:44 +0000 Subject: [PATCH] Some plugins need to yield under heavy user input especially with a scrollwheel. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19416 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/brickmania.c | 4 ++++ apps/plugins/credits.c | 2 ++ apps/plugins/jewels.c | 4 ++++ apps/plugins/matrix.c | 2 +- apps/plugins/solitaire.c | 4 ++++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 5a198d47eb..f9e071aaae 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -1096,6 +1096,8 @@ int game_menu(int when) return 3; break; } + + rb->yield(); } } @@ -1244,6 +1246,8 @@ int help(int when) return 1; break; } + + rb->yield(); } return 0; } diff --git a/apps/plugins/credits.c b/apps/plugins/credits.c index e3e659bf48..245570e8a2 100644 --- a/apps/plugins/credits.c +++ b/apps/plugins/credits.c @@ -338,6 +338,8 @@ static void roll_credits(void) rb->lcd_putsxy(0, font_h*(i+1), name); } rb->lcd_update(); + + rb->yield(); /* wait for user action */ action = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index 1c3fc84d96..8c53ddcaab 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c @@ -1468,6 +1468,8 @@ static int jewels_main(struct game_context* bj) { rb->lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT-8, str); rb->lcd_update(); + rb->yield(); + switch(res) { case MRES_NEW: startgame = true; @@ -1510,6 +1512,7 @@ static int jewels_main(struct game_context* bj) { while(true) { button = rb->button_get(true); if(button != BUTTON_NONE && !(button&BUTTON_REL)) break; + rb->yield(); } rb->lcd_clear_display(); continue; @@ -1785,6 +1788,7 @@ static int jewels_main(struct game_context* bj) { } /* handle game button presses */ + rb->yield(); button = rb->button_get(true); switch(button){ case JEWELS_LEFT: /* move cursor left */ diff --git a/apps/plugins/matrix.c b/apps/plugins/matrix.c index 99b731d937..c7d797e09d 100644 --- a/apps/plugins/matrix.c +++ b/apps/plugins/matrix.c @@ -315,7 +315,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame rb->lcd_update(); rb->sleep(sleep); } - button = rb->button_get(false); + button = rb->button_get(frozen); switch(button) { case MATRIX_PAUSE: frozen = !frozen; diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index e29e0b55cc..1526cecd47 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c @@ -709,6 +709,8 @@ enum help solitaire_help( void ) } if( button != BUTTON_NONE ) lastbutton = button; + + rb->yield(); } } @@ -1871,6 +1873,8 @@ int solitaire( int skipmenu ) if( cur_card == NOT_A_CARD && find_last_card( cur_col ) != NOT_A_CARD ) cur_card = find_last_card( cur_col ); + + rb->yield(); } }