summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorZakk Roberts <midkay@rockbox.org>2007-01-26 06:14:29 +0000
committerZakk Roberts <midkay@rockbox.org>2007-01-26 06:14:29 +0000
commit4bdef7a18713c96a13cd1c50f545fc6e18661f04 (patch)
tree7d72653213d00d86740acea1a5f718a3fe1c1626 /apps
parent4ca8a43631e4a9ce2defa5bacb857efc11aeeefc (diff)
downloadrockbox-4bdef7a18713c96a13cd1c50f545fc6e18661f04.tar.gz
rockbox-4bdef7a18713c96a13cd1c50f545fc6e18661f04.zip
Brickmania: new Brick bitmaps for all color targets, and introducing full-screen support for iPod 5G (320x240).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12114 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/bitmaps/native/brickmania_bricks.160x128x16.bmpbin2408 -> 2408 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_bricks.176x132x16.bmpbin2604 -> 2604 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_bricks.220x176x16.bmpbin3640 -> 3640 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_bricks.320x240x16.bmpbin0 -> 8120 bytes
-rw-r--r--apps/plugins/brickmania.c92
5 files changed, 66 insertions, 26 deletions
diff --git a/apps/plugins/bitmaps/native/brickmania_bricks.160x128x16.bmp b/apps/plugins/bitmaps/native/brickmania_bricks.160x128x16.bmp
index 292c7d7a86..ca4f782f60 100644
--- a/apps/plugins/bitmaps/native/brickmania_bricks.160x128x16.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_bricks.160x128x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_bricks.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_bricks.176x132x16.bmp
index 2d2b90c712..5b5a84c85b 100644
--- a/apps/plugins/bitmaps/native/brickmania_bricks.176x132x16.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_bricks.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_bricks.220x176x16.bmp b/apps/plugins/bitmaps/native/brickmania_bricks.220x176x16.bmp
index e89f293bf0..fadf11f2f0 100644
--- a/apps/plugins/bitmaps/native/brickmania_bricks.220x176x16.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_bricks.220x176x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_bricks.320x240x16.bmp b/apps/plugins/bitmaps/native/brickmania_bricks.320x240x16.bmp
new file mode 100644
index 0000000000..0a2035cf7b
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_bricks.320x240x16.bmp
Binary files differ
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 12ad2c0030..23abad584b 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -154,7 +154,7 @@ enum menu_items {
154 BM_QUIT, 154 BM_QUIT,
155 BM_SEL_QUIT, 155 BM_SEL_QUIT,
156}; 156};
157 157
158/* External bitmaps */ 158/* External bitmaps */
159#if (LCD_WIDTH != 112) && (LCD_HEIGHT != 64) 159#if (LCD_WIDTH != 112) && (LCD_HEIGHT != 64)
160extern const fb_data brickmania_menu_bg[]; 160extern const fb_data brickmania_menu_bg[];
@@ -175,10 +175,50 @@ extern const fb_data brickmania_powerups[];
175/* purple, red, blue, pink, green, yellow orange */ 175/* purple, red, blue, pink, green, yellow orange */
176extern const fb_data brickmania_bricks[]; 176extern const fb_data brickmania_bricks[];
177 177
178#if (LCD_WIDTH == 320) && (LCD_HEIGHT == 240)
179
180/* The time (in ms) for one iteration through the game loop - decrease this
181 to speed up the game - note that current_tick is (currently) only accurate
182 to 10ms.
183*/
184#define CYCLETIME 30
185
186#define PAD_WIDTH 40
187#define PAD_HEIGHT 5
188#define PAD_POS_Y LCD_HEIGHT - 7
189#define BRICK_HEIGHT 12
190#define BRICK_WIDTH 32
191#define BALL 5
192#define HALFBALL 3
193#define LEFTMARGIN 5
194#define TOPMARGIN 30
195
196#define MENU_BMPHEIGHT 20
197#define MENU_BMPWIDTH 112
198
199#define BMPHEIGHT_powerup 6
200#define BMPWIDTH_powerup 10
178 201
202#define BMPHEIGHT_menu LCD_HEIGHT
203#define BMPWIDTH_menu LCD_WIDTH
179 204
180/* TO DO: This needs adjusting correctly for larger than 220x176 LCDS */ 205#define BMPXOFS_start 105
181#if (LCD_WIDTH >= 220) && (LCD_HEIGHT >= 176) 206#define BMPYOFS_start 110
207#define BMPXOFS_resume 112
208#define BMPYOFS_resume 132
209#define BMPXOFS_help 142
210#define BMPYOFS_help 150
211#define BMPXOFS_quit 143
212#define BMPYOFS_quit 170
213#define HIGHSCORE_XPOS 57
214#define HIGHSCORE_YPOS 88
215
216#define STRINGPOS_finsh 140
217#define STRINGPOS_congrats 157
218#define STRINGPOS_navi 150
219#define STRINGPOS_flipsides 150
220
221#elif (LCD_WIDTH >= 220) && (LCD_HEIGHT >= 176)
182 222
183/* The time (in ms) for one iteration through the game loop - decrease this 223/* The time (in ms) for one iteration through the game loop - decrease this
184 to speed up the game - note that current_tick is (currently) only accurate 224 to speed up the game - note that current_tick is (currently) only accurate
@@ -863,18 +903,18 @@ int game_menu(int when)
863 903
864 if (when==1) { 904 if (when==1) {
865 if (cur==1) 905 if (cur==1)
866 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0, 906 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0,
867 MENU_BMPHEIGHT * BM_SEL_RESUME, MENU_BMPWIDTH, 907 MENU_BMPHEIGHT * BM_SEL_RESUME, MENU_BMPWIDTH,
868 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH, 908 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH,
869 MENU_BMPHEIGHT); 909 MENU_BMPHEIGHT);
870 else 910 else
871 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0, 911 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0,
872 MENU_BMPHEIGHT * BM_RESUME, MENU_BMPWIDTH, 912 MENU_BMPHEIGHT * BM_RESUME, MENU_BMPWIDTH,
873 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH, 913 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH,
874 MENU_BMPHEIGHT); 914 MENU_BMPHEIGHT);
875 915
876 } else { 916 } else {
877 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0, 917 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0,
878 MENU_BMPHEIGHT * BM_NO_RESUME, MENU_BMPWIDTH, 918 MENU_BMPHEIGHT * BM_NO_RESUME, MENU_BMPWIDTH,
879 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH, 919 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH,
880 MENU_BMPHEIGHT); 920 MENU_BMPHEIGHT);
@@ -882,23 +922,23 @@ int game_menu(int when)
882 922
883 923
884 if (cur==2) 924 if (cur==2)
885 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0, 925 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0,
886 MENU_BMPHEIGHT * BM_SEL_HELP, MENU_BMPWIDTH, 926 MENU_BMPHEIGHT * BM_SEL_HELP, MENU_BMPWIDTH,
887 BMPXOFS_help, BMPYOFS_help, MENU_BMPWIDTH, 927 BMPXOFS_help, BMPYOFS_help, MENU_BMPWIDTH,
888 MENU_BMPHEIGHT); 928 MENU_BMPHEIGHT);
889 else 929 else
890 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0, 930 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0,
891 MENU_BMPHEIGHT * BM_HELP, MENU_BMPWIDTH, 931 MENU_BMPHEIGHT * BM_HELP, MENU_BMPWIDTH,
892 BMPXOFS_help, BMPYOFS_help, MENU_BMPWIDTH, 932 BMPXOFS_help, BMPYOFS_help, MENU_BMPWIDTH,
893 MENU_BMPHEIGHT); 933 MENU_BMPHEIGHT);
894 934
895 if (cur==3) 935 if (cur==3)
896 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0, 936 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0,
897 MENU_BMPHEIGHT * BM_SEL_QUIT, MENU_BMPWIDTH, 937 MENU_BMPHEIGHT * BM_SEL_QUIT, MENU_BMPWIDTH,
898 BMPXOFS_quit, BMPYOFS_quit, MENU_BMPWIDTH, 938 BMPXOFS_quit, BMPYOFS_quit, MENU_BMPWIDTH,
899 MENU_BMPHEIGHT); 939 MENU_BMPHEIGHT);
900 else 940 else
901 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0, 941 rb->lcd_bitmap_transparent_part(brickmania_menu_items, 0,
902 MENU_BMPHEIGHT * BM_QUIT, MENU_BMPWIDTH, 942 MENU_BMPHEIGHT * BM_QUIT, MENU_BMPWIDTH,
903 BMPXOFS_quit, BMPYOFS_quit, MENU_BMPWIDTH, 943 BMPXOFS_quit, BMPYOFS_quit, MENU_BMPWIDTH,
904 MENU_BMPHEIGHT); 944 MENU_BMPHEIGHT);
@@ -916,18 +956,18 @@ int game_menu(int when)
916 956
917 if (when==1) { 957 if (when==1) {
918 if (cur==1) 958 if (cur==1)
919 rb->lcd_bitmap_part(brickmania_menu_items, 0, 959 rb->lcd_bitmap_part(brickmania_menu_items, 0,
920 MENU_BMPHEIGHT * BM_SEL_RESUME, MENU_BMPWIDTH, 960 MENU_BMPHEIGHT * BM_SEL_RESUME, MENU_BMPWIDTH,
921 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH, 961 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH,
922 MENU_BMPHEIGHT); 962 MENU_BMPHEIGHT);
923 else 963 else
924 rb->lcd_bitmap_part(brickmania_menu_items, 0, 964 rb->lcd_bitmap_part(brickmania_menu_items, 0,
925 MENU_BMPHEIGHT * BM_RESUME, MENU_BMPWIDTH, 965 MENU_BMPHEIGHT * BM_RESUME, MENU_BMPWIDTH,
926 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH, 966 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH,
927 MENU_BMPHEIGHT); 967 MENU_BMPHEIGHT);
928 968
929 } else { 969 } else {
930 rb->lcd_bitmap_part(brickmania_menu_items, 0, 970 rb->lcd_bitmap_part(brickmania_menu_items, 0,
931 MENU_BMPHEIGHT * BM_NO_RESUME, MENU_BMPWIDTH, 971 MENU_BMPHEIGHT * BM_NO_RESUME, MENU_BMPWIDTH,
932 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH, 972 BMPXOFS_resume, BMPYOFS_resume, MENU_BMPWIDTH,
933 MENU_BMPHEIGHT); 973 MENU_BMPHEIGHT);
@@ -935,23 +975,23 @@ int game_menu(int when)
935 975
936 976
937 if (cur==2) 977 if (cur==2)
938 rb->lcd_bitmap_part(brickmania_menu_items, 0, 978 rb->lcd_bitmap_part(brickmania_menu_items, 0,
939 MENU_BMPHEIGHT * BM_SEL_HELP, MENU_BMPWIDTH, 979 MENU_BMPHEIGHT * BM_SEL_HELP, MENU_BMPWIDTH,
940 BMPXOFS_help, BMPYOFS_help, MENU_BMPWIDTH, 980 BMPXOFS_help, BMPYOFS_help, MENU_BMPWIDTH,
941 MENU_BMPHEIGHT); 981 MENU_BMPHEIGHT);
942 else 982 else
943 rb->lcd_bitmap_part(brickmania_menu_items, 0, 983 rb->lcd_bitmap_part(brickmania_menu_items, 0,
944 MENU_BMPHEIGHT * BM_HELP, MENU_BMPWIDTH, 984 MENU_BMPHEIGHT * BM_HELP, MENU_BMPWIDTH,
945 BMPXOFS_help, BMPYOFS_help, MENU_BMPWIDTH, 985 BMPXOFS_help, BMPYOFS_help, MENU_BMPWIDTH,
946 MENU_BMPHEIGHT); 986 MENU_BMPHEIGHT);
947 987
948 if (cur==3) 988 if (cur==3)
949 rb->lcd_bitmap_part(brickmania_menu_items, 0, 989 rb->lcd_bitmap_part(brickmania_menu_items, 0,
950 MENU_BMPHEIGHT * BM_SEL_QUIT, MENU_BMPWIDTH, 990 MENU_BMPHEIGHT * BM_SEL_QUIT, MENU_BMPWIDTH,
951 BMPXOFS_quit, BMPYOFS_quit, MENU_BMPWIDTH, 991 BMPXOFS_quit, BMPYOFS_quit, MENU_BMPWIDTH,
952 MENU_BMPHEIGHT); 992 MENU_BMPHEIGHT);
953 else 993 else
954 rb->lcd_bitmap_part(brickmania_menu_items, 0, 994 rb->lcd_bitmap_part(brickmania_menu_items, 0,
955 MENU_BMPHEIGHT * BM_QUIT, MENU_BMPWIDTH, 995 MENU_BMPHEIGHT * BM_QUIT, MENU_BMPWIDTH,
956 BMPXOFS_quit, BMPYOFS_quit, MENU_BMPWIDTH, 996 BMPXOFS_quit, BMPYOFS_quit, MENU_BMPWIDTH,
957 MENU_BMPHEIGHT); 997 MENU_BMPHEIGHT);
@@ -1147,7 +1187,7 @@ int help(int when)
1147 if(yoffset+maxY > LCD_HEIGHT) 1187 if(yoffset+maxY > LCD_HEIGHT)
1148 yoffset-=2; 1188 yoffset-=2;
1149 break; 1189 break;
1150 1190
1151 default: 1191 default:
1152 if(rb->default_event_handler(button) == SYS_USB_CONNECTED) 1192 if(rb->default_event_handler(button) == SYS_USB_CONNECTED)
1153 return 1; 1193 return 1;
@@ -1373,7 +1413,7 @@ int game_loop(void)
1373 1413
1374 if (brick[i*10+j].powertop>PAD_POS_Y) 1414 if (brick[i*10+j].powertop>PAD_POS_Y)
1375 brick[i*10+j].poweruse=1; 1415 brick[i*10+j].poweruse=1;
1376 1416
1377 brickx=LEFTMARGIN+j*BRICK_WIDTH; 1417 brickx=LEFTMARGIN+j*BRICK_WIDTH;
1378 bricky=TOPMARGIN+i*BRICK_HEIGHT; 1418 bricky=TOPMARGIN+i*BRICK_HEIGHT;
1379 if (pad_type==2) { 1419 if (pad_type==2) {
@@ -1400,7 +1440,7 @@ int game_loop(void)
1400 } 1440 }
1401 } 1441 }
1402 } 1442 }
1403 1443
1404 if (brick[i*10+j].used==1) { 1444 if (brick[i*10+j].used==1) {
1405 rb->lcd_bitmap_part(brickmania_bricks,0, 1445 rb->lcd_bitmap_part(brickmania_bricks,0,
1406 BRICK_HEIGHT*brick[i*10+j].color, 1446 BRICK_HEIGHT*brick[i*10+j].color,
@@ -1422,7 +1462,7 @@ int game_loop(void)
1422 } 1462 }
1423 1463
1424 for(k=0;k<used_balls;k++) { 1464 for(k=0;k<used_balls;k++) {
1425 if (ball[k].pos_y <100) { 1465 if (ball[k].pos_y <160) {
1426 if (brick[i*10+j].used==1) { 1466 if (brick[i*10+j].used==1) {
1427 if ((ball[k].pos_x+ball[k].x+HALFBALL >= 1467 if ((ball[k].pos_x+ball[k].x+HALFBALL >=
1428 brickx && 1468 brickx &&
@@ -1641,7 +1681,7 @@ int game_loop(void)
1641 (ball[k].pos_x +HALFBALL>= 1681 (ball[k].pos_x +HALFBALL>=
1642 pad_pos_x+(PAD_WIDTH-(PAD_WIDTH/2/4)) && 1682 pad_pos_x+(PAD_WIDTH-(PAD_WIDTH/2/4)) &&
1643 ball[k].pos_x+HALFBALL <= pad_pos_x+PAD_WIDTH)) { 1683 ball[k].pos_x+HALFBALL <= pad_pos_x+PAD_WIDTH)) {
1644 1684
1645 ball[k].y = -2; 1685 ball[k].y = -2;
1646 if (ball[k].pos_x != 0 && 1686 if (ball[k].pos_x != 0 &&
1647 ball[k].pos_x+BALL!=LCD_WIDTH) 1687 ball[k].pos_x+BALL!=LCD_WIDTH)
@@ -1691,7 +1731,7 @@ int game_loop(void)
1691 (ball[k].pos_x+2 >= pad_pos_x+(PAD_WIDTH/2+2) && 1731 (ball[k].pos_x+2 >= pad_pos_x+(PAD_WIDTH/2+2) &&
1692 ball[k].pos_x+2 <= 1732 ball[k].pos_x+2 <=
1693 pad_pos_x+(PAD_WIDTH-3*(PAD_WIDTH/2/4)) )) { 1733 pad_pos_x+(PAD_WIDTH-3*(PAD_WIDTH/2/4)) )) {
1694 1734
1695 ball[k].y = -4; 1735 ball[k].y = -4;
1696 if (ball[k].pos_x != 0 && 1736 if (ball[k].pos_x != 0 &&
1697 ball[k].pos_x+BALL!=LCD_WIDTH) 1737 ball[k].pos_x+BALL!=LCD_WIDTH)
@@ -1720,7 +1760,7 @@ int game_loop(void)
1720 ball[k].glue=true; 1760 ball[k].glue=true;
1721 } 1761 }
1722 } /* for k */ 1762 } /* for k */
1723 1763
1724 rb->lcd_update(); 1764 rb->lcd_update();
1725 1765
1726 if (brick_on_board < 0) { 1766 if (brick_on_board < 0) {
@@ -1820,7 +1860,7 @@ int game_loop(void)
1820 } 1860 }
1821 } 1861 }
1822 1862
1823 1863
1824 switch(button) { 1864 switch(button) {
1825 case UP: 1865 case UP:
1826 case SELECT: 1866 case SELECT:
@@ -1894,7 +1934,7 @@ int game_loop(void)
1894 y[k]=ball[k].y; 1934 y[k]=ball[k].y;
1895 ball[k].y=0; 1935 ball[k].y=0;
1896 } 1936 }
1897 1937
1898 break; 1938 break;
1899 1939
1900 default: 1940 default: