summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h4
-rw-r--r--apps/plugins/bitmaps/native/SOURCES1
-rw-r--r--apps/plugins/bitmaps/native/brickmania_break.220x176x16.bmpbin0 -> 2616 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_bricks.220x176x16.bmpbin3414 -> 3640 bytes
-rw-r--r--apps/plugins/brickmania.c23
6 files changed, 24 insertions, 6 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 8b47af7e02..d9433d7bff 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -119,6 +119,8 @@ static const struct plugin_api rockbox_api = {
119 lcd_get_background, 119 lcd_get_background,
120 lcd_bitmap_part, 120 lcd_bitmap_part,
121 lcd_bitmap, 121 lcd_bitmap,
122 lcd_bitmap_transparent_part,
123 lcd_bitmap_transparent,
122#endif 124#endif
123 lcd_putsxy, 125 lcd_putsxy,
124 lcd_puts_style, 126 lcd_puts_style,
diff --git a/apps/plugin.h b/apps/plugin.h
index 10ae180df7..61a3219893 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -161,6 +161,10 @@ struct plugin_api {
161 int stride, int x, int y, int width, int height); 161 int stride, int x, int y, int width, int height);
162 void (*lcd_bitmap)(const fb_data *src, int x, int y, int width, 162 void (*lcd_bitmap)(const fb_data *src, int x, int y, int width,
163 int height); 163 int height);
164 void (*lcd_bitmap_transparent_part)(const fb_data *src, int src_x, int src_y,
165 int stride, int x, int y, int width, int height);
166 void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y,
167 int width, int height);
164#endif 168#endif
165 void (*lcd_putsxy)(int x, int y, const unsigned char *string); 169 void (*lcd_putsxy)(int x, int y, const unsigned char *string);
166 void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); 170 void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style);
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index 5b96f30323..15b1c46237 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -37,6 +37,7 @@ brickmania_sel_resume.220x176x16.bmp
37brickmania_sel_quit.220x176x16.bmp 37brickmania_sel_quit.220x176x16.bmp
38brickmania_sel_start.220x176x16.bmp 38brickmania_sel_start.220x176x16.bmp
39brickmania_start.220x176x16.bmp 39brickmania_start.220x176x16.bmp
40brickmania_break.220x176x16.bmp
40#endif 41#endif
41 42
42#endif /* HAVE_LCD_BITMAP */ 43#endif /* HAVE_LCD_BITMAP */
diff --git a/apps/plugins/bitmaps/native/brickmania_break.220x176x16.bmp b/apps/plugins/bitmaps/native/brickmania_break.220x176x16.bmp
new file mode 100644
index 0000000000..531bc585b2
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_break.220x176x16.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 1cf951b16f..e89f293bf0 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/brickmania.c b/apps/plugins/brickmania.c
index 34f4b078f6..2b75ce8f95 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -72,6 +72,7 @@ extern const fb_data brickmania_sel_quit[];
72extern const fb_data brickmania_sel_resume[]; 72extern const fb_data brickmania_sel_resume[];
73extern const fb_data brickmania_sel_start[]; 73extern const fb_data brickmania_sel_start[];
74extern const fb_data brickmania_start[]; 74extern const fb_data brickmania_start[];
75extern const fb_data brickmania_break[];
75 76
76/* normal, glue, fire */ 77/* normal, glue, fire */
77extern const fb_data brickmania_pads[]; 78extern const fb_data brickmania_pads[];
@@ -93,8 +94,9 @@ extern const fb_data brickmania_bricks[];
93#define PAD_HEIGHT 5 94#define PAD_HEIGHT 5
94#define PAD_POS_Y LCD_HEIGHT - 7 95#define PAD_POS_Y LCD_HEIGHT - 7
95#define BRICK_HEIGHT 8 96#define BRICK_HEIGHT 8
96#define BRICK_WIDTH 20 97#define BRICK_WIDTH 21
97#define BALL 5 98#define BALL 5
99#define LEFTMARGIN 5
98 100
99#define BMPHEIGHT_help 19 101#define BMPHEIGHT_help 19
100#define BMPWIDTH_help 37 102#define BMPWIDTH_help 37
@@ -458,6 +460,7 @@ typedef struct cube {
458 char used; 460 char used;
459 int color; 461 int color;
460 int hits; 462 int hits;
463 int hiteffect;
461} cube; 464} cube;
462cube brick[80]; 465cube brick[80];
463 466
@@ -505,6 +508,7 @@ void int_game(int new_game)
505 brick[i*10+j].power=rb->rand()%25; /* +8 make the game with less powerups */ 508 brick[i*10+j].power=rb->rand()%25; /* +8 make the game with less powerups */
506 brick[i*10+j].hits=levels[cur_level][i][j]>=10? 509 brick[i*10+j].hits=levels[cur_level][i][j]>=10?
507 levels[cur_level][i][j]/16-1:0; 510 levels[cur_level][i][j]/16-1:0;
511 brick[i*10+j].hiteffect=0;
508 brick[i*10+j].powertop=30+i*10+BRICK_HEIGHT; 512 brick[i*10+j].powertop=30+i*10+BRICK_HEIGHT;
509 brick[i*10+j].used=(levels[cur_level][i][j]==0?0:1); 513 brick[i*10+j].used=(levels[cur_level][i][j]==0?0:1);
510 brick[i*10+j].color=(levels[cur_level][i][j]>=10? 514 brick[i*10+j].color=(levels[cur_level][i][j]>=10?
@@ -813,12 +817,12 @@ int game_loop(void){
813 brick[i*10+j].powertop+=2; 817 brick[i*10+j].powertop+=2;
814 rb->lcd_bitmap_part(brickmania_powerups,0, 818 rb->lcd_bitmap_part(brickmania_powerups,0,
815 BMPHEIGHT_powerup*brick[i*10+j].power, 819 BMPHEIGHT_powerup*brick[i*10+j].power,
816 BMPWIDTH_powerup,10+j*BRICK_WIDTH+5, 820 BMPWIDTH_powerup,LEFTMARGIN+j*BRICK_WIDTH+5,
817 brick[i*10+j].powertop, 10, 6); 821 brick[i*10+j].powertop, 10, 6);
818 } 822 }
819 } 823 }
820 824
821 if ((pad_pos_x<10+j*BRICK_WIDTH+5 && pad_pos_x+PAD_WIDTH>10+j*BRICK_WIDTH+5) && brick[i*10+j].powertop+6>=PAD_POS_Y && brick[i*10+j].poweruse==2) { 825 if ((pad_pos_x<LEFTMARGIN+j*BRICK_WIDTH+5 && pad_pos_x+PAD_WIDTH>LEFTMARGIN+j*BRICK_WIDTH+5) && brick[i*10+j].powertop+6>=PAD_POS_Y && brick[i*10+j].poweruse==2) {
822 switch(brick[i*10+j].power) { 826 switch(brick[i*10+j].power) {
823 case 0: 827 case 0:
824 life++; 828 life++;
@@ -859,7 +863,7 @@ int game_loop(void){
859 if (brick[i*10+j].powertop>PAD_POS_Y) 863 if (brick[i*10+j].powertop>PAD_POS_Y)
860 brick[i*10+j].poweruse=1; 864 brick[i*10+j].poweruse=1;
861 865
862 brickx=10+j*BRICK_WIDTH; 866 brickx=LEFTMARGIN+j*BRICK_WIDTH;
863 bricky=30+i*8; 867 bricky=30+i*8;
864 if (pad_type==2) { 868 if (pad_type==2) {
865 for (k=0;k<=30;k++) { 869 for (k=0;k<=30;k++) {
@@ -869,6 +873,7 @@ int game_loop(void){
869 fire[k].top=-16; 873 fire[k].top=-16;
870 if (brick[i*10+j].hits > 0){ 874 if (brick[i*10+j].hits > 0){
871 brick[i*10+j].hits--; 875 brick[i*10+j].hits--;
876 brick[i*10+j].hiteffect++;
872 score+=3; 877 score+=3;
873 } 878 }
874 else { 879 else {
@@ -881,8 +886,10 @@ int game_loop(void){
881 } 886 }
882 } 887 }
883 888
884 if (brick[i*10+j].used==1) 889 if (brick[i*10+j].used==1){
885 rb->lcd_bitmap_part(brickmania_bricks,0,BRICK_HEIGHT*brick[i*10+j].color,BRICK_WIDTH,10+j*BRICK_WIDTH, 30+i*8, BRICK_WIDTH, BRICK_HEIGHT); 890 rb->lcd_bitmap_part(brickmania_bricks,0,BRICK_HEIGHT*brick[i*10+j].color,BRICK_WIDTH,LEFTMARGIN+j*BRICK_WIDTH, 30+i*8, BRICK_WIDTH, BRICK_HEIGHT);
891 rb->lcd_bitmap_transparent_part(brickmania_break,0,BRICK_HEIGHT*brick[i*10+j].hiteffect,BRICK_WIDTH,LEFTMARGIN+j*BRICK_WIDTH, 30+i*8, BRICK_WIDTH, BRICK_HEIGHT);
892 }
886 if (ball_pos_y <100) { 893 if (ball_pos_y <100) {
887 if (brick[i*10+j].used==1) { 894 if (brick[i*10+j].used==1) {
888 if ((ball_pos_x+ballx+3 >= brickx && ball_pos_x+ballx+3 <= brickx+BRICK_WIDTH) && ((bricky-4<ball_pos_y+BALL && bricky>ball_pos_y+BALL) || (bricky+4>ball_pos_y+BALL+BALL && bricky<ball_pos_y+BALL+BALL)) && (bally >0)){ 895 if ((ball_pos_x+ballx+3 >= brickx && ball_pos_x+ballx+3 <= brickx+BRICK_WIDTH) && ((bricky-4<ball_pos_y+BALL && bricky>ball_pos_y+BALL) || (bricky+4>ball_pos_y+BALL+BALL && bricky<ball_pos_y+BALL+BALL)) && (bally >0)){
@@ -900,6 +907,7 @@ int game_loop(void){
900 if ((ball_pos_x+3 >= brickx && ball_pos_x+3 <= brickx+BRICK_WIDTH) && ((bricky+BRICK_HEIGHT==ball_pos_y) || (bricky+BRICK_HEIGHT-6<=ball_pos_y && bricky+BRICK_HEIGHT>ball_pos_y)) && (bally <0)) { /* bottom line */ 907 if ((ball_pos_x+3 >= brickx && ball_pos_x+3 <= brickx+BRICK_WIDTH) && ((bricky+BRICK_HEIGHT==ball_pos_y) || (bricky+BRICK_HEIGHT-6<=ball_pos_y && bricky+BRICK_HEIGHT>ball_pos_y)) && (bally <0)) { /* bottom line */
901 if (brick[i*10+j].hits > 0){ 908 if (brick[i*10+j].hits > 0){
902 brick[i*10+j].hits--; 909 brick[i*10+j].hits--;
910 brick[i*10+j].hiteffect++;
903 score+=2; 911 score+=2;
904 } 912 }
905 else { 913 else {
@@ -912,6 +920,7 @@ int game_loop(void){
912 } else if ((ball_pos_x+3 >= brickx && ball_pos_x+3 <= brickx+BRICK_WIDTH) && ((bricky==ball_pos_y+BALL) || (bricky+6>=ball_pos_y+BALL && bricky<ball_pos_y+BALL)) && (bally >0)) { /* top line */ 920 } else if ((ball_pos_x+3 >= brickx && ball_pos_x+3 <= brickx+BRICK_WIDTH) && ((bricky==ball_pos_y+BALL) || (bricky+6>=ball_pos_y+BALL && bricky<ball_pos_y+BALL)) && (bally >0)) { /* top line */
913 if (brick[i*10+j].hits > 0){ 921 if (brick[i*10+j].hits > 0){
914 brick[i*10+j].hits--; 922 brick[i*10+j].hits--;
923 brick[i*10+j].hiteffect++;
915 score+=2; 924 score+=2;
916 } 925 }
917 else { 926 else {
@@ -926,6 +935,7 @@ int game_loop(void){
926 if ((ball_pos_y+3 >= bricky && ball_pos_y+3 <= bricky+BRICK_HEIGHT) && ((brickx==ball_pos_x+BALL) || (brickx+6>=ball_pos_x+BALL && brickx<ball_pos_x+BALL)) && (ballx > 0)) { /* left line */ 935 if ((ball_pos_y+3 >= bricky && ball_pos_y+3 <= bricky+BRICK_HEIGHT) && ((brickx==ball_pos_x+BALL) || (brickx+6>=ball_pos_x+BALL && brickx<ball_pos_x+BALL)) && (ballx > 0)) { /* left line */
927 if (brick[i*10+j].hits > 0){ 936 if (brick[i*10+j].hits > 0){
928 brick[i*10+j].hits--; 937 brick[i*10+j].hits--;
938 brick[i*10+j].hiteffect++;
929 score+=2; 939 score+=2;
930 } 940 }
931 else { 941 else {
@@ -938,6 +948,7 @@ int game_loop(void){
938 } else if ((ball_pos_y+3 >= bricky && ball_pos_y+3 <= bricky+BRICK_HEIGHT) && ((brickx+BRICK_WIDTH==ball_pos_x) || (brickx+BRICK_WIDTH-6<=ball_pos_x && brickx+BRICK_WIDTH>ball_pos_x)) && (ballx < 0)) { /* Right line */ 948 } else if ((ball_pos_y+3 >= bricky && ball_pos_y+3 <= bricky+BRICK_HEIGHT) && ((brickx+BRICK_WIDTH==ball_pos_x) || (brickx+BRICK_WIDTH-6<=ball_pos_x && brickx+BRICK_WIDTH>ball_pos_x)) && (ballx < 0)) { /* Right line */
939 if (brick[i*10+j].hits > 0){ 949 if (brick[i*10+j].hits > 0){
940 brick[i*10+j].hits--; 950 brick[i*10+j].hits--;
951 brick[i*10+j].hiteffect++;
941 score+=2; 952 score+=2;
942 } 953 }
943 else { 954 else {