diff options
author | Tomer Shalev <shalev.tomer@gmail.com> | 2010-02-26 15:02:50 +0000 |
---|---|---|
committer | Tomer Shalev <shalev.tomer@gmail.com> | 2010-02-26 15:02:50 +0000 |
commit | ebbfe872ac66e6a65c885a30ff94fcfe17f439c6 (patch) | |
tree | 7dabb2a3e931fac7444276737ea5b3eead98e64c /apps | |
parent | 410cb26cc8085d28eee0788acdba165f37060327 (diff) |
Brickmania: Fix NUMBER_OF_POWERUPS and POWER_TYPE_COUNT were used for the same purpose
Thanks for Asael Reiter for spotting this
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24928 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/brickmania.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index b2a3a05afd..728651a45f 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -312,8 +312,8 @@ 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 NUMBER_OF_POWERUPS 9 -#define POWERUP_HEIGHT FIXED3(BMPHEIGHT_brickmania_powerups/NUMBER_OF_POWERUPS) +#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,7 +874,7 @@ enum power_types POWER_TYPE_EXTRA_BALL, POWER_TYPE_PADDLE_LONG, POWER_TYPE_PADDLE_SHORT, - POWER_TYPE_COUNT, + /* Make sure to update POWER_TYPE_COUNT value when adding new types */ }; /* Increasing this value makes the game with less powerups */ @@ -1422,7 +1422,7 @@ void brick_hit(int i, int j) { int ran = rb->rand()%POWER_RAND; - if (ran<NUMBER_OF_POWERUPS) + if (ran<POWER_TYPE_COUNT) { power[used_powers].top = TOPMARGIN + i*BRICK_HEIGHT; power[used_powers].x_pos = LEFTMARGIN + j*BRICK_WIDTH + |