Star: Add support for Vertical strides.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22584 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Karl Kurbjun 2009-09-01 02:44:11 +00:00
parent e80add32ba
commit b3edb1bdba

View file

@ -728,7 +728,8 @@ static void star_display_board_info(int current_level)
label_pos_y, "C:"); label_pos_y, "C:");
rb->lcd_bitmap_part(star_tiles, 0, control == STAR_CONTROL_BALL ? 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, STAR_OFFSET_X + (STAR_WIDTH-1) * TILE_WIDTH,
tile_pos_y, TILE_WIDTH, TILE_HEIGHT); tile_pos_y, TILE_WIDTH, TILE_HEIGHT);
@ -766,10 +767,13 @@ static int star_load_level(int current_level)
{ {
# define DRAW_TILE( a ) \ # define DRAW_TILE( a ) \
rb->lcd_bitmap_part( star_tiles, 0, \ rb->lcd_bitmap_part( star_tiles, 0, \
a*TILE_HEIGHT, TILE_WIDTH, \ a*TILE_HEIGHT, \
STRIDE( BMPWIDTH_star_tiles, \
BMPHEIGHT_star_tiles), \
STAR_OFFSET_X + x * TILE_WIDTH, \ STAR_OFFSET_X + x * TILE_WIDTH, \
STAR_OFFSET_Y + y * TILE_HEIGHT, \ STAR_OFFSET_Y + y * TILE_HEIGHT, \
TILE_WIDTH, TILE_HEIGHT); TILE_WIDTH, TILE_HEIGHT);
case STAR_VOID: case STAR_VOID:
DRAW_TILE( SPACE ); DRAW_TILE( SPACE );
break; 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++) for (i = 1 ; i <= TILE_WIDTH ; i++)
{ {
STAR_SLEEP 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); 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); 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), rb->lcd_update_rect(start_x + delta_x * i - (delta_x>0?1:0),
start_y, TILE_WIDTH + 1, TILE_HEIGHT); 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++) for (i = 1 ; i <= TILE_HEIGHT ; i++)
{ {
STAR_SLEEP 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); 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); 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), rb->lcd_update_rect(start_x, start_y + delta_y * i - (delta_y>0?1:0),
TILE_WIDTH, TILE_HEIGHT + 1); TILE_WIDTH, TILE_HEIGHT + 1);