forked from len0rd/rockbox
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
This commit is contained in:
parent
410cb26cc8
commit
ebbfe872ac
1 changed files with 4 additions and 4 deletions
|
@ -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 +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue