summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2006-05-25 13:42:56 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2006-05-25 13:42:56 +0000
commite25f577e399bc368ee21dc1dfbdcff1fce95eb1f (patch)
tree9abf733bebbdea35e11202b651a82786a6d7a1fc /apps
parente1beea86d2127d05e96f07fb64e4b70d551d4f67 (diff)
downloadrockbox-e25f577e399bc368ee21dc1dfbdcff1fce95eb1f.tar.gz
rockbox-e25f577e399bc368ee21dc1dfbdcff1fce95eb1f.tar.bz2
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')
-rw-r--r--apps/plugins/minesweeper.c10
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){
/* A function that will uncover all the board, when the user wins or loses.
can easily be expanded, (just a call assigned to a button) as a solver. */
void mine_show(void){
- int i, j, button;
+ int i, j;
for(i=c_height();i<c_height() + height;i++){
for(j=c_width();j<c_width() + width;j++){
@@ -423,9 +423,11 @@ void mine_show(void){
rb->lcd_update();
bool k = true;
+ int button = BUTTON_NONE;
while(k){
button = rb->button_get_w_tmo(HZ/10);
- if(button != BUTTON_NONE && !(button & BUTTON_REL)) k = false;
+ if(button != BUTTON_NONE && !(button & BUTTON_REL) &&
+ !(button & BUTTON_REPEAT)) k = false;
}
}
@@ -690,13 +692,13 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
while(!exit) {
switch(minesweeper()){
case MINESWEEPER_WIN:
- rb->splash(HZ*2, true, "You Won! Press a key");
+ rb->splash(HZ*2, true, "You Win! Press a key");
rb->lcd_clear_display();
mine_show();
break;
case MINESWEEPER_LOSE:
- rb->splash(HZ*2, true, "You Lost! Press a key");
+ rb->splash(HZ*2, true, "You Lose! Press a key");
rb->lcd_clear_display();
mine_show();
break;