diff options
Diffstat (limited to 'apps/plugins/rockblox.c')
-rw-r--r-- | apps/plugins/rockblox.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index eac6563601..a0623da314 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c | |||
@@ -110,13 +110,16 @@ static void draw_frame(int fstart_x,int fstop_x,int fstart_y,int fstop_y) | |||
110 | static void draw_block(int x, int y, int block, int frame, bool clear) | 110 | static void draw_block(int x, int y, int block, int frame, bool clear) |
111 | { | 111 | { |
112 | int i, a, b; | 112 | int i, a, b; |
113 | |||
113 | for(i=0;i < 4;i++) { | 114 | for(i=0;i < 4;i++) { |
114 | if (clear) | 115 | if (clear) |
115 | { | 116 | { |
117 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | ||
116 | for (a = 0; a < 3; a++) | 118 | for (a = 0; a < 3; a++) |
117 | for (b = 0; b < 4; b++) | 119 | for (b = 0; b < 4; b++) |
118 | rb->lcd_clearpixel(start_x + x + block_data[block][frame][1][i] * 4 - b, | 120 | rb->lcd_drawpixel(start_x + x + block_data[block][frame][1][i] * 4 - b, |
119 | start_y + y + block_data[block][frame][0][i] * 3 + a); | 121 | start_y + y + block_data[block][frame][0][i] * 3 + a); |
122 | rb->lcd_set_drawmode(DRMODE_SOLID); | ||
120 | } | 123 | } |
121 | else | 124 | else |
122 | { | 125 | { |
@@ -196,12 +199,19 @@ static bool valid_position(int x, int y, int block, int frame) | |||
196 | static void from_virtual(void) | 199 | static void from_virtual(void) |
197 | { | 200 | { |
198 | int x,y; | 201 | int x,y; |
202 | |||
199 | for(y = 0; y < max_y; y++) | 203 | for(y = 0; y < max_y; y++) |
200 | for(x = 1; x < max_x - 1; x++) | 204 | for(x = 1; x < max_x - 1; x++) |
201 | if(*(virtual + (y * max_x) + x) != 0) | 205 | if(*(virtual + (y * max_x) + x) != 0) |
206 | { | ||
202 | rb->lcd_drawpixel(start_x + x, start_y + y); | 207 | rb->lcd_drawpixel(start_x + x, start_y + y); |
208 | } | ||
203 | else | 209 | else |
204 | rb->lcd_clearpixel(start_x + x, start_y + y); | 210 | { |
211 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | ||
212 | rb->lcd_drawpixel(start_x + x, start_y + y); | ||
213 | rb->lcd_set_drawmode(DRMODE_SOLID); | ||
214 | } | ||
205 | } | 215 | } |
206 | 216 | ||
207 | static void move_block(int x,int y,int f) | 217 | static void move_block(int x,int y,int f) |
@@ -362,7 +372,9 @@ static int game_loop(void) | |||
362 | 372 | ||
363 | if(gameover()) | 373 | if(gameover()) |
364 | { | 374 | { |
365 | rb->lcd_clearrect(0, 52, LCD_WIDTH, LCD_HEIGHT - 52); | 375 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
376 | rb->lcd_fillrect(0, 52, LCD_WIDTH, LCD_HEIGHT - 52); | ||
377 | rb->lcd_set_drawmode(DRMODE_SOLID); | ||
366 | rb->lcd_putsxy(2, 52, "You lose!"); | 378 | rb->lcd_putsxy(2, 52, "You lose!"); |
367 | rb->lcd_update(); | 379 | rb->lcd_update(); |
368 | rb->sleep(HZ * 3); | 380 | rb->sleep(HZ * 3); |