From 072d3cb268efc79a1945109bc3d9eefaf437e6c0 Mon Sep 17 00:00:00 2001 From: Sebastian Leonhardt Date: Mon, 13 Jul 2015 00:30:14 +0200 Subject: Fix Pong button handling * allow button combos for QUIT (fixes MPIO_HD300) * allow quitting during PAUSE mode Change-Id: Iaf8ffc65cdcfe6c1d25bfbad3e38764eea2664cc --- apps/plugins/pong.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'apps') diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index 4ec62e01be..e72584f12f 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c @@ -631,9 +631,9 @@ static int keys(struct pong *p) return 2; /* Pause game */ #endif - if(key & PONG_QUIT + if(key == PONG_QUIT #ifdef PONG_RC_QUIT - || key & PONG_RC_QUIT + || key == PONG_RC_QUIT #endif ) return 0; /* exit game NOW */ @@ -719,13 +719,6 @@ enum plugin_status plugin_start(const void* parameter) /* go go go */ while(game > 0) { - if (game == 2) { /* Game Paused */ - rb->splash(0, "PAUSED"); - while(game == 2) - game = keys(&pong); /* short circuit */ - rb->lcd_clear_display(); - } - if( pong.player[0].iscpu && pong.player[1].iscpu ) { if(blink_timerlcd_update(); game = keys(&pong); /* deal with keys */ + + if (game == 2) { /* Game Paused */ + rb->splash(0, "PAUSED"); + while(game == 2) + game = keys(&pong); /* short circuit */ + rb->lcd_clear_display(); + } } /* Turn on backlight timeout (revert to settings) */ -- cgit v1.2.3