forked from len0rd/rockbox
Fix STRIDE macro for multiscreen and add stride support for picture lib.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22615 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f6025186fd
commit
25123570c7
28 changed files with 194 additions and 112 deletions
|
@ -144,19 +144,20 @@ void screen_put_iconxy(struct screen * display,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data = viewer_iconset[screen].data;
|
data = viewer_iconset[screen].data;
|
||||||
stride = STRIDE( viewer_iconset[screen].width,
|
stride = STRIDE( display->screen_type, viewer_iconset[screen].width,
|
||||||
viewer_iconset[screen].height);
|
viewer_iconset[screen].height);
|
||||||
}
|
}
|
||||||
else if (custom_icons_loaded[screen])
|
else if (custom_icons_loaded[screen])
|
||||||
{
|
{
|
||||||
data = user_iconset[screen].data;
|
data = user_iconset[screen].data;
|
||||||
stride = STRIDE( user_iconset[screen].width,
|
stride = STRIDE( display->screen_type, user_iconset[screen].width,
|
||||||
user_iconset[screen].height);
|
user_iconset[screen].height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = inbuilt_icons[screen];
|
data = inbuilt_icons[screen];
|
||||||
stride = STRIDE(BMPWIDTH_default_icons, BMPHEIGHT_default_icons);
|
stride = STRIDE( display->screen_type, BMPWIDTH_default_icons,
|
||||||
|
BMPHEIGHT_default_icons);
|
||||||
}
|
}
|
||||||
/* add some left padding to the icons if they are on the edge */
|
/* add some left padding to the icons if they are on the edge */
|
||||||
if (xpos == 0)
|
if (xpos == 0)
|
||||||
|
|
|
@ -202,7 +202,8 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x,
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
else
|
else
|
||||||
screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0,
|
screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0,
|
||||||
STRIDE(bm.width, bm.height),
|
STRIDE(screen->screen_type,
|
||||||
|
bm.width, bm.height),
|
||||||
x + start, y, size, height);
|
x + start, y, size, height);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
@ -214,7 +215,8 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x,
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
else
|
else
|
||||||
screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0,
|
screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0,
|
||||||
STRIDE(bm.width, bm.height),
|
STRIDE(screen->screen_type,
|
||||||
|
bm.width, bm.height),
|
||||||
x, y + start, width, size);
|
x, y + start, width, size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,8 @@ static void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subima
|
||||||
} else {
|
} else {
|
||||||
display->transparent_bitmap_part((fb_data *)img->bm.data,
|
display->transparent_bitmap_part((fb_data *)img->bm.data,
|
||||||
0, img->subimage_height * subimage,
|
0, img->subimage_height * subimage,
|
||||||
STRIDE(img->bm.width, img->bm.height),
|
STRIDE(display->screen_type,
|
||||||
|
img->bm.width, img->bm.height),
|
||||||
img->x, img->y, img->bm.width,
|
img->x, img->y, img->bm.width,
|
||||||
img->subimage_height);
|
img->subimage_height);
|
||||||
}
|
}
|
||||||
|
|
|
@ -607,7 +607,8 @@ static void draw_card(struct card temp_card, bool shown,
|
||||||
if(shown)
|
if(shown)
|
||||||
rb->lcd_bitmap_part(card_deck, CARD_WIDTH*temp_card.num,
|
rb->lcd_bitmap_part(card_deck, CARD_WIDTH*temp_card.num,
|
||||||
CARD_HEIGHT*temp_card.suit,
|
CARD_HEIGHT*temp_card.suit,
|
||||||
STRIDE(BMPWIDTH_card_deck, BMPHEIGHT_card_deck),
|
STRIDE( SCREEN_MAIN, BMPWIDTH_card_deck,
|
||||||
|
BMPHEIGHT_card_deck),
|
||||||
x+1, y+1, CARD_WIDTH, CARD_HEIGHT);
|
x+1, y+1, CARD_WIDTH, CARD_HEIGHT);
|
||||||
else
|
else
|
||||||
rb->lcd_bitmap(card_back, x+1, y+1,CARD_WIDTH, CARD_HEIGHT);
|
rb->lcd_bitmap(card_back, x+1, y+1,CARD_WIDTH, CARD_HEIGHT);
|
||||||
|
|
|
@ -1081,7 +1081,8 @@ static int brickmania_game_loop(void)
|
||||||
brick[i*10+j].powertop+=SPEED_POWER;
|
brick[i*10+j].powertop+=SPEED_POWER;
|
||||||
rb->lcd_bitmap_part(brickmania_powerups,0,
|
rb->lcd_bitmap_part(brickmania_powerups,0,
|
||||||
POWERUP_HEIGHT*brick[i*10+j].power,
|
POWERUP_HEIGHT*brick[i*10+j].power,
|
||||||
STRIDE( BMPWIDTH_brickmania_powerups,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_brickmania_powerups,
|
||||||
BMPHEIGHT_brickmania_powerups),
|
BMPHEIGHT_brickmania_powerups),
|
||||||
LEFTMARGIN+j*BRICK_WIDTH+
|
LEFTMARGIN+j*BRICK_WIDTH+
|
||||||
(BRICK_WIDTH/2-POWERUP_WIDTH/2),
|
(BRICK_WIDTH/2-POWERUP_WIDTH/2),
|
||||||
|
@ -1205,7 +1206,8 @@ static int brickmania_game_loop(void)
|
||||||
if (brick[i*10+j].used==1) {
|
if (brick[i*10+j].used==1) {
|
||||||
rb->lcd_bitmap_part(brickmania_bricks,0,
|
rb->lcd_bitmap_part(brickmania_bricks,0,
|
||||||
BRICK_HEIGHT*brick[i*10+j].color,
|
BRICK_HEIGHT*brick[i*10+j].color,
|
||||||
STRIDE( BMPWIDTH_brickmania_bricks,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_brickmania_bricks,
|
||||||
BMPHEIGHT_brickmania_bricks),
|
BMPHEIGHT_brickmania_bricks),
|
||||||
LEFTMARGIN+j*BRICK_WIDTH,
|
LEFTMARGIN+j*BRICK_WIDTH,
|
||||||
TOPMARGIN+i*BRICK_HEIGHT,
|
TOPMARGIN+i*BRICK_HEIGHT,
|
||||||
|
@ -1214,7 +1216,8 @@ static int brickmania_game_loop(void)
|
||||||
if (brick[i*10+j].hiteffect>0)
|
if (brick[i*10+j].hiteffect>0)
|
||||||
rb->lcd_bitmap_transparent_part(brickmania_break,0,
|
rb->lcd_bitmap_transparent_part(brickmania_break,0,
|
||||||
BRICK_HEIGHT*brick[i*10+j].hiteffect,
|
BRICK_HEIGHT*brick[i*10+j].hiteffect,
|
||||||
STRIDE( BMPWIDTH_brickmania_break,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_brickmania_break,
|
||||||
BMPHEIGHT_brickmania_break),
|
BMPHEIGHT_brickmania_break),
|
||||||
LEFTMARGIN+j*BRICK_WIDTH,
|
LEFTMARGIN+j*BRICK_WIDTH,
|
||||||
TOPMARGIN+i*BRICK_HEIGHT,
|
TOPMARGIN+i*BRICK_HEIGHT,
|
||||||
|
@ -1377,7 +1380,8 @@ static int brickmania_game_loop(void)
|
||||||
rb->lcd_bitmap_part(
|
rb->lcd_bitmap_part(
|
||||||
brickmania_pads,
|
brickmania_pads,
|
||||||
0, pad_type*PAD_HEIGHT,
|
0, pad_type*PAD_HEIGHT,
|
||||||
STRIDE(BMPWIDTH_brickmania_pads, BMPHEIGHT_brickmania_pads),
|
STRIDE( SCREEN_MAIN, BMPWIDTH_brickmania_pads,
|
||||||
|
BMPHEIGHT_brickmania_pads),
|
||||||
pad_pos_x, PAD_POS_Y, pad_width, PAD_HEIGHT);
|
pad_pos_x, PAD_POS_Y, pad_width, PAD_HEIGHT);
|
||||||
}
|
}
|
||||||
else if( pad_width == LONG_PAD_WIDTH ) /* Long Pad */
|
else if( pad_width == LONG_PAD_WIDTH ) /* Long Pad */
|
||||||
|
@ -1385,7 +1389,7 @@ static int brickmania_game_loop(void)
|
||||||
rb->lcd_bitmap_part(
|
rb->lcd_bitmap_part(
|
||||||
brickmania_long_pads,
|
brickmania_long_pads,
|
||||||
0,pad_type*PAD_HEIGHT,
|
0,pad_type*PAD_HEIGHT,
|
||||||
STRIDE( BMPWIDTH_brickmania_long_pads,
|
STRIDE( SCREEN_MAIN, BMPWIDTH_brickmania_long_pads,
|
||||||
BMPHEIGHT_brickmania_long_pads),
|
BMPHEIGHT_brickmania_long_pads),
|
||||||
pad_pos_x, PAD_POS_Y, pad_width, PAD_HEIGHT);
|
pad_pos_x, PAD_POS_Y, pad_width, PAD_HEIGHT);
|
||||||
}
|
}
|
||||||
|
@ -1394,7 +1398,7 @@ static int brickmania_game_loop(void)
|
||||||
rb->lcd_bitmap_part(
|
rb->lcd_bitmap_part(
|
||||||
brickmania_short_pads,
|
brickmania_short_pads,
|
||||||
0,pad_type*PAD_HEIGHT,
|
0,pad_type*PAD_HEIGHT,
|
||||||
STRIDE( BMPWIDTH_brickmania_short_pads,
|
STRIDE( SCREEN_MAIN, BMPWIDTH_brickmania_short_pads,
|
||||||
BMPHEIGHT_brickmania_short_pads),
|
BMPHEIGHT_brickmania_short_pads),
|
||||||
pad_pos_x, PAD_POS_Y, pad_width, PAD_HEIGHT);
|
pad_pos_x, PAD_POS_Y, pad_width, PAD_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1441,7 +1441,8 @@ static void bubbles_drawboard(struct game_context* bb) {
|
||||||
if(bb->playboard[i][j].type >= 0 && !bb->playboard[i][j].delete) {
|
if(bb->playboard[i][j].type >= 0 && !bb->playboard[i][j].delete) {
|
||||||
rb->lcd_bitmap_part(bubbles_emblem,
|
rb->lcd_bitmap_part(bubbles_emblem,
|
||||||
0, EMBLEM_HEIGHT*bb->playboard[i][j].type,
|
0, EMBLEM_HEIGHT*bb->playboard[i][j].type,
|
||||||
STRIDE(BMPWIDTH_bubbles_emblem, BMPHEIGHT_bubbles_emblem),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_bubbles_emblem, BMPHEIGHT_bubbles_emblem),
|
||||||
XOFS+indent+BUBBLE_WIDTH*j+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
|
XOFS+indent+BUBBLE_WIDTH*j+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
|
||||||
YOFS+ROW_HEIGHT*i+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2+bb->compress*ROW_HEIGHT,
|
YOFS+ROW_HEIGHT*i+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2+bb->compress*ROW_HEIGHT,
|
||||||
EMBLEM_WIDTH, EMBLEM_HEIGHT);
|
EMBLEM_WIDTH, EMBLEM_HEIGHT);
|
||||||
|
@ -1458,7 +1459,8 @@ static void bubbles_drawboard(struct game_context* bb) {
|
||||||
/* display bubble to be shot */
|
/* display bubble to be shot */
|
||||||
rb->lcd_bitmap_part(bubbles_emblem,
|
rb->lcd_bitmap_part(bubbles_emblem,
|
||||||
0, EMBLEM_HEIGHT*bb->queue[bb->nextinq],
|
0, EMBLEM_HEIGHT*bb->queue[bb->nextinq],
|
||||||
STRIDE(BMPWIDTH_bubbles_emblem, BMPHEIGHT_bubbles_emblem),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_bubbles_emblem, BMPHEIGHT_bubbles_emblem),
|
||||||
SHOTX+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
|
SHOTX+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
|
||||||
SHOTY+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
|
SHOTY+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
|
||||||
EMBLEM_WIDTH, EMBLEM_HEIGHT);
|
EMBLEM_WIDTH, EMBLEM_HEIGHT);
|
||||||
|
@ -1472,7 +1474,8 @@ static void bubbles_drawboard(struct game_context* bb) {
|
||||||
#ifndef NEXT_BB_X
|
#ifndef NEXT_BB_X
|
||||||
rb->lcd_bitmap_part(bubbles_emblem,
|
rb->lcd_bitmap_part(bubbles_emblem,
|
||||||
0, EMBLEM_HEIGHT*bb->queue[(bb->nextinq+1)%NUM_QUEUE],
|
0, EMBLEM_HEIGHT*bb->queue[(bb->nextinq+1)%NUM_QUEUE],
|
||||||
STRIDE(BMPWIDTH_bubbles_emblem, BMPHEIGHT_bubbles_emblem),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_bubbles_emblem, BMPHEIGHT_bubbles_emblem),
|
||||||
XOFS/2-BUBBLE_WIDTH/2+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
|
XOFS/2-BUBBLE_WIDTH/2+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
|
||||||
SHOTY+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
|
SHOTY+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
|
||||||
EMBLEM_WIDTH, EMBLEM_HEIGHT);
|
EMBLEM_WIDTH, EMBLEM_HEIGHT);
|
||||||
|
@ -1484,7 +1487,8 @@ static void bubbles_drawboard(struct game_context* bb) {
|
||||||
#else
|
#else
|
||||||
rb->lcd_bitmap_part(bubbles_emblem,
|
rb->lcd_bitmap_part(bubbles_emblem,
|
||||||
0, EMBLEM_HEIGHT*bb->queue[(bb->nextinq+1)%NUM_QUEUE],
|
0, EMBLEM_HEIGHT*bb->queue[(bb->nextinq+1)%NUM_QUEUE],
|
||||||
STRIDE(BMPWIDTH_bubbles_emblem, BMPHEIGHT_bubbles_emblem),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_bubbles_emblem, BMPHEIGHT_bubbles_emblem),
|
||||||
NEXT_BB_X + NEXT_BB_WIDTH/2-BUBBLE_WIDTH/2+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
|
NEXT_BB_X + NEXT_BB_WIDTH/2-BUBBLE_WIDTH/2+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
|
||||||
NEXT_BB_Y + (BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2 + h,
|
NEXT_BB_Y + (BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2 + h,
|
||||||
EMBLEM_WIDTH, EMBLEM_HEIGHT);
|
EMBLEM_WIDTH, EMBLEM_HEIGHT);
|
||||||
|
@ -1607,7 +1611,9 @@ static int bubbles_fire(struct game_context* bb) {
|
||||||
/* display shot */
|
/* display shot */
|
||||||
bubbles_drawboard(bb);
|
bubbles_drawboard(bb);
|
||||||
rb->lcd_bitmap_part(bubbles_emblem, 0, EMBLEM_HEIGHT*bubblecur,
|
rb->lcd_bitmap_part(bubbles_emblem, 0, EMBLEM_HEIGHT*bubblecur,
|
||||||
STRIDE(BMPWIDTH_bubbles_emblem, BMPHEIGHT_bubbles_emblem),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_bubbles_emblem,
|
||||||
|
BMPHEIGHT_bubbles_emblem),
|
||||||
SHOTX+tempxofs+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
|
SHOTX+tempxofs+(BUBBLE_WIDTH-EMBLEM_WIDTH)/2,
|
||||||
SHOTY+tempyofs+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
|
SHOTY+tempyofs+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
|
||||||
EMBLEM_WIDTH, EMBLEM_HEIGHT);
|
EMBLEM_WIDTH, EMBLEM_HEIGHT);
|
||||||
|
@ -2070,7 +2076,9 @@ static int bubbles_fall(struct game_context* bb) {
|
||||||
|
|
||||||
rb->lcd_bitmap_part(bubbles_emblem, 0,
|
rb->lcd_bitmap_part(bubbles_emblem, 0,
|
||||||
EMBLEM_HEIGHT*bb->playboard[i][j].type,
|
EMBLEM_HEIGHT*bb->playboard[i][j].type,
|
||||||
STRIDE(BMPWIDTH_bubbles_emblem, BMPHEIGHT_bubbles_emblem),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_bubbles_emblem,
|
||||||
|
BMPHEIGHT_bubbles_emblem),
|
||||||
XOFS+indent+BUBBLE_WIDTH*j+
|
XOFS+indent+BUBBLE_WIDTH*j+
|
||||||
(BUBBLE_WIDTH-EMBLEM_WIDTH)/2+xofs,
|
(BUBBLE_WIDTH-EMBLEM_WIDTH)/2+xofs,
|
||||||
YOFS+ROW_HEIGHT*i+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2+
|
YOFS+ROW_HEIGHT*i+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2+
|
||||||
|
|
|
@ -134,7 +134,8 @@ static void cb_drawboard (void) {
|
||||||
if ( piece == no_piece ) {
|
if ( piece == no_piece ) {
|
||||||
rb->lcd_bitmap_part ( chessbox_pieces , 0 ,
|
rb->lcd_bitmap_part ( chessbox_pieces , 0 ,
|
||||||
TILE_HEIGHT * b_color ,
|
TILE_HEIGHT * b_color ,
|
||||||
STRIDE( BMPWIDTH_chessbox_pieces,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_chessbox_pieces,
|
||||||
BMPHEIGHT_chessbox_pieces) ,
|
BMPHEIGHT_chessbox_pieces) ,
|
||||||
XOFS + x*TILE_WIDTH ,
|
XOFS + x*TILE_WIDTH ,
|
||||||
YOFS + ( 7 - y )*TILE_HEIGHT ,
|
YOFS + ( 7 - y )*TILE_HEIGHT ,
|
||||||
|
@ -147,7 +148,8 @@ static void cb_drawboard (void) {
|
||||||
4 * TILE_HEIGHT * ( piece - 1 ) +
|
4 * TILE_HEIGHT * ( piece - 1 ) +
|
||||||
2 * TILE_HEIGHT * p_color +
|
2 * TILE_HEIGHT * p_color +
|
||||||
TILE_HEIGHT * b_color ,
|
TILE_HEIGHT * b_color ,
|
||||||
STRIDE( BMPWIDTH_chessbox_pieces,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_chessbox_pieces,
|
||||||
BMPHEIGHT_chessbox_pieces) ,
|
BMPHEIGHT_chessbox_pieces) ,
|
||||||
XOFS + x*TILE_WIDTH ,
|
XOFS + x*TILE_WIDTH ,
|
||||||
YOFS + (7 - y)*TILE_HEIGHT ,
|
YOFS + (7 - y)*TILE_HEIGHT ,
|
||||||
|
|
|
@ -46,62 +46,67 @@
|
||||||
|
|
||||||
|
|
||||||
const struct picture logos[]={
|
const struct picture logos[]={
|
||||||
{clock_logo, BMPWIDTH_clock_logo, BMPHEIGHT_clock_logo},
|
{clock_logo, BMPWIDTH_clock_logo, BMPHEIGHT_clock_logo,
|
||||||
|
BMPHEIGHT_clock_logo},
|
||||||
#if NB_SCREENS==2
|
#if NB_SCREENS==2
|
||||||
{clock_logo_remote,BMPWIDTH_clock_logo_remote,BMPHEIGHT_clock_logo_remote}
|
{clock_logo_remote,BMPWIDTH_clock_logo_remote,
|
||||||
|
BMPHEIGHT_clock_logo_remote, BMPHEIGHT_clock_logo_remote}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct picture messages[]={
|
const struct picture messages[]={
|
||||||
{clock_messages,BMPWIDTH_clock_messages,
|
{clock_messages,BMPWIDTH_clock_messages, BMPHEIGHT_clock_messages,
|
||||||
BMPHEIGHT_clock_messages/6},
|
BMPHEIGHT_clock_messages/6},
|
||||||
#if NB_SCREENS==2
|
#if NB_SCREENS==2
|
||||||
{clock_messages_remote,BMPWIDTH_clock_messages_remote,
|
{clock_messages_remote,BMPWIDTH_clock_messages_remote,
|
||||||
BMPHEIGHT_clock_messages_remote/6}
|
BMPHEIGHT_clock_messages_remote, BMPHEIGHT_clock_messages_remote/6}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct picture binary[]={
|
const struct picture binary[]={
|
||||||
{clock_binary,
|
{clock_binary, BMPWIDTH_clock_binary, BMPHEIGHT_clock_binary,
|
||||||
BMPWIDTH_clock_binary, BMPHEIGHT_clock_binary/2 },
|
BMPHEIGHT_clock_binary/2 },
|
||||||
#if NB_SCREENS==2
|
#if NB_SCREENS==2
|
||||||
{clock_binary_remote,
|
{clock_binary_remote, BMPWIDTH_clock_binary_remote,
|
||||||
BMPWIDTH_clock_binary_remote,BMPHEIGHT_clock_binary_remote/2}
|
BMPHEIGHT_clock_binary_remote, BMPHEIGHT_clock_binary_remote/2}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct picture digits[]={
|
const struct picture digits[]={
|
||||||
{clock_digits,
|
{clock_digits, BMPWIDTH_clock_digits, BMPHEIGHT_clock_digits,
|
||||||
BMPWIDTH_clock_digits, BMPHEIGHT_clock_digits/13 },
|
BMPHEIGHT_clock_digits/13 },
|
||||||
#if NB_SCREENS==2
|
#if NB_SCREENS==2
|
||||||
{clock_digits_remote,
|
{clock_digits_remote,
|
||||||
BMPWIDTH_clock_digits_remote,BMPHEIGHT_clock_digits_remote/13}
|
BMPWIDTH_clock_digits_remote, BMPHEIGHT_clock_digits_remote,
|
||||||
|
BMPHEIGHT_clock_digits_remote/13}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct picture smalldigits[]={
|
const struct picture smalldigits[]={
|
||||||
{clock_smalldigits,
|
{clock_smalldigits, BMPWIDTH_clock_smalldigits, BMPHEIGHT_clock_smalldigits,
|
||||||
BMPWIDTH_clock_smalldigits, BMPHEIGHT_clock_smalldigits/13 },
|
BMPHEIGHT_clock_smalldigits/13 },
|
||||||
#if NB_SCREENS==2
|
#if NB_SCREENS==2
|
||||||
{clock_smalldigits_remote,
|
{clock_smalldigits_remote, BMPWIDTH_clock_smalldigits_remote,
|
||||||
BMPWIDTH_clock_smalldigits_remote,BMPHEIGHT_clock_smalldigits_remote/13}
|
BMPHEIGHT_clock_smalldigits_remote,
|
||||||
|
BMPHEIGHT_clock_smalldigits_remote/13}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct picture segments[]={
|
const struct picture segments[]={
|
||||||
{clock_segments,
|
{clock_segments, BMPWIDTH_clock_segments, BMPHEIGHT_clock_segments,
|
||||||
BMPWIDTH_clock_segments, BMPHEIGHT_clock_segments/13 },
|
BMPHEIGHT_clock_segments/13 },
|
||||||
#if NB_SCREENS==2
|
#if NB_SCREENS==2
|
||||||
{clock_segments_remote,
|
{clock_segments_remote, BMPWIDTH_clock_segments_remote,
|
||||||
BMPWIDTH_clock_segments_remote,BMPHEIGHT_clock_segments_remote/13}
|
BMPHEIGHT_clock_segments_remote, BMPHEIGHT_clock_segments_remote/13}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct picture smallsegments[]={
|
const struct picture smallsegments[]={
|
||||||
{clock_smallsegments,
|
{clock_smallsegments, BMPWIDTH_clock_smallsegments,
|
||||||
BMPWIDTH_clock_smallsegments, BMPHEIGHT_clock_smallsegments/13 },
|
BMPHEIGHT_clock_smallsegments, BMPHEIGHT_clock_smallsegments/13 },
|
||||||
#if NB_SCREENS==2
|
#if NB_SCREENS==2
|
||||||
{clock_smallsegments_remote,
|
{clock_smallsegments_remote, BMPWIDTH_clock_smallsegments_remote,
|
||||||
BMPWIDTH_clock_smallsegments_remote,BMPHEIGHT_clock_smallsegments_remote/13}
|
BMPHEIGHT_clock_smallsegments_remote,
|
||||||
|
BMPHEIGHT_clock_smallsegments_remote/13}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -112,7 +112,7 @@ void color_palette_init(fb_data* palette)
|
||||||
palette[i + 224]=LCD_RGBPACK(255, 255, 224 + i);
|
palette[i + 224]=LCD_RGBPACK(255, 255, 224 + i);
|
||||||
}
|
}
|
||||||
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
|
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
|
||||||
rb->lcd_pal256_update_pal(palette);
|
rb->lcd_pal256_update_pal(palette);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -354,7 +354,8 @@ static int cursor_pos, moves;
|
||||||
static void draw_spot(int p)
|
static void draw_spot(int p)
|
||||||
{
|
{
|
||||||
rb->lcd_bitmap_part( flipit_tokens, 0, spots[p] * TK_HEIGHT,
|
rb->lcd_bitmap_part( flipit_tokens, 0, spots[p] * TK_HEIGHT,
|
||||||
STRIDE(BMPWIDTH_flipit_tokens, BMPHEIGHT_flipit_tokens),
|
STRIDE(SCREEN_MAIN, BMPWIDTH_flipit_tokens,
|
||||||
|
BMPHEIGHT_flipit_tokens),
|
||||||
GRID_LEFT + (p%5) * (TK_WIDTH+TK_SPACE),
|
GRID_LEFT + (p%5) * (TK_WIDTH+TK_SPACE),
|
||||||
GRID_TOP + (p/5) * (TK_HEIGHT+TK_SPACE),
|
GRID_TOP + (p/5) * (TK_HEIGHT+TK_SPACE),
|
||||||
TK_WIDTH, TK_HEIGHT );
|
TK_WIDTH, TK_HEIGHT );
|
||||||
|
|
|
@ -684,7 +684,8 @@ void draw_number(int x, int y, int num, int digits)
|
||||||
d = num % 10;
|
d = num % 10;
|
||||||
num = num / 10;
|
num = num / 10;
|
||||||
rb->lcd_bitmap_part(invadrox_numbers, d * NUMBERS_WIDTH, 0,
|
rb->lcd_bitmap_part(invadrox_numbers, d * NUMBERS_WIDTH, 0,
|
||||||
STRIDE( BMPWIDTH_invadrox_numbers,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_invadrox_numbers,
|
||||||
BMPHEIGHT_invadrox_numbers),
|
BMPHEIGHT_invadrox_numbers),
|
||||||
x + i * (NUMBERS_WIDTH + NUM_SPACING), y,
|
x + i * (NUMBERS_WIDTH + NUM_SPACING), y,
|
||||||
NUMBERS_WIDTH, FONT_HEIGHT);
|
NUMBERS_WIDTH, FONT_HEIGHT);
|
||||||
|
@ -715,7 +716,8 @@ void draw_lives(void)
|
||||||
int i;
|
int i;
|
||||||
/* Lives num */
|
/* Lives num */
|
||||||
rb->lcd_bitmap_part(invadrox_numbers, lives * NUMBERS_WIDTH, 0,
|
rb->lcd_bitmap_part(invadrox_numbers, lives * NUMBERS_WIDTH, 0,
|
||||||
STRIDE( BMPWIDTH_invadrox_numbers,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_invadrox_numbers,
|
||||||
BMPHEIGHT_invadrox_numbers),
|
BMPHEIGHT_invadrox_numbers),
|
||||||
PLAYFIELD_X + LIVES_X, PLAYFIELD_Y + 2,
|
PLAYFIELD_X + LIVES_X, PLAYFIELD_Y + 2,
|
||||||
NUMBERS_WIDTH, FONT_HEIGHT);
|
NUMBERS_WIDTH, FONT_HEIGHT);
|
||||||
|
@ -723,7 +725,8 @@ void draw_lives(void)
|
||||||
/* Ships */
|
/* Ships */
|
||||||
for (i = 0; i < (lives - 1); i++) {
|
for (i = 0; i < (lives - 1); i++) {
|
||||||
rb->lcd_bitmap_part(invadrox_ships, 0, 0,
|
rb->lcd_bitmap_part(invadrox_ships, 0, 0,
|
||||||
STRIDE( BMPWIDTH_invadrox_ships,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_invadrox_ships,
|
||||||
BMPHEIGHT_invadrox_ships),
|
BMPHEIGHT_invadrox_ships),
|
||||||
PLAYFIELD_X + LIVES_X + SHIP_WIDTH + i * (SHIP_WIDTH + NUM_SPACING),
|
PLAYFIELD_X + LIVES_X + SHIP_WIDTH + i * (SHIP_WIDTH + NUM_SPACING),
|
||||||
PLAYFIELD_Y + 1, SHIP_WIDTH, SHIP_HEIGHT);
|
PLAYFIELD_Y + 1, SHIP_WIDTH, SHIP_HEIGHT);
|
||||||
|
@ -747,7 +750,8 @@ inline void draw_aliens(void)
|
||||||
for (i = 0; i < 5 * ALIENS; i++) {
|
for (i = 0; i < 5 * ALIENS; i++) {
|
||||||
rb->lcd_bitmap_part(invadrox_aliens, aliens[i].x & 1 ? ALIEN_WIDTH : 0,
|
rb->lcd_bitmap_part(invadrox_aliens, aliens[i].x & 1 ? ALIEN_WIDTH : 0,
|
||||||
aliens[i].type * ALIEN_HEIGHT,
|
aliens[i].type * ALIEN_HEIGHT,
|
||||||
STRIDE( BMPWIDTH_invadrox_aliens,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_invadrox_aliens,
|
||||||
BMPHEIGHT_invadrox_aliens),
|
BMPHEIGHT_invadrox_aliens),
|
||||||
PLAYFIELD_X + LIVES_X + aliens[i].x * ALIEN_SPEED,
|
PLAYFIELD_X + LIVES_X + aliens[i].x * ALIEN_SPEED,
|
||||||
ALIEN_START_Y + aliens[i].y * ALIEN_HEIGHT,
|
ALIEN_START_Y + aliens[i].y * ALIEN_HEIGHT,
|
||||||
|
@ -888,7 +892,8 @@ bool move_aliens(void)
|
||||||
rb->lcd_bitmap_part(invadrox_aliens,
|
rb->lcd_bitmap_part(invadrox_aliens,
|
||||||
aliens[curr_alien].x & 1 ? ALIEN_WIDTH : 0,
|
aliens[curr_alien].x & 1 ? ALIEN_WIDTH : 0,
|
||||||
aliens[curr_alien].type * ALIEN_HEIGHT,
|
aliens[curr_alien].type * ALIEN_HEIGHT,
|
||||||
STRIDE( BMPWIDTH_invadrox_aliens,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_invadrox_aliens,
|
||||||
BMPHEIGHT_invadrox_aliens),
|
BMPHEIGHT_invadrox_aliens),
|
||||||
x, y, ALIEN_WIDTH, ALIEN_HEIGHT);
|
x, y, ALIEN_WIDTH, ALIEN_HEIGHT);
|
||||||
|
|
||||||
|
@ -918,7 +923,8 @@ inline void draw_ship(void)
|
||||||
|
|
||||||
/* Draw ship */
|
/* Draw ship */
|
||||||
rb->lcd_bitmap_part(invadrox_ships, 0, ship_frame * SHIP_HEIGHT,
|
rb->lcd_bitmap_part(invadrox_ships, 0, ship_frame * SHIP_HEIGHT,
|
||||||
STRIDE( BMPWIDTH_invadrox_ships,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_invadrox_ships,
|
||||||
BMPHEIGHT_invadrox_ships),
|
BMPHEIGHT_invadrox_ships),
|
||||||
ship_x, SHIP_Y, SHIP_WIDTH, SHIP_HEIGHT);
|
ship_x, SHIP_Y, SHIP_WIDTH, SHIP_HEIGHT);
|
||||||
if (ship_hit) {
|
if (ship_hit) {
|
||||||
|
@ -1160,7 +1166,8 @@ inline void draw_bomb(int i)
|
||||||
{
|
{
|
||||||
rb->lcd_bitmap_part(invadrox_bombs, bombs[i].type * BOMB_WIDTH,
|
rb->lcd_bitmap_part(invadrox_bombs, bombs[i].type * BOMB_WIDTH,
|
||||||
bombs[i].frame * BOMB_HEIGHT,
|
bombs[i].frame * BOMB_HEIGHT,
|
||||||
STRIDE( BMPWIDTH_invadrox_bombs,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_invadrox_bombs,
|
||||||
BMPHEIGHT_invadrox_bombs),
|
BMPHEIGHT_invadrox_bombs),
|
||||||
bombs[i].x, bombs[i].y,
|
bombs[i].x, bombs[i].y,
|
||||||
BOMB_WIDTH, BOMB_HEIGHT);
|
BOMB_WIDTH, BOMB_HEIGHT);
|
||||||
|
@ -1262,7 +1269,8 @@ void move_bombs(void)
|
||||||
bombs[i].state = S_EXPLODE * 4;
|
bombs[i].state = S_EXPLODE * 4;
|
||||||
bombs[i].target = TARGET_SHIP;
|
bombs[i].target = TARGET_SHIP;
|
||||||
rb->lcd_bitmap_part(invadrox_ships, 0, 1 * SHIP_HEIGHT,
|
rb->lcd_bitmap_part(invadrox_ships, 0, 1 * SHIP_HEIGHT,
|
||||||
STRIDE( BMPWIDTH_invadrox_ships,
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_invadrox_ships,
|
||||||
BMPHEIGHT_invadrox_ships),
|
BMPHEIGHT_invadrox_ships),
|
||||||
ship_x, SHIP_Y,
|
ship_x, SHIP_Y,
|
||||||
SHIP_WIDTH, SHIP_HEIGHT);
|
SHIP_WIDTH, SHIP_HEIGHT);
|
||||||
|
|
|
@ -62,9 +62,11 @@ static unsigned long char_patterns[NB_SLOTS];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const struct picture jackpot_pictures[]={
|
const struct picture jackpot_pictures[]={
|
||||||
{jackpot_slots, BMPWIDTH_jackpot_slots,PICTURE_HEIGHT},
|
{jackpot_slots, BMPWIDTH_jackpot_slots, BMPHEIGHT_jackpot_slots,
|
||||||
|
PICTURE_HEIGHT},
|
||||||
#if NB_SCREENS==2
|
#if NB_SCREENS==2
|
||||||
{jackpot_slots_remote,BMPWIDTH_jackpot_slots_remote,REMOTE_PICTURE_HEIGHT}
|
{jackpot_slots_remote,BMPWIDTH_jackpot_slots_remote,
|
||||||
|
BMPHEIGHT_jackpot_slots_remote, REMOTE_PICTURE_HEIGHT}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -172,7 +174,7 @@ void jackpot_display_slot_machine(struct jackpot* game, struct screen* display)
|
||||||
#else
|
#else
|
||||||
const struct picture* picture= &(jackpot_pictures[display->screen_type]);
|
const struct picture* picture= &(jackpot_pictures[display->screen_type]);
|
||||||
int pos_x=(display->getwidth()-NB_SLOTS*(picture->width+1))/2;
|
int pos_x=(display->getwidth()-NB_SLOTS*(picture->width+1))/2;
|
||||||
int pos_y=(display->getheight()-(picture->height))/2;
|
int pos_y=(display->getheight()-(picture->slide_height))/2;
|
||||||
#endif /* HAVE_LCD_CHARCELLS */
|
#endif /* HAVE_LCD_CHARCELLS */
|
||||||
for(i=0;i<NB_SLOTS;i++)
|
for(i=0;i<NB_SLOTS;i++)
|
||||||
{
|
{
|
||||||
|
@ -181,7 +183,7 @@ void jackpot_display_slot_machine(struct jackpot* game, struct screen* display)
|
||||||
int state_y=(game->slot_state[i]*7)/PICTURE_ROTATION_STEPS;
|
int state_y=(game->slot_state[i]*7)/PICTURE_ROTATION_STEPS;
|
||||||
#else
|
#else
|
||||||
int state_y=
|
int state_y=
|
||||||
(picture->height*game->slot_state[i])/PICTURE_ROTATION_STEPS;
|
(picture->slide_height*game->slot_state[i])/PICTURE_ROTATION_STEPS;
|
||||||
#endif /* HAVE_LCD_CHARCELLS */
|
#endif /* HAVE_LCD_CHARCELLS */
|
||||||
int previous_state_y=game->state_y[display->screen_type][i];
|
int previous_state_y=game->state_y[display->screen_type][i];
|
||||||
if(state_y==previous_state_y)
|
if(state_y==previous_state_y)
|
||||||
|
|
|
@ -512,13 +512,15 @@ static void jewels_drawboard(struct game_context* bj) {
|
||||||
TILE_WIDTH, TILE_HEIGHT);
|
TILE_WIDTH, TILE_HEIGHT);
|
||||||
rb->lcd_bitmap_transparent_part(jewels,
|
rb->lcd_bitmap_transparent_part(jewels,
|
||||||
0, TILE_HEIGHT*(bj->playboard[i+1][j].type),
|
0, TILE_HEIGHT*(bj->playboard[i+1][j].type),
|
||||||
STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
||||||
j*TILE_WIDTH, i*TILE_HEIGHT+YOFS,
|
j*TILE_WIDTH, i*TILE_HEIGHT+YOFS,
|
||||||
TILE_WIDTH, TILE_HEIGHT);
|
TILE_WIDTH, TILE_HEIGHT);
|
||||||
#else
|
#else
|
||||||
rb->lcd_bitmap_part(jewels,
|
rb->lcd_bitmap_part(jewels,
|
||||||
0, TILE_HEIGHT*(bj->playboard[i+1][j].type),
|
0, TILE_HEIGHT*(bj->playboard[i+1][j].type),
|
||||||
STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
||||||
j*TILE_WIDTH, i*TILE_HEIGHT+YOFS,
|
j*TILE_WIDTH, i*TILE_HEIGHT+YOFS,
|
||||||
TILE_WIDTH, TILE_HEIGHT);
|
TILE_WIDTH, TILE_HEIGHT);
|
||||||
#endif
|
#endif
|
||||||
|
@ -730,7 +732,9 @@ static void jewels_putjewels(struct game_context* bj){
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
rb->lcd_bitmap_transparent_part(jewels, 0,
|
rb->lcd_bitmap_transparent_part(jewels, 0,
|
||||||
TILE_HEIGHT*(bj->playboard[i][j].type),
|
TILE_HEIGHT*(bj->playboard[i][j].type),
|
||||||
STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_jewels,
|
||||||
|
BMPHEIGHT_jewels),
|
||||||
j*TILE_WIDTH,
|
j*TILE_WIDTH,
|
||||||
(i-1)*TILE_HEIGHT+YOFS+
|
(i-1)*TILE_HEIGHT+YOFS+
|
||||||
((((TILE_HEIGHT<<10)*k)/8)>>10),
|
((((TILE_HEIGHT<<10)*k)/8)>>10),
|
||||||
|
@ -738,7 +742,9 @@ static void jewels_putjewels(struct game_context* bj){
|
||||||
#else
|
#else
|
||||||
rb->lcd_bitmap_part(jewels, 0,
|
rb->lcd_bitmap_part(jewels, 0,
|
||||||
TILE_HEIGHT*(bj->playboard[i][j].type),
|
TILE_HEIGHT*(bj->playboard[i][j].type),
|
||||||
STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_jewels,
|
||||||
|
BMPHEIGHT_jewels),
|
||||||
j*TILE_WIDTH,
|
j*TILE_WIDTH,
|
||||||
(i-1)*TILE_HEIGHT+YOFS+
|
(i-1)*TILE_HEIGHT+YOFS+
|
||||||
((((TILE_HEIGHT<<10)*k)/8)>>10),
|
((((TILE_HEIGHT<<10)*k)/8)>>10),
|
||||||
|
@ -958,7 +964,8 @@ static unsigned int jewels_swapjewels(struct game_context* bj,
|
||||||
rb->lcd_bitmap_transparent_part(jewels,
|
rb->lcd_bitmap_transparent_part(jewels,
|
||||||
0, TILE_HEIGHT*(bj->playboard
|
0, TILE_HEIGHT*(bj->playboard
|
||||||
[y+1+vertmod][x+horzmod].type),
|
[y+1+vertmod][x+horzmod].type),
|
||||||
STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
||||||
(x+horzmod)*TILE_WIDTH-horzmod*
|
(x+horzmod)*TILE_WIDTH-horzmod*
|
||||||
((((movelen<<10)*k)/8)>>10),
|
((((movelen<<10)*k)/8)>>10),
|
||||||
(y+vertmod)*TILE_HEIGHT-vertmod*
|
(y+vertmod)*TILE_HEIGHT-vertmod*
|
||||||
|
@ -966,7 +973,8 @@ static unsigned int jewels_swapjewels(struct game_context* bj,
|
||||||
TILE_WIDTH, TILE_HEIGHT);
|
TILE_WIDTH, TILE_HEIGHT);
|
||||||
rb->lcd_bitmap_transparent_part(jewels,
|
rb->lcd_bitmap_transparent_part(jewels,
|
||||||
0, TILE_HEIGHT*(bj->playboard[y+1][x].type),
|
0, TILE_HEIGHT*(bj->playboard[y+1][x].type),
|
||||||
STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
||||||
x*TILE_WIDTH+horzmod*
|
x*TILE_WIDTH+horzmod*
|
||||||
((((movelen<<10)*k)/8)>>10),
|
((((movelen<<10)*k)/8)>>10),
|
||||||
y*TILE_HEIGHT+vertmod*
|
y*TILE_HEIGHT+vertmod*
|
||||||
|
@ -976,7 +984,8 @@ static unsigned int jewels_swapjewels(struct game_context* bj,
|
||||||
rb->lcd_bitmap_part(jewels,
|
rb->lcd_bitmap_part(jewels,
|
||||||
0, TILE_HEIGHT*(bj->playboard
|
0, TILE_HEIGHT*(bj->playboard
|
||||||
[y+1+vertmod][x+horzmod].type),
|
[y+1+vertmod][x+horzmod].type),
|
||||||
STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
||||||
(x+horzmod)*TILE_WIDTH-horzmod*
|
(x+horzmod)*TILE_WIDTH-horzmod*
|
||||||
((((movelen<<10)*k)/8)>>10),
|
((((movelen<<10)*k)/8)>>10),
|
||||||
(y+vertmod)*TILE_HEIGHT-vertmod*
|
(y+vertmod)*TILE_HEIGHT-vertmod*
|
||||||
|
@ -985,7 +994,8 @@ static unsigned int jewels_swapjewels(struct game_context* bj,
|
||||||
rb->lcd_set_drawmode(DRMODE_FG);
|
rb->lcd_set_drawmode(DRMODE_FG);
|
||||||
rb->lcd_bitmap_part(jewels,
|
rb->lcd_bitmap_part(jewels,
|
||||||
0, TILE_HEIGHT*(bj->playboard[y+1][x].type),
|
0, TILE_HEIGHT*(bj->playboard[y+1][x].type),
|
||||||
STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_jewels, BMPHEIGHT_jewels),
|
||||||
x*TILE_WIDTH+horzmod*
|
x*TILE_WIDTH+horzmod*
|
||||||
((((movelen<<10)*k)/8)>>10),
|
((((movelen<<10)*k)/8)>>10),
|
||||||
y*TILE_HEIGHT+vertmod*
|
y*TILE_HEIGHT+vertmod*
|
||||||
|
|
|
@ -26,15 +26,15 @@ void picture_draw(struct screen* display, const struct picture* picture,
|
||||||
display->bitmap(
|
display->bitmap(
|
||||||
picture->data,
|
picture->data,
|
||||||
x, y,
|
x, y,
|
||||||
picture->width, picture->height
|
picture->width, picture->slide_height
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a part of the given picture on the given screen
|
* Draws a part of the given picture on the given screen
|
||||||
* Use it when the data contains multiple pictures from top to bottom.
|
* Use it when the data contains multiple pictures from top to bottom.
|
||||||
* In that case, picture.height represents the height of one picture,
|
* In that case, picture.slide_height represents the height of one picture,
|
||||||
* not the whole set.
|
* not the whole set. picture.height represents the height of the whole image
|
||||||
* @param display the screen where to display the picture
|
* @param display the screen where to display the picture
|
||||||
* @param picture the picture's data, only a part will be displayed
|
* @param picture the picture's data, only a part will be displayed
|
||||||
* @param yoffset display the data in the picture from yoffset to
|
* @param yoffset display the data in the picture from yoffset to
|
||||||
|
@ -49,9 +49,9 @@ void vertical_picture_draw_part(struct screen* display, const struct picture* pi
|
||||||
picture->data,
|
picture->data,
|
||||||
/*slice into picture->data */
|
/*slice into picture->data */
|
||||||
0, yoffset,
|
0, yoffset,
|
||||||
picture->width,
|
STRIDE(display->screen_type, picture->width, picture->height),
|
||||||
/* Position on the screen */
|
/* Position on the screen */
|
||||||
x, y, picture->width, picture->height
|
x, y, picture->width, picture->slide_height
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,5 +68,6 @@ void vertical_picture_draw_part(struct screen* display, const struct picture* pi
|
||||||
void vertical_picture_draw_sprite(struct screen* display, const struct picture* picture,
|
void vertical_picture_draw_sprite(struct screen* display, const struct picture* picture,
|
||||||
int sprite_no,
|
int sprite_no,
|
||||||
int x, int y){
|
int x, int y){
|
||||||
vertical_picture_draw_part(display, picture, sprite_no*picture->height, x, y);
|
vertical_picture_draw_part( display, picture,
|
||||||
|
sprite_no*picture->slide_height, x, y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ struct picture{
|
||||||
const void* data;
|
const void* data;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
|
int slide_height;
|
||||||
};
|
};
|
||||||
|
|
||||||
void picture_draw(struct screen* display, const struct picture* picture,
|
void picture_draw(struct screen* display, const struct picture* picture,
|
||||||
|
|
|
@ -213,12 +213,14 @@ static void matrix_blit_char(const int row, const int col, int cha)
|
||||||
|
|
||||||
if (matrix[row][col].bold == 1) {
|
if (matrix[row][col].bold == 1) {
|
||||||
rb->lcd_bitmap_part(matrix_bold, cha*COL_W, 0,
|
rb->lcd_bitmap_part(matrix_bold, cha*COL_W, 0,
|
||||||
STRIDE(BMPWIDTH_matrix_bold, BMPHEIGHT_matrix_bold),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_matrix_bold, BMPHEIGHT_matrix_bold),
|
||||||
col*COL_W + LEFTMARGIN, row*COL_H + TOPMARGIN, COL_W, COL_H);
|
col*COL_W + LEFTMARGIN, row*COL_H + TOPMARGIN, COL_W, COL_H);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rb->lcd_bitmap_part(matrix_normal, cha*COL_W, 0,
|
rb->lcd_bitmap_part(matrix_normal, cha*COL_W, 0,
|
||||||
STRIDE(BMPWIDTH_matrix_normal, BMPHEIGHT_matrix_normal),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_matrix_normal, BMPHEIGHT_matrix_normal),
|
||||||
col*COL_W + LEFTMARGIN, row*COL_H + TOPMARGIN, COL_W, COL_H);
|
col*COL_W + LEFTMARGIN, row*COL_H + TOPMARGIN, COL_W, COL_H);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -747,7 +747,8 @@ static void pegbox_draw_board(struct game_context* pb)
|
||||||
|
|
||||||
if(type != SPACE) {
|
if(type != SPACE) {
|
||||||
rb->lcd_bitmap_part(pegbox_pieces, 0, (type-1)*PIECE_HEIGHT,
|
rb->lcd_bitmap_part(pegbox_pieces, 0, (type-1)*PIECE_HEIGHT,
|
||||||
STRIDE(BMPWIDTH_pegbox_pieces,BMPHEIGHT_pegbox_pieces),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_pegbox_pieces,BMPHEIGHT_pegbox_pieces),
|
||||||
c * PIECE_WIDTH + BOARD_X,
|
c * PIECE_WIDTH + BOARD_X,
|
||||||
r * PIECE_HEIGHT + BOARD_Y, PIECE_WIDTH,
|
r * PIECE_HEIGHT + BOARD_Y, PIECE_WIDTH,
|
||||||
PIECE_HEIGHT);
|
PIECE_HEIGHT);
|
||||||
|
|
|
@ -407,7 +407,8 @@ static void draw_spot(int p, int x, int y)
|
||||||
an appropriate hole graphic */
|
an appropriate hole graphic */
|
||||||
rb->lcd_bitmap_part(sliding_puzzle, ((p-1)%SPOTS_X)*SPOTS_WIDTH,
|
rb->lcd_bitmap_part(sliding_puzzle, ((p-1)%SPOTS_X)*SPOTS_WIDTH,
|
||||||
((p-1)/SPOTS_X)*SPOTS_HEIGHT,
|
((p-1)/SPOTS_X)*SPOTS_HEIGHT,
|
||||||
STRIDE(BMPWIDTH_sliding_puzzle, BMPHEIGHT_sliding_puzzle),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_sliding_puzzle, BMPHEIGHT_sliding_puzzle),
|
||||||
x, y, SPOTS_WIDTH, SPOTS_HEIGHT);
|
x, y, SPOTS_WIDTH, SPOTS_HEIGHT);
|
||||||
#else
|
#else
|
||||||
/* just draw a black rectangle */
|
/* just draw a black rectangle */
|
||||||
|
@ -421,7 +422,8 @@ static void draw_spot(int p, int x, int y)
|
||||||
{
|
{
|
||||||
rb->lcd_bitmap_part( puzzle_bmp_ptr, ((p-1)%SPOTS_X)*SPOTS_WIDTH,
|
rb->lcd_bitmap_part( puzzle_bmp_ptr, ((p-1)%SPOTS_X)*SPOTS_WIDTH,
|
||||||
((p-1)/SPOTS_X)*SPOTS_HEIGHT,
|
((p-1)/SPOTS_X)*SPOTS_HEIGHT,
|
||||||
STRIDE(BMPWIDTH_sliding_puzzle, BMPHEIGHT_sliding_puzzle),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_sliding_puzzle, BMPHEIGHT_sliding_puzzle),
|
||||||
x, y, SPOTS_WIDTH, SPOTS_HEIGHT);
|
x, y, SPOTS_WIDTH, SPOTS_HEIGHT);
|
||||||
} else {
|
} else {
|
||||||
rb->lcd_drawrect(x, y, SPOTS_WIDTH, SPOTS_HEIGHT);
|
rb->lcd_drawrect(x, y, SPOTS_WIDTH, SPOTS_HEIGHT);
|
||||||
|
|
|
@ -982,43 +982,57 @@ static void update_screen(void)
|
||||||
|
|
||||||
case ' ': /* floor */
|
case ' ': /* floor */
|
||||||
rb->lcd_bitmap_part(sokoban_tiles, 0, 0*SOKOBAN_TILESIZE,
|
rb->lcd_bitmap_part(sokoban_tiles, 0, 0*SOKOBAN_TILESIZE,
|
||||||
STRIDE(BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_sokoban_tiles,
|
||||||
|
BMPHEIGHT_sokoban_tiles),
|
||||||
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '#': /* wall */
|
case '#': /* wall */
|
||||||
rb->lcd_bitmap_part(sokoban_tiles, 0, 1*SOKOBAN_TILESIZE,
|
rb->lcd_bitmap_part(sokoban_tiles, 0, 1*SOKOBAN_TILESIZE,
|
||||||
STRIDE(BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_sokoban_tiles,
|
||||||
|
BMPHEIGHT_sokoban_tiles),
|
||||||
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '$': /* box */
|
case '$': /* box */
|
||||||
rb->lcd_bitmap_part(sokoban_tiles, 0, 2*SOKOBAN_TILESIZE,
|
rb->lcd_bitmap_part(sokoban_tiles, 0, 2*SOKOBAN_TILESIZE,
|
||||||
STRIDE(BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_sokoban_tiles,
|
||||||
|
BMPHEIGHT_sokoban_tiles),
|
||||||
c, r, SOKOBAN_TILESIZE,SOKOBAN_TILESIZE);
|
c, r, SOKOBAN_TILESIZE,SOKOBAN_TILESIZE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '*': /* box on goal */
|
case '*': /* box on goal */
|
||||||
rb->lcd_bitmap_part(sokoban_tiles, 0, 3*SOKOBAN_TILESIZE,
|
rb->lcd_bitmap_part(sokoban_tiles, 0, 3*SOKOBAN_TILESIZE,
|
||||||
STRIDE(BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_sokoban_tiles,
|
||||||
|
BMPHEIGHT_sokoban_tiles),
|
||||||
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '.': /* goal */
|
case '.': /* goal */
|
||||||
rb->lcd_bitmap_part(sokoban_tiles, 0, 4*SOKOBAN_TILESIZE,
|
rb->lcd_bitmap_part(sokoban_tiles, 0, 4*SOKOBAN_TILESIZE,
|
||||||
STRIDE(BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_sokoban_tiles,
|
||||||
|
BMPHEIGHT_sokoban_tiles),
|
||||||
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '@': /* player */
|
case '@': /* player */
|
||||||
rb->lcd_bitmap_part(sokoban_tiles, 0, 5*SOKOBAN_TILESIZE,
|
rb->lcd_bitmap_part(sokoban_tiles, 0, 5*SOKOBAN_TILESIZE,
|
||||||
STRIDE(BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_sokoban_tiles,
|
||||||
|
BMPHEIGHT_sokoban_tiles),
|
||||||
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '+': /* player on goal */
|
case '+': /* player on goal */
|
||||||
rb->lcd_bitmap_part(sokoban_tiles, 0, 6*SOKOBAN_TILESIZE,
|
rb->lcd_bitmap_part(sokoban_tiles, 0, 6*SOKOBAN_TILESIZE,
|
||||||
STRIDE(BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_sokoban_tiles,
|
||||||
|
BMPHEIGHT_sokoban_tiles),
|
||||||
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -623,7 +623,8 @@ static void draw_card( card_t *card, int x, int y,
|
||||||
{
|
{
|
||||||
rb->lcd_bitmap_part( card_deck, CARD_GFX_WIDTH * card->num,
|
rb->lcd_bitmap_part( card_deck, CARD_GFX_WIDTH * card->num,
|
||||||
CARD_GFX_HEIGHT * card->suit,
|
CARD_GFX_HEIGHT * card->suit,
|
||||||
STRIDE(BMPWIDTH_card_deck, BMPHEIGHT_card_deck),
|
STRIDE(SCREEN_MAIN,
|
||||||
|
BMPWIDTH_card_deck, BMPHEIGHT_card_deck),
|
||||||
x+1, y+1, CARD_GFX_WIDTH, CARD_GFX_HEIGHT );
|
x+1, y+1, CARD_GFX_WIDTH, CARD_GFX_HEIGHT );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -639,7 +640,8 @@ static void draw_empty_stack( int s, int x, int y, bool cursor )
|
||||||
{
|
{
|
||||||
rb->lcd_bitmap_part( solitaire_suitsi, 0,
|
rb->lcd_bitmap_part( solitaire_suitsi, 0,
|
||||||
CARD_GFX_HEIGHT * s,
|
CARD_GFX_HEIGHT * s,
|
||||||
STRIDE(BMPWIDTH_solitaire_suitsi, BMPHEIGHT_solitaire_suitsi),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
BMPWIDTH_solitaire_suitsi, BMPHEIGHT_solitaire_suitsi),
|
||||||
x+1, y+1, CARD_GFX_WIDTH, CARD_GFX_HEIGHT );
|
x+1, y+1, CARD_GFX_WIDTH, CARD_GFX_HEIGHT );
|
||||||
|
|
||||||
draw_card_ext( x, y, false, cursor );
|
draw_card_ext( x, y, false, cursor );
|
||||||
|
|
|
@ -729,7 +729,8 @@ static void star_display_board_info(int current_level)
|
||||||
|
|
||||||
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,
|
BALL*TILE_HEIGHT : BLOCK*TILE_HEIGHT,
|
||||||
STRIDE(BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
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);
|
||||||
|
|
||||||
|
@ -768,7 +769,8 @@ 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, \
|
a*TILE_HEIGHT, \
|
||||||
STRIDE( BMPWIDTH_star_tiles, \
|
STRIDE( SCREEN_MAIN, \
|
||||||
|
BMPWIDTH_star_tiles, \
|
||||||
BMPHEIGHT_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, \
|
||||||
|
@ -820,10 +822,12 @@ static void star_animate_tile(int tile_no, int start_x, int start_y,
|
||||||
{
|
{
|
||||||
STAR_SLEEP
|
STAR_SLEEP
|
||||||
rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT,
|
rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT,
|
||||||
STRIDE(BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
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,
|
rb->lcd_bitmap_part(star_tiles, 0, tile_no * TILE_HEIGHT,
|
||||||
STRIDE(BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
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);
|
||||||
|
@ -835,10 +839,12 @@ static void star_animate_tile(int tile_no, int start_x, int start_y,
|
||||||
{
|
{
|
||||||
STAR_SLEEP
|
STAR_SLEEP
|
||||||
rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT,
|
rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT,
|
||||||
STRIDE(BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
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,
|
rb->lcd_bitmap_part(star_tiles, 0, tile_no * TILE_HEIGHT,
|
||||||
STRIDE(BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles),
|
STRIDE( SCREEN_MAIN,
|
||||||
|
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);
|
||||||
|
|
|
@ -73,7 +73,7 @@ Example ".ss" file, and one with a saved state:
|
||||||
#include "pluginbitmaps/sudoku_start.h"
|
#include "pluginbitmaps/sudoku_start.h"
|
||||||
|
|
||||||
#define BITMAP_HEIGHT (BMPHEIGHT_sudoku_normal/10)
|
#define BITMAP_HEIGHT (BMPHEIGHT_sudoku_normal/10)
|
||||||
#define BITMAP_STRIDE STRIDE(BMPWIDTH_sudoku_normal, BMPHEIGHT_sudoku_normal)
|
#define BITMAP_STRIDE STRIDE(SCREEN_MAIN, BMPWIDTH_sudoku_normal, BMPHEIGHT_sudoku_normal)
|
||||||
|
|
||||||
#if (LCD_DEPTH>2)
|
#if (LCD_DEPTH>2)
|
||||||
#define BITMAP_WIDTH (BMPWIDTH_sudoku_normal/2)
|
#define BITMAP_WIDTH (BMPWIDTH_sudoku_normal/2)
|
||||||
|
|
|
@ -62,7 +62,7 @@ char buf[255];
|
||||||
/* These parameters define the piece image dimensions, Stride is the total width
|
/* These parameters define the piece image dimensions, Stride is the total width
|
||||||
* of the bitmap.
|
* of the bitmap.
|
||||||
*/
|
*/
|
||||||
#define ICON_STRIDE STRIDE(BMPWIDTH_superdom_boarditems, BMPHEIGHT_superdom_boarditems)
|
#define ICON_STRIDE STRIDE(SCREEN_MAIN, BMPWIDTH_superdom_boarditems, BMPHEIGHT_superdom_boarditems)
|
||||||
#define ICON_HEIGHT (BMPHEIGHT_superdom_boarditems/6)
|
#define ICON_HEIGHT (BMPHEIGHT_superdom_boarditems/6)
|
||||||
#define ICON_WIDTH (BMPWIDTH_superdom_boarditems/2)
|
#define ICON_WIDTH (BMPWIDTH_superdom_boarditems/2)
|
||||||
|
|
||||||
|
|
|
@ -351,7 +351,9 @@ void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear)
|
||||||
if (!clear)
|
if (!clear)
|
||||||
{
|
{
|
||||||
/* Draw the bitmap */
|
/* Draw the bitmap */
|
||||||
gwps->display->bitmap_part((fb_data*)bmp->data, 0, 0, bmp->width,
|
gwps->display->bitmap_part((fb_data*)bmp->data, 0, 0,
|
||||||
|
STRIDE(gwps->display->screen_type,
|
||||||
|
bmp->width, bmp->height),
|
||||||
x, y, width, height);
|
x, y, width, height);
|
||||||
#ifdef HAVE_LCD_INVERT
|
#ifdef HAVE_LCD_INVERT
|
||||||
if (global_settings.invert) {
|
if (global_settings.invert) {
|
||||||
|
|
|
@ -425,6 +425,7 @@ void output_row_8_native(uint32_t row, void * row_in,
|
||||||
#elif LCD_DEPTH == 16
|
#elif LCD_DEPTH == 16
|
||||||
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
||||||
/* M:Robe 500 */
|
/* M:Robe 500 */
|
||||||
|
(void) fb_width;
|
||||||
fb_data *dest = (fb_data *)ctx->bm->data + row;
|
fb_data *dest = (fb_data *)ctx->bm->data + row;
|
||||||
int delta = 127;
|
int delta = 127;
|
||||||
unsigned r, g, b;
|
unsigned r, g, b;
|
||||||
|
|
|
@ -26,13 +26,6 @@
|
||||||
#include "buttonbar.h"
|
#include "buttonbar.h"
|
||||||
#include "backdrop.h"
|
#include "backdrop.h"
|
||||||
|
|
||||||
enum screen_type {
|
|
||||||
SCREEN_MAIN
|
|
||||||
#ifdef HAVE_REMOTE_LCD
|
|
||||||
,SCREEN_REMOTE
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && !defined (ROCKBOX_HAS_LOGF)
|
#if defined(HAVE_REMOTE_LCD) && !defined (ROCKBOX_HAS_LOGF)
|
||||||
#define NB_SCREENS 2
|
#define NB_SCREENS 2
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -69,7 +69,7 @@ static struct viewport default_vp =
|
||||||
|
|
||||||
/* The Gigabeat target build requires access to the current fg_pattern
|
/* The Gigabeat target build requires access to the current fg_pattern
|
||||||
in lcd-meg-fx.c */
|
in lcd-meg-fx.c */
|
||||||
#if (!defined(TOSHIBA_GIGABEAT_F)&& !defined(TOSHIBA_GIGABEAT_S)) || defined(SIMULATOR)
|
#if defined(SIMULATOR)
|
||||||
static struct viewport* current_vp IDATA_ATTR = &default_vp;
|
static struct viewport* current_vp IDATA_ATTR = &default_vp;
|
||||||
#else
|
#else
|
||||||
struct viewport* current_vp IDATA_ATTR = &default_vp;
|
struct viewport* current_vp IDATA_ATTR = &default_vp;
|
||||||
|
@ -853,7 +853,7 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
|
||||||
/* Draw a full native bitmap */
|
/* Draw a full native bitmap */
|
||||||
void lcd_bitmap(const fb_data *src, int x, int y, int width, int height)
|
void lcd_bitmap(const fb_data *src, int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
lcd_bitmap_part(src, 0, 0, STRIDE(width, height), x, y, width, height);
|
lcd_bitmap_part(src, 0, 0, STRIDE(SCREEN_MAIN, width, height), x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(TOSHIBA_GIGABEAT_F) && !defined(TOSHIBA_GIGABEAT_S) \
|
#if !defined(TOSHIBA_GIGABEAT_F) && !defined(TOSHIBA_GIGABEAT_S) \
|
||||||
|
@ -914,7 +914,7 @@ void lcd_bitmap_transparent(const fb_data *src, int x, int y,
|
||||||
int width, int height)
|
int width, int height)
|
||||||
{
|
{
|
||||||
lcd_bitmap_transparent_part(src, 0, 0,
|
lcd_bitmap_transparent_part(src, 0, 0,
|
||||||
STRIDE(width, height), x, y, width, height);
|
STRIDE(SCREEN_MAIN, width, height), x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "lcd-bitmap-common.c"
|
#include "lcd-bitmap-common.c"
|
||||||
|
|
|
@ -306,12 +306,24 @@ static inline unsigned lcd_color_to_native(unsigned color)
|
||||||
|
|
||||||
#endif /* HAVE_LCD_COLOR */
|
#endif /* HAVE_LCD_COLOR */
|
||||||
|
|
||||||
/* Frame buffer stride */
|
enum screen_type {
|
||||||
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
SCREEN_MAIN
|
||||||
#define STRIDE(w, h) (h)
|
#ifdef HAVE_REMOTE_LCD
|
||||||
#else
|
,SCREEN_REMOTE
|
||||||
#define STRIDE(w, h) (w)
|
|
||||||
#endif
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Frame buffer stride */
|
||||||
|
#define STRIDE_REMOTE(w, h) (w)
|
||||||
|
|
||||||
|
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
||||||
|
#define STRIDE_MAIN(w, h) (h)
|
||||||
|
#else
|
||||||
|
#define STRIDE_MAIN(w, h) (w)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define STRIDE(screen, w, h) (screen==SCREEN_MAIN?STRIDE_MAIN((w), \
|
||||||
|
(h)):STRIDE_REMOTE((w),(h)))
|
||||||
|
|
||||||
/* Frame buffer dimensions */
|
/* Frame buffer dimensions */
|
||||||
#if LCD_DEPTH == 1
|
#if LCD_DEPTH == 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue