summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-10-08 00:15:54 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-10-08 00:15:54 +0000
commitf7a67625dcfe3bc9d532c8fe35146de2b5d3af55 (patch)
treea415661fb3b9adb6a9b0d8a5ff899a0f4da937f8 /apps/plugins
parentfa7f829665d6595c04d12f051636170bc61f9d09 (diff)
Brickmania: Fix the paddle drawing - The strides were wrong with paddles other than the standard one.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23003 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/brickmania.c41
1 files changed, 30 insertions, 11 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 74539518b7..4a67e22b67 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -1571,18 +1571,37 @@ static int brickmania_game_loop(void)
} /* for j */
} /* for i */
- /* draw the pad */
- rb->lcd_bitmap_part(
- /* Figure out which paddle to draw */
- (pad_width == PAD_WIDTH) ? brickmania_pads :
- (pad_width == LONG_PAD_WIDTH) ? brickmania_long_pads :
+ /* draw the paddle according to the PAD_WIDTH */
+ if( pad_width == PAD_WIDTH ) /* Normal width */
+ {
+ rb->lcd_bitmap_part(
+ brickmania_pads,
+ 0, pad_type*PAD_HEIGHT,
+ STRIDE( SCREEN_MAIN, BMPWIDTH_brickmania_pads,
+ BMPHEIGHT_brickmania_pads),
+ INT3(pad_pos_x), INT3(PAD_POS_Y),
+ INT3(pad_width), INT3(PAD_HEIGHT) );
+ }
+ else if( pad_width == LONG_PAD_WIDTH ) /* Long Pad */
+ {
+ rb->lcd_bitmap_part(
+ brickmania_long_pads,
+ 0,pad_type*PAD_HEIGHT,
+ STRIDE( SCREEN_MAIN, BMPWIDTH_brickmania_long_pads,
+ BMPHEIGHT_brickmania_long_pads),
+ INT3(pad_pos_x), INT3(PAD_POS_Y),
+ INT3(pad_width), INT3(PAD_HEIGHT) );
+ }
+ else /* Short pad */
+ {
+ rb->lcd_bitmap_part(
brickmania_short_pads,
-
- 0, pad_type*INT3(PAD_HEIGHT),
- STRIDE( SCREEN_MAIN, BMPWIDTH_brickmania_pads,
- BMPHEIGHT_brickmania_pads),
- INT3(pad_pos_x), INT3(PAD_POS_Y),
- INT3(pad_width), INT3(PAD_HEIGHT) );
+ 0,pad_type*PAD_HEIGHT,
+ STRIDE( SCREEN_MAIN, BMPWIDTH_brickmania_short_pads,
+ BMPHEIGHT_brickmania_short_pads),
+ INT3(pad_pos_x), INT3(PAD_POS_Y),
+ INT3(pad_width), INT3(PAD_HEIGHT) );
+ }
/* If the game is not paused continue */
if (game_state!=ST_PAUSE)