From 5a29fe18d4ca1c96a4d962a6494a7ff4c481b5ad Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Wed, 14 Feb 2007 22:59:36 +0000 Subject: Brickmania update for the Gigabeat: fixed menu and smaller game area to make the gameplay closer to targets with landscape oriented displays (and more challenging too). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12310 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/bitmaps/native/SOURCES | 4 ++++ .../native/brickmania_menu_bg.240x320x16.bmp | Bin 0 -> 230454 bytes apps/plugins/brickmania.c | 23 ++++++++++++++++----- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 apps/plugins/bitmaps/native/brickmania_menu_bg.240x320x16.bmp diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index 9781e49b12..232b2b90f0 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES @@ -9,7 +9,11 @@ brickmania_pads.320x240x16.bmp brickmania_break.320x240x16.bmp brickmania_powerups.320x240x16.bmp #else +#if (LCD_WIDTH == 240) && (LCD_HEIGHT == 320) +brickmania_menu_bg.240x320x16.bmp +#else brickmania_menu_bg.220x176x16.bmp +#endif brickmania_bricks.220x176x16.bmp brickmania_pads.220x176x16.bmp brickmania_break.220x176x16.bmp diff --git a/apps/plugins/bitmaps/native/brickmania_menu_bg.240x320x16.bmp b/apps/plugins/bitmaps/native/brickmania_menu_bg.240x320x16.bmp new file mode 100644 index 0000000000..93856e02a7 Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_menu_bg.240x320x16.bmp differ diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 66ae99a7fe..110bac09a4 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -183,6 +183,8 @@ extern const fb_data brickmania_bricks[]; */ #define CYCLETIME 30 +#define GAMESCREEN_HEIGHT LCD_HEIGHT + #define PAD_WIDTH 56 #define PAD_HEIGHT 7 #define PAD_POS_Y LCD_HEIGHT - 7 @@ -227,19 +229,22 @@ extern const fb_data brickmania_bricks[]; #define CYCLETIME 30 /* Offsets for LCDS > 220x176 */ -#define XOFS ((LCD_WIDTH-220)/2) -#define YOFS ((LCD_HEIGHT-176)/2) + +#define GAMESCREEN_HEIGHT 176 #define PAD_WIDTH 40 #define PAD_HEIGHT 5 -#define PAD_POS_Y LCD_HEIGHT - 7 +#define PAD_POS_Y GAMESCREEN_HEIGHT - 7 #define BRICK_HEIGHT 8 #define BRICK_WIDTH 21 #define BALL 5 #define HALFBALL 3 -#define LEFTMARGIN 5 +#define LEFTMARGIN (LCD_WIDTH-220)/2 + 5 #define TOPMARGIN 30 +#define XOFS ((LCD_WIDTH-220)/BRICK_WIDTH/2)*BRICK_WIDTH +#define YOFS ((LCD_HEIGHT-176)/BRICK_HEIGHT/2)*BRICK_HEIGHT + #define MENU_BMPHEIGHT 20 #define MENU_BMPWIDTH 112 @@ -272,6 +277,8 @@ extern const fb_data brickmania_bricks[]; */ #define CYCLETIME 50 +#define GAMESCREEN_HEIGHT LCD_HEIGHT + #define PAD_WIDTH 30 #define PAD_HEIGHT 5 #define PAD_POS_Y LCD_HEIGHT - 7 @@ -330,6 +337,8 @@ extern const fb_data brickmania_bricks[]; */ #define CYCLETIME 50 +#define GAMESCREEN_HEIGHT LCD_HEIGHT + #define PAD_WIDTH 30 #define PAD_HEIGHT 5 #define PAD_POS_Y LCD_HEIGHT - 5 @@ -373,6 +382,8 @@ extern const fb_data brickmania_bricks[]; */ #define CYCLETIME 75 +#define GAMESCREEN_HEIGHT LCD_HEIGHT + #define PAD_WIDTH 30 #define PAD_HEIGHT 3 #define PAD_POS_Y LCD_HEIGHT - 5 @@ -412,6 +423,8 @@ extern const fb_data brickmania_bricks[]; */ #define CYCLETIME 30 +#define GAMESCREEN_HEIGHT LCD_HEIGHT + #define PAD_WIDTH 40 #define PAD_HEIGHT 5 #define PAD_POS_Y LCD_HEIGHT - 7 @@ -1634,7 +1647,7 @@ int game_loop(void) if (ball[k].pos_y<= 0) ball[k].y = ball[k].y*-1; /* bottom line */ - else if (ball[k].pos_y+BALL >= LCD_HEIGHT) { + else if (ball[k].pos_y+BALL >= GAMESCREEN_HEIGHT) { if (used_balls>1) { used_balls--; ball[k].pos_x = ball[used_balls].pos_x; -- cgit