diff options
author | Marcoen Hirschberg <marcoen@gmail.com> | 2006-05-25 13:42:56 +0000 |
---|---|---|
committer | Marcoen Hirschberg <marcoen@gmail.com> | 2006-05-25 13:42:56 +0000 |
commit | e25f577e399bc368ee21dc1dfbdcff1fce95eb1f (patch) | |
tree | 9abf733bebbdea35e11202b651a82786a6d7a1fc /apps/plugins | |
parent | e1beea86d2127d05e96f07fb64e4b70d551d4f67 (diff) | |
download | rockbox-e25f577e399bc368ee21dc1dfbdcff1fce95eb1f.tar.gz rockbox-e25f577e399bc368ee21dc1dfbdcff1fce95eb1f.zip |
fix minesweeper for ondio (patch by Alexander Spyridakis)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9986 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/minesweeper.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index 663d5c45ec..0eea0a4bde 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c | |||
@@ -395,7 +395,7 @@ void minesweeper_putmines(int p, int x, int y){ | |||
395 | /* A function that will uncover all the board, when the user wins or loses. | 395 | /* A function that will uncover all the board, when the user wins or loses. |
396 | can easily be expanded, (just a call assigned to a button) as a solver. */ | 396 | can easily be expanded, (just a call assigned to a button) as a solver. */ |
397 | void mine_show(void){ | 397 | void mine_show(void){ |
398 | int i, j, button; | 398 | int i, j; |
399 | 399 | ||
400 | for(i=c_height();i<c_height() + height;i++){ | 400 | for(i=c_height();i<c_height() + height;i++){ |
401 | for(j=c_width();j<c_width() + width;j++){ | 401 | for(j=c_width();j<c_width() + width;j++){ |
@@ -423,9 +423,11 @@ void mine_show(void){ | |||
423 | rb->lcd_update(); | 423 | rb->lcd_update(); |
424 | 424 | ||
425 | bool k = true; | 425 | bool k = true; |
426 | int button = BUTTON_NONE; | ||
426 | while(k){ | 427 | while(k){ |
427 | button = rb->button_get_w_tmo(HZ/10); | 428 | button = rb->button_get_w_tmo(HZ/10); |
428 | if(button != BUTTON_NONE && !(button & BUTTON_REL)) k = false; | 429 | if(button != BUTTON_NONE && !(button & BUTTON_REL) && |
430 | !(button & BUTTON_REPEAT)) k = false; | ||
429 | } | 431 | } |
430 | } | 432 | } |
431 | 433 | ||
@@ -690,13 +692,13 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
690 | while(!exit) { | 692 | while(!exit) { |
691 | switch(minesweeper()){ | 693 | switch(minesweeper()){ |
692 | case MINESWEEPER_WIN: | 694 | case MINESWEEPER_WIN: |
693 | rb->splash(HZ*2, true, "You Won! Press a key"); | 695 | rb->splash(HZ*2, true, "You Win! Press a key"); |
694 | rb->lcd_clear_display(); | 696 | rb->lcd_clear_display(); |
695 | mine_show(); | 697 | mine_show(); |
696 | break; | 698 | break; |
697 | 699 | ||
698 | case MINESWEEPER_LOSE: | 700 | case MINESWEEPER_LOSE: |
699 | rb->splash(HZ*2, true, "You Lost! Press a key"); | 701 | rb->splash(HZ*2, true, "You Lose! Press a key"); |
700 | rb->lcd_clear_display(); | 702 | rb->lcd_clear_display(); |
701 | mine_show(); | 703 | mine_show(); |
702 | break; | 704 | break; |