diff options
author | Zakk Roberts <midkay@rockbox.org> | 2007-02-17 10:23:15 +0000 |
---|---|---|
committer | Zakk Roberts <midkay@rockbox.org> | 2007-02-17 10:23:15 +0000 |
commit | 5bebae83a6e929687eafc7e39f125d8962b13ed6 (patch) | |
tree | b9be7d85c88f4fe846f38742903db765905810c9 /apps/plugins/chopper.c | |
parent | 6dbe772eb7af89e79d8da5122b3406b7da2b2c79 (diff) |
Chopper update. Fix endgame text not showing up and menu being invisible after first game, both on grayscale targets. Also fix endgame text being too long on Archos by using a splash to draw it. Also: X5's up button now works as 'fly' and Ondio mappings changed (Up/Menu = fly, Off = quit).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12345 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/chopper.c')
-rw-r--r-- | apps/plugins/chopper.c | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index 7a7316e00d..08124681fb 100644 --- a/apps/plugins/chopper.c +++ b/apps/plugins/chopper.c @@ -49,7 +49,8 @@ PLUGIN_HEADER #elif CONFIG_KEYPAD == IAUDIO_X5_PAD /* grayscale at the moment */ #define QUIT BUTTON_POWER -#define ACTION BUTTON_SELECT +#define ACTION BUTTON_UP +#define ACTION2 BUTTON_SELECT #define ACTIONTEXT "SELECT" #elif CONFIG_KEYPAD == IRIVER_H10_PAD @@ -73,8 +74,9 @@ PLUGIN_HEADER #define ACTIONTEXT "PLAY" #elif CONFIG_KEYPAD == ONDIO_PAD -#define QUIT BUTTON_MENU -#define ACTION BUTTON_RIGHT +#define QUIT BUTTON_OFF +#define ACTION BUTTON_UP +#define ACTION BUTTON_MENU #define ACTIONTEXT "RIGHT" #else @@ -387,7 +389,6 @@ static void chopAddParticle(int x,int y,int sx,int sy) mParticles[i].iWorldY = y; mParticles[i].iSpeedX = sx; mParticles[i].iSpeedY = sy; - } static void chopGenerateBlockIfNeeded(void) @@ -458,19 +459,6 @@ static int chopParticleOffscreen(struct CParticle *mParticle) return 0; } -static void checkHighScore(void) -{ - if (score > highscore) { - char scoretext[30]; - int w; - highscore = score; - rb->snprintf(scoretext, sizeof(scoretext), "New High Score: %d", - highscore); - rb->lcd_getstringsize(scoretext, &w, NULL); - rb->lcd_putsxy(LCD_WIDTH/2 - w/2 ,LCD_HEIGHT/2 + 20, scoretext); - } -} - static void chopKillPlayer(void) { int w, i, button; @@ -486,21 +474,24 @@ static void chopKillPlayer(void) if (iPlayerAlive == 0) { rb->lcd_set_drawmode(DRMODE_FG); #if LCD_DEPTH >= 2 - rb->lcd_set_foreground(LCD_WHITE); + rb->lcd_set_foreground(LCD_LIGHTGRAY); #endif - checkHighScore(); + rb->splash(HZ, true, "Game Over"); + + if (score > highscore) { + char scoretext[30]; + int w; + highscore = score; + rb->snprintf(scoretext, sizeof(scoretext), "New High Score: %d", + highscore); + rb->splash(HZ*2, true, scoretext); + } - rb->lcd_getstringsize("Game Over", &w, NULL); - rb->lcd_putsxy(LCD_WIDTH/2 - w/2 ,LCD_HEIGHT/2 - 20, "Game Over"); - rb->lcd_getstringsize("Press " ACTIONTEXT " to continue", &w, NULL); - rb->lcd_putsxy(LCD_WIDTH/2 - w/2 ,LCD_HEIGHT/2, - "Press " ACTIONTEXT " to continue"); + rb->splash(HZ/4, true, "Press " ACTIONTEXT " to continue"); rb->lcd_update(); rb->lcd_set_drawmode(DRMODE_SOLID); - rb->sleep(HZ * 0.5); - while (true) { button = rb->button_get(true); if (button == ACTION @@ -631,6 +622,9 @@ static int chopMenu(int menunum) #if HAVE_LCD_COLOR rb->lcd_set_foreground(LCD_WHITE); rb->lcd_set_background(LCD_BLACK); +#elif LCD_DEPTH == 2 + rb->lcd_set_foreground(LCD_BLACK); + rb->lcd_set_background(LCD_WHITE); #endif rb->lcd_clear_display(); |