summaryrefslogtreecommitdiffstats
path: root/apps/plugins/star.c
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-09-01 02:44:11 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-09-01 02:44:11 +0000
commitb3edb1bdbaf36e96277fb1300ca91e680d3c8072 (patch)
tree1cd53223c87366f353a04b2c83b221197489d1fe /apps/plugins/star.c
parente80add32ba6712cc8d93132907e873ff74c2e46e (diff)
downloadrockbox-b3edb1bdbaf36e96277fb1300ca91e680d3c8072.tar.gz
rockbox-b3edb1bdbaf36e96277fb1300ca91e680d3c8072.tar.bz2
rockbox-b3edb1bdbaf36e96277fb1300ca91e680d3c8072.zip
Star: Add support for Vertical strides.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22584 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/star.c')
-rw-r--r--apps/plugins/star.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/apps/plugins/star.c b/apps/plugins/star.c
index 663c9dfca3..e40fa5a2dc 100644
--- a/apps/plugins/star.c
+++ b/apps/plugins/star.c
@@ -728,7 +728,8 @@ static void star_display_board_info(int current_level)
label_pos_y, "C:");
rb->lcd_bitmap_part(star_tiles, 0, control == STAR_CONTROL_BALL ?
- BALL*TILE_HEIGHT : BLOCK*TILE_HEIGHT, TILE_WIDTH,
+ BALL*TILE_HEIGHT : BLOCK*TILE_HEIGHT,
+ STRIDE(BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles),
STAR_OFFSET_X + (STAR_WIDTH-1) * TILE_WIDTH,
tile_pos_y, TILE_WIDTH, TILE_HEIGHT);
@@ -764,12 +765,15 @@ static int star_load_level(int current_level)
board[y][x] = *ptr_tab;
switch (*ptr_tab)
{
-# define DRAW_TILE( a ) \
- rb->lcd_bitmap_part( star_tiles, 0, \
- a*TILE_HEIGHT, TILE_WIDTH, \
- STAR_OFFSET_X + x * TILE_WIDTH, \
- STAR_OFFSET_Y + y * TILE_HEIGHT, \
- TILE_WIDTH, TILE_HEIGHT);
+# define DRAW_TILE( a ) \
+ rb->lcd_bitmap_part( star_tiles, 0, \
+ a*TILE_HEIGHT, \
+ STRIDE( BMPWIDTH_star_tiles, \
+ BMPHEIGHT_star_tiles), \
+ STAR_OFFSET_X + x * TILE_WIDTH, \
+ STAR_OFFSET_Y + y * TILE_HEIGHT, \
+ TILE_WIDTH, TILE_HEIGHT);
+
case STAR_VOID:
DRAW_TILE( SPACE );
break;
@@ -815,9 +819,11 @@ static void star_animate_tile(int tile_no, int start_x, int start_y,
for (i = 1 ; i <= TILE_WIDTH ; i++)
{
STAR_SLEEP
- rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT, TILE_WIDTH,
+ rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT,
+ STRIDE(BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles),
start_x, start_y, TILE_WIDTH, TILE_HEIGHT);
- rb->lcd_bitmap_part(star_tiles, 0, tile_no * TILE_HEIGHT, TILE_WIDTH,
+ rb->lcd_bitmap_part(star_tiles, 0, tile_no * TILE_HEIGHT,
+ STRIDE(BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles),
start_x + delta_x * i, start_y, TILE_WIDTH, TILE_HEIGHT);
rb->lcd_update_rect(start_x + delta_x * i - (delta_x>0?1:0),
start_y, TILE_WIDTH + 1, TILE_HEIGHT);
@@ -828,9 +834,11 @@ static void star_animate_tile(int tile_no, int start_x, int start_y,
for (i = 1 ; i <= TILE_HEIGHT ; i++)
{
STAR_SLEEP
- rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT, TILE_WIDTH,
+ rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT,
+ STRIDE(BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles),
start_x, start_y, TILE_WIDTH, TILE_HEIGHT);
- rb->lcd_bitmap_part(star_tiles, 0, tile_no * TILE_HEIGHT, TILE_WIDTH,
+ rb->lcd_bitmap_part(star_tiles, 0, tile_no * TILE_HEIGHT,
+ STRIDE(BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles),
start_x, start_y + delta_y * i, TILE_WIDTH, TILE_HEIGHT);
rb->lcd_update_rect(start_x, start_y + delta_y * i - (delta_y>0?1:0),
TILE_WIDTH, TILE_HEIGHT + 1);