From b21b0c872e2b9d3169eb0a4c3d57095cdf5b1b28 Mon Sep 17 00:00:00 2001 From: Tomer Shalev Date: Sat, 27 Feb 2010 09:35:47 +0000 Subject: Brickmania: Use NUMBER_OF_POWERUPS in enum Thanks for kugel and linuxstb for this git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24935 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/brickmania.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index c95a88a..f39d9b0 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -312,8 +312,6 @@ CONFIG_KEYPAD == SANSA_M200_PAD #define BRICK_HEIGHT FIXED3(BMPHEIGHT_brickmania_bricks/7) #define BRICK_WIDTH FIXED3(BMPWIDTH_brickmania_bricks) #define LEFTMARGIN ((GAMESCREEN_WIDTH-10*BRICK_WIDTH)/2) -#define POWER_TYPE_COUNT 9 /* Number of items in enum power_types */ -#define POWERUP_HEIGHT FIXED3(BMPHEIGHT_brickmania_powerups/POWER_TYPE_COUNT) #define POWERUP_WIDTH FIXED3(BMPWIDTH_brickmania_powerups) #define BALL FIXED3(BMPHEIGHT_brickmania_ball) #define HALFBALL (BALL / 2) @@ -874,11 +872,12 @@ enum power_types POWER_TYPE_EXTRA_BALL, POWER_TYPE_PADDLE_LONG, POWER_TYPE_PADDLE_SHORT, - /* Make sure to update POWER_TYPE_COUNT value when adding new types */ + NUMBER_OF_POWERUPS, }; +#define POWERUP_HEIGHT FIXED3(BMPHEIGHT_brickmania_powerups/NUMBER_OF_POWERUPS) /* Increasing this value makes the game with less powerups */ -#define POWER_RAND (POWER_TYPE_COUNT + 15) +#define POWER_RAND (NUMBER_OF_POWERUPS + 15) enum difficulty_options { @@ -1426,7 +1425,7 @@ static void brick_hit(int i, int j) { int ran = rb->rand()%POWER_RAND; - if (ran