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:
parent
e80add32ba
commit
b3edb1bdba
1 changed files with 19 additions and 11 deletions
|
@ -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);
|
||||||
|
|
||||||
|
@ -764,12 +765,15 @@ static int star_load_level(int current_level)
|
||||||
board[y][x] = *ptr_tab;
|
board[y][x] = *ptr_tab;
|
||||||
switch (*ptr_tab)
|
switch (*ptr_tab)
|
||||||
{
|
{
|
||||||
# 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, \
|
||||||
STAR_OFFSET_X + x * TILE_WIDTH, \
|
STRIDE( BMPWIDTH_star_tiles, \
|
||||||
STAR_OFFSET_Y + y * TILE_HEIGHT, \
|
BMPHEIGHT_star_tiles), \
|
||||||
TILE_WIDTH, TILE_HEIGHT);
|
STAR_OFFSET_X + x * TILE_WIDTH, \
|
||||||
|
STAR_OFFSET_Y + y * 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);
|
||||||
|
|
Loading…
Reference in a new issue