summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-09-04 00:46:24 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-09-04 00:46:24 +0000
commit25123570c76f2055d3ae05d79741038c0e23c536 (patch)
treea2edd8351a611b9cef0aef08c880a994d9e1d75e
parentf6025186fd1f6d9083c07568bc3d160f3e8774f8 (diff)
downloadrockbox-25123570c76f2055d3ae05d79741038c0e23c536.tar.gz
rockbox-25123570c76f2055d3ae05d79741038c0e23c536.tar.bz2
rockbox-25123570c76f2055d3ae05d79741038c0e23c536.zip
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
-rw-r--r--apps/gui/icon.c7
-rw-r--r--apps/gui/scrollbar.c6
-rw-r--r--apps/gui/skin_engine/skin_display.c3
-rw-r--r--apps/plugins/blackjack.c3
-rw-r--r--apps/plugins/brickmania.c16
-rw-r--r--apps/plugins/bubbles.c20
-rw-r--r--apps/plugins/chessbox/chessbox.c6
-rw-r--r--apps/plugins/clock/clock_bitmaps.c55
-rw-r--r--apps/plugins/fire.c2
-rw-r--r--apps/plugins/flipit.c3
-rw-r--r--apps/plugins/invadrox.c24
-rw-r--r--apps/plugins/jackpot.c10
-rw-r--r--apps/plugins/jewels.c26
-rw-r--r--apps/plugins/lib/picture.c13
-rw-r--r--apps/plugins/lib/picture.h1
-rw-r--r--apps/plugins/matrix.c6
-rw-r--r--apps/plugins/pegbox.c3
-rw-r--r--apps/plugins/sliding_puzzle.c6
-rw-r--r--apps/plugins/sokoban.c28
-rw-r--r--apps/plugins/solitaire.c6
-rw-r--r--apps/plugins/star.c18
-rw-r--r--apps/plugins/sudoku/sudoku.c2
-rw-r--r--apps/plugins/superdom.c2
-rw-r--r--apps/recorder/albumart.c4
-rw-r--r--apps/recorder/bmp.c1
-rw-r--r--apps/screen_access.h7
-rw-r--r--firmware/drivers/lcd-16bit-vert.c6
-rw-r--r--firmware/export/lcd.h16
28 files changed, 191 insertions, 109 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index 74af4a0d90..53cfd87774 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -144,19 +144,20 @@ void screen_put_iconxy(struct screen * display,
return;
}
data = viewer_iconset[screen].data;
- stride = STRIDE( viewer_iconset[screen].width,
+ stride = STRIDE( display->screen_type, viewer_iconset[screen].width,
viewer_iconset[screen].height);
}
else if (custom_icons_loaded[screen])
{
data = user_iconset[screen].data;
- stride = STRIDE( user_iconset[screen].width,
+ stride = STRIDE( display->screen_type, user_iconset[screen].width,
user_iconset[screen].height);
}
else
{
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 */
if (xpos == 0)
diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c
index 193bb4b65a..2e807002f0 100644
--- a/apps/gui/scrollbar.c
+++ b/apps/gui/scrollbar.c
@@ -202,7 +202,8 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x,
#if LCD_DEPTH > 1
else
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);
#endif
} else {
@@ -214,7 +215,8 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x,
#if LCD_DEPTH > 1
else
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);
#endif
}
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 0a43a19b90..01f8b13acb 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -232,7 +232,8 @@ static void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subima
} else {
display->transparent_bitmap_part((fb_data *)img->bm.data,
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->subimage_height);
}
diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c
index ec1bd46ce9..e00b209c9d 100644
--- a/apps/plugins/blackjack.c
+++ b/apps/plugins/blackjack.c
@@ -607,7 +607,8 @@ static void draw_card(struct card temp_card, bool shown,
if(shown)
rb->lcd_bitmap_part(card_deck, CARD_WIDTH*temp_card.num,
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);
else
rb->lcd_bitmap(card_back, x+1, y+1,CARD_WIDTH, CARD_HEIGHT);
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index bc606d6a24..82a883c7a4 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -1081,7 +1081,8 @@ static int brickmania_game_loop(void)
brick[i*10+j].powertop+=SPEED_POWER;
rb->lcd_bitmap_part(brickmania_powerups,0,
POWERUP_HEIGHT*brick[i*10+j].power,
- STRIDE( BMPWIDTH_brickmania_powerups,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_brickmania_powerups,
BMPHEIGHT_brickmania_powerups),
LEFTMARGIN+j*BRICK_WIDTH+
(BRICK_WIDTH/2-POWERUP_WIDTH/2),
@@ -1205,7 +1206,8 @@ static int brickmania_game_loop(void)
if (brick[i*10+j].used==1) {
rb->lcd_bitmap_part(brickmania_bricks,0,
BRICK_HEIGHT*brick[i*10+j].color,
- STRIDE( BMPWIDTH_brickmania_bricks,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_brickmania_bricks,
BMPHEIGHT_brickmania_bricks),
LEFTMARGIN+j*BRICK_WIDTH,
TOPMARGIN+i*BRICK_HEIGHT,
@@ -1214,7 +1216,8 @@ static int brickmania_game_loop(void)
if (brick[i*10+j].hiteffect>0)
rb->lcd_bitmap_transparent_part(brickmania_break,0,
BRICK_HEIGHT*brick[i*10+j].hiteffect,
- STRIDE( BMPWIDTH_brickmania_break,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_brickmania_break,
BMPHEIGHT_brickmania_break),
LEFTMARGIN+j*BRICK_WIDTH,
TOPMARGIN+i*BRICK_HEIGHT,
@@ -1377,7 +1380,8 @@ static int brickmania_game_loop(void)
rb->lcd_bitmap_part(
brickmania_pads,
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);
}
else if( pad_width == LONG_PAD_WIDTH ) /* Long Pad */
@@ -1385,7 +1389,7 @@ static int brickmania_game_loop(void)
rb->lcd_bitmap_part(
brickmania_long_pads,
0,pad_type*PAD_HEIGHT,
- STRIDE( BMPWIDTH_brickmania_long_pads,
+ STRIDE( SCREEN_MAIN, BMPWIDTH_brickmania_long_pads,
BMPHEIGHT_brickmania_long_pads),
pad_pos_x, PAD_POS_Y, pad_width, PAD_HEIGHT);
}
@@ -1394,7 +1398,7 @@ static int brickmania_game_loop(void)
rb->lcd_bitmap_part(
brickmania_short_pads,
0,pad_type*PAD_HEIGHT,
- STRIDE( BMPWIDTH_brickmania_short_pads,
+ STRIDE( SCREEN_MAIN, BMPWIDTH_brickmania_short_pads,
BMPHEIGHT_brickmania_short_pads),
pad_pos_x, PAD_POS_Y, pad_width, PAD_HEIGHT);
}
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c
index e8618e95bb..da927de01c 100644
--- a/apps/plugins/bubbles.c
+++ b/apps/plugins/bubbles.c
@@ -1441,7 +1441,8 @@ static void bubbles_drawboard(struct game_context* bb) {
if(bb->playboard[i][j].type >= 0 && !bb->playboard[i][j].delete) {
rb->lcd_bitmap_part(bubbles_emblem,
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,
YOFS+ROW_HEIGHT*i+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2+bb->compress*ROW_HEIGHT,
EMBLEM_WIDTH, EMBLEM_HEIGHT);
@@ -1458,7 +1459,8 @@ static void bubbles_drawboard(struct game_context* bb) {
/* display bubble to be shot */
rb->lcd_bitmap_part(bubbles_emblem,
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,
SHOTY+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
EMBLEM_WIDTH, EMBLEM_HEIGHT);
@@ -1472,7 +1474,8 @@ static void bubbles_drawboard(struct game_context* bb) {
#ifndef NEXT_BB_X
rb->lcd_bitmap_part(bubbles_emblem,
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,
SHOTY+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
EMBLEM_WIDTH, EMBLEM_HEIGHT);
@@ -1484,7 +1487,8 @@ static void bubbles_drawboard(struct game_context* bb) {
#else
rb->lcd_bitmap_part(bubbles_emblem,
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_Y + (BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2 + h,
EMBLEM_WIDTH, EMBLEM_HEIGHT);
@@ -1607,7 +1611,9 @@ static int bubbles_fire(struct game_context* bb) {
/* display shot */
bubbles_drawboard(bb);
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,
SHOTY+tempyofs+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2,
EMBLEM_WIDTH, EMBLEM_HEIGHT);
@@ -2070,7 +2076,9 @@ static int bubbles_fall(struct game_context* bb) {
rb->lcd_bitmap_part(bubbles_emblem, 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,
YOFS+ROW_HEIGHT*i+(BUBBLE_HEIGHT-EMBLEM_HEIGHT)/2+
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c
index 0369eda174..72a8b238a8 100644
--- a/apps/plugins/chessbox/chessbox.c
+++ b/apps/plugins/chessbox/chessbox.c
@@ -134,7 +134,8 @@ static void cb_drawboard (void) {
if ( piece == no_piece ) {
rb->lcd_bitmap_part ( chessbox_pieces , 0 ,
TILE_HEIGHT * b_color ,
- STRIDE( BMPWIDTH_chessbox_pieces,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_chessbox_pieces,
BMPHEIGHT_chessbox_pieces) ,
XOFS + x*TILE_WIDTH ,
YOFS + ( 7 - y )*TILE_HEIGHT ,
@@ -147,7 +148,8 @@ static void cb_drawboard (void) {
4 * TILE_HEIGHT * ( piece - 1 ) +
2 * TILE_HEIGHT * p_color +
TILE_HEIGHT * b_color ,
- STRIDE( BMPWIDTH_chessbox_pieces,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_chessbox_pieces,
BMPHEIGHT_chessbox_pieces) ,
XOFS + x*TILE_WIDTH ,
YOFS + (7 - y)*TILE_HEIGHT ,
diff --git a/apps/plugins/clock/clock_bitmaps.c b/apps/plugins/clock/clock_bitmaps.c
index 4ab6bf4f9a..50c31806bc 100644
--- a/apps/plugins/clock/clock_bitmaps.c
+++ b/apps/plugins/clock/clock_bitmaps.c
@@ -46,62 +46,67 @@
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
- {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
};
const struct picture messages[]={
- {clock_messages,BMPWIDTH_clock_messages,
- BMPHEIGHT_clock_messages/6},
+ {clock_messages,BMPWIDTH_clock_messages, BMPHEIGHT_clock_messages,
+ BMPHEIGHT_clock_messages/6},
#if NB_SCREENS==2
- {clock_messages_remote,BMPWIDTH_clock_messages_remote,
- BMPHEIGHT_clock_messages_remote/6}
+ {clock_messages_remote,BMPWIDTH_clock_messages_remote,
+ BMPHEIGHT_clock_messages_remote, BMPHEIGHT_clock_messages_remote/6}
#endif
};
const struct picture binary[]={
- {clock_binary,
- BMPWIDTH_clock_binary, BMPHEIGHT_clock_binary/2 },
+ {clock_binary, BMPWIDTH_clock_binary, BMPHEIGHT_clock_binary,
+ BMPHEIGHT_clock_binary/2 },
#if NB_SCREENS==2
- {clock_binary_remote,
- BMPWIDTH_clock_binary_remote,BMPHEIGHT_clock_binary_remote/2}
+ {clock_binary_remote, BMPWIDTH_clock_binary_remote,
+ BMPHEIGHT_clock_binary_remote, BMPHEIGHT_clock_binary_remote/2}
#endif
};
const struct picture digits[]={
- {clock_digits,
- BMPWIDTH_clock_digits, BMPHEIGHT_clock_digits/13 },
+ {clock_digits, BMPWIDTH_clock_digits, BMPHEIGHT_clock_digits,
+ BMPHEIGHT_clock_digits/13 },
#if NB_SCREENS==2
{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
};
const struct picture smalldigits[]={
- {clock_smalldigits,
- BMPWIDTH_clock_smalldigits, BMPHEIGHT_clock_smalldigits/13 },
+ {clock_smalldigits, BMPWIDTH_clock_smalldigits, BMPHEIGHT_clock_smalldigits,
+ BMPHEIGHT_clock_smalldigits/13 },
#if NB_SCREENS==2
- {clock_smalldigits_remote,
- BMPWIDTH_clock_smalldigits_remote,BMPHEIGHT_clock_smalldigits_remote/13}
+ {clock_smalldigits_remote, BMPWIDTH_clock_smalldigits_remote,
+ BMPHEIGHT_clock_smalldigits_remote,
+ BMPHEIGHT_clock_smalldigits_remote/13}
#endif
};
const struct picture segments[]={
- {clock_segments,
- BMPWIDTH_clock_segments, BMPHEIGHT_clock_segments/13 },
+ {clock_segments, BMPWIDTH_clock_segments, BMPHEIGHT_clock_segments,
+ BMPHEIGHT_clock_segments/13 },
#if NB_SCREENS==2
- {clock_segments_remote,
- BMPWIDTH_clock_segments_remote,BMPHEIGHT_clock_segments_remote/13}
+ {clock_segments_remote, BMPWIDTH_clock_segments_remote,
+ BMPHEIGHT_clock_segments_remote, BMPHEIGHT_clock_segments_remote/13}
#endif
};
const struct picture smallsegments[]={
- {clock_smallsegments,
- BMPWIDTH_clock_smallsegments, BMPHEIGHT_clock_smallsegments/13 },
+ {clock_smallsegments, BMPWIDTH_clock_smallsegments,
+ BMPHEIGHT_clock_smallsegments, BMPHEIGHT_clock_smallsegments/13 },
#if NB_SCREENS==2
- {clock_smallsegments_remote,
- BMPWIDTH_clock_smallsegments_remote,BMPHEIGHT_clock_smallsegments_remote/13}
+ {clock_smallsegments_remote, BMPWIDTH_clock_smallsegments_remote,
+ BMPHEIGHT_clock_smallsegments_remote,
+ BMPHEIGHT_clock_smallsegments_remote/13}
#endif
};
diff --git a/apps/plugins/fire.c b/apps/plugins/fire.c
index 201d18970f..fff39b38c9 100644
--- a/apps/plugins/fire.c
+++ b/apps/plugins/fire.c
@@ -112,7 +112,7 @@ void color_palette_init(fb_data* palette)
palette[i + 224]=LCD_RGBPACK(255, 255, 224 + i);
}
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
- rb->lcd_pal256_update_pal(palette);
+ rb->lcd_pal256_update_pal(palette);
#endif
}
diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c
index 49fb5344ec..63260a4882 100644
--- a/apps/plugins/flipit.c
+++ b/apps/plugins/flipit.c
@@ -354,7 +354,8 @@ static int cursor_pos, moves;
static void draw_spot(int p)
{
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_TOP + (p/5) * (TK_HEIGHT+TK_SPACE),
TK_WIDTH, TK_HEIGHT );
diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c
index 33ec343a87..1886ed4b49 100644
--- a/apps/plugins/invadrox.c
+++ b/apps/plugins/invadrox.c
@@ -684,7 +684,8 @@ void draw_number(int x, int y, int num, int digits)
d = num % 10;
num = num / 10;
rb->lcd_bitmap_part(invadrox_numbers, d * NUMBERS_WIDTH, 0,
- STRIDE( BMPWIDTH_invadrox_numbers,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_numbers,
BMPHEIGHT_invadrox_numbers),
x + i * (NUMBERS_WIDTH + NUM_SPACING), y,
NUMBERS_WIDTH, FONT_HEIGHT);
@@ -715,7 +716,8 @@ void draw_lives(void)
int i;
/* Lives num */
rb->lcd_bitmap_part(invadrox_numbers, lives * NUMBERS_WIDTH, 0,
- STRIDE( BMPWIDTH_invadrox_numbers,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_numbers,
BMPHEIGHT_invadrox_numbers),
PLAYFIELD_X + LIVES_X, PLAYFIELD_Y + 2,
NUMBERS_WIDTH, FONT_HEIGHT);
@@ -723,7 +725,8 @@ void draw_lives(void)
/* Ships */
for (i = 0; i < (lives - 1); i++) {
rb->lcd_bitmap_part(invadrox_ships, 0, 0,
- STRIDE( BMPWIDTH_invadrox_ships,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_ships,
BMPHEIGHT_invadrox_ships),
PLAYFIELD_X + LIVES_X + SHIP_WIDTH + i * (SHIP_WIDTH + NUM_SPACING),
PLAYFIELD_Y + 1, SHIP_WIDTH, SHIP_HEIGHT);
@@ -747,7 +750,8 @@ inline void draw_aliens(void)
for (i = 0; i < 5 * ALIENS; i++) {
rb->lcd_bitmap_part(invadrox_aliens, aliens[i].x & 1 ? ALIEN_WIDTH : 0,
aliens[i].type * ALIEN_HEIGHT,
- STRIDE( BMPWIDTH_invadrox_aliens,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_aliens,
BMPHEIGHT_invadrox_aliens),
PLAYFIELD_X + LIVES_X + aliens[i].x * ALIEN_SPEED,
ALIEN_START_Y + aliens[i].y * ALIEN_HEIGHT,
@@ -888,7 +892,8 @@ bool move_aliens(void)
rb->lcd_bitmap_part(invadrox_aliens,
aliens[curr_alien].x & 1 ? ALIEN_WIDTH : 0,
aliens[curr_alien].type * ALIEN_HEIGHT,
- STRIDE( BMPWIDTH_invadrox_aliens,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_aliens,
BMPHEIGHT_invadrox_aliens),
x, y, ALIEN_WIDTH, ALIEN_HEIGHT);
@@ -918,7 +923,8 @@ inline void draw_ship(void)
/* Draw ship */
rb->lcd_bitmap_part(invadrox_ships, 0, ship_frame * SHIP_HEIGHT,
- STRIDE( BMPWIDTH_invadrox_ships,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_ships,
BMPHEIGHT_invadrox_ships),
ship_x, SHIP_Y, SHIP_WIDTH, SHIP_HEIGHT);
if (ship_hit) {
@@ -1160,7 +1166,8 @@ inline void draw_bomb(int i)
{
rb->lcd_bitmap_part(invadrox_bombs, bombs[i].type * BOMB_WIDTH,
bombs[i].frame * BOMB_HEIGHT,
- STRIDE( BMPWIDTH_invadrox_bombs,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_bombs,
BMPHEIGHT_invadrox_bombs),
bombs[i].x, bombs[i].y,
BOMB_WIDTH, BOMB_HEIGHT);
@@ -1262,7 +1269,8 @@ void move_bombs(void)
bombs[i].state = S_EXPLODE * 4;
bombs[i].target = TARGET_SHIP;
rb->lcd_bitmap_part(invadrox_ships, 0, 1 * SHIP_HEIGHT,
- STRIDE( BMPWIDTH_invadrox_ships,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_ships,
BMPHEIGHT_invadrox_ships),
ship_x, SHIP_Y,
SHIP_WIDTH, SHIP_HEIGHT);
diff --git a/apps/plugins/jackpot.c b/apps/plugins/jackpot.c
index e13dcf8994..4ab1d3a837 100644
--- a/apps/plugins/jackpot.c
+++ b/apps/plugins/jackpot.c
@@ -62,9 +62,11 @@ static unsigned long char_patterns[NB_SLOTS];
#endif
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
- {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
};
@@ -172,7 +174,7 @@ void jackpot_display_slot_machine(struct jackpot* game, struct screen* display)
#else
const struct picture* picture= &(jackpot_pictures[display->screen_type]);
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 */
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;
#else
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 */
int previous_state_y=game->state_y[display->screen_type][i];
if(state_y==previous_state_y)
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index 01c5e1ea0b..f049fdca5c 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -512,13 +512,15 @@ static void jewels_drawboard(struct game_context* bj) {
TILE_WIDTH, TILE_HEIGHT);
rb->lcd_bitmap_transparent_part(jewels,
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,
TILE_WIDTH, TILE_HEIGHT);
#else
rb->lcd_bitmap_part(jewels,
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,
TILE_WIDTH, TILE_HEIGHT);
#endif
@@ -730,7 +732,9 @@ static void jewels_putjewels(struct game_context* bj){
#ifdef HAVE_LCD_COLOR
rb->lcd_bitmap_transparent_part(jewels, 0,
TILE_HEIGHT*(bj->playboard[i][j].type),
- STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_jewels,
+ BMPHEIGHT_jewels),
j*TILE_WIDTH,
(i-1)*TILE_HEIGHT+YOFS+
((((TILE_HEIGHT<<10)*k)/8)>>10),
@@ -738,7 +742,9 @@ static void jewels_putjewels(struct game_context* bj){
#else
rb->lcd_bitmap_part(jewels, 0,
TILE_HEIGHT*(bj->playboard[i][j].type),
- STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_jewels,
+ BMPHEIGHT_jewels),
j*TILE_WIDTH,
(i-1)*TILE_HEIGHT+YOFS+
((((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,
0, TILE_HEIGHT*(bj->playboard
[y+1+vertmod][x+horzmod].type),
- STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_jewels, BMPHEIGHT_jewels),
(x+horzmod)*TILE_WIDTH-horzmod*
((((movelen<<10)*k)/8)>>10),
(y+vertmod)*TILE_HEIGHT-vertmod*
@@ -966,7 +973,8 @@ static unsigned int jewels_swapjewels(struct game_context* bj,
TILE_WIDTH, TILE_HEIGHT);
rb->lcd_bitmap_transparent_part(jewels,
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*
((((movelen<<10)*k)/8)>>10),
y*TILE_HEIGHT+vertmod*
@@ -976,7 +984,8 @@ static unsigned int jewels_swapjewels(struct game_context* bj,
rb->lcd_bitmap_part(jewels,
0, TILE_HEIGHT*(bj->playboard
[y+1+vertmod][x+horzmod].type),
- STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_jewels, BMPHEIGHT_jewels),
(x+horzmod)*TILE_WIDTH-horzmod*
((((movelen<<10)*k)/8)>>10),
(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_bitmap_part(jewels,
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*
((((movelen<<10)*k)/8)>>10),
y*TILE_HEIGHT+vertmod*
diff --git a/apps/plugins/lib/picture.c b/apps/plugins/lib/picture.c
index a759b945b6..7717b76eeb 100644
--- a/apps/plugins/lib/picture.c
+++ b/apps/plugins/lib/picture.c
@@ -26,15 +26,15 @@ void picture_draw(struct screen* display, const struct picture* picture,
display->bitmap(
picture->data,
x, y,
- picture->width, picture->height
+ picture->width, picture->slide_height
);
}
/**
* Draws a part of the given picture on the given screen
* Use it when the data contains multiple pictures from top to bottom.
- * In that case, picture.height represents the height of one picture,
- * not the whole set.
+ * In that case, picture.slide_height represents the height of one picture,
+ * not the whole set. picture.height represents the height of the whole image
* @param display the screen where to display the picture
* @param picture the picture's data, only a part will be displayed
* @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,
/*slice into picture->data */
0, yoffset,
- picture->width,
+ STRIDE(display->screen_type, picture->width, picture->height),
/* 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,
int sprite_no,
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);
}
diff --git a/apps/plugins/lib/picture.h b/apps/plugins/lib/picture.h
index 0013489039..7aa9899018 100644
--- a/apps/plugins/lib/picture.h
+++ b/apps/plugins/lib/picture.h
@@ -27,6 +27,7 @@ struct picture{
const void* data;
int width;
int height;
+ int slide_height;
};
void picture_draw(struct screen* display, const struct picture* picture,
diff --git a/apps/plugins/matrix.c b/apps/plugins/matrix.c
index 0d75986bb6..e6e0fa1175 100644
--- a/apps/plugins/matrix.c
+++ b/apps/plugins/matrix.c
@@ -213,12 +213,14 @@ static void matrix_blit_char(const int row, const int col, int cha)
if (matrix[row][col].bold == 1) {
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);
}
else {
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);
}
}
diff --git a/apps/plugins/pegbox.c b/apps/plugins/pegbox.c
index f0fe0cdb6f..2766bb613c 100644
--- a/apps/plugins/pegbox.c
+++ b/apps/plugins/pegbox.c
@@ -747,7 +747,8 @@ static void pegbox_draw_board(struct game_context* pb)
if(type != SPACE) {
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,
r * PIECE_HEIGHT + BOARD_Y, PIECE_WIDTH,
PIECE_HEIGHT);
diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c
index 2f1d366960..a5daafd8e9 100644
--- a/apps/plugins/sliding_puzzle.c
+++ b/apps/plugins/sliding_puzzle.c
@@ -407,7 +407,8 @@ static void draw_spot(int p, int x, int y)
an appropriate hole graphic */
rb->lcd_bitmap_part(sliding_puzzle, ((p-1)%SPOTS_X)*SPOTS_WIDTH,
((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);
#else
/* 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,
((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);
} else {
rb->lcd_drawrect(x, y, SPOTS_WIDTH, SPOTS_HEIGHT);
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c
index 0d8a0821e5..63a808877b 100644
--- a/apps/plugins/sokoban.c
+++ b/apps/plugins/sokoban.c
@@ -982,43 +982,57 @@ static void update_screen(void)
case ' ': /* floor */
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);
break;
case '#': /* wall */
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);
break;
case '$': /* box */
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);
break;
case '*': /* box on goal */
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);
break;
case '.': /* goal */
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);
break;
case '@': /* player */
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);
break;
case '+': /* player on goal */
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);
break;
}
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c
index 2296a6ef5a..2fdba18610 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -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,
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 );
}
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,
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 );
draw_card_ext( x, y, false, cursor );
diff --git a/apps/plugins/star.c b/apps/plugins/star.c
index e40fa5a2dc..6079ba488e 100644
--- a/apps/plugins/star.c
+++ b/apps/plugins/star.c
@@ -729,7 +729,8 @@ static void star_display_board_info(int current_level)
rb->lcd_bitmap_part(star_tiles, 0, control == STAR_CONTROL_BALL ?
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,
tile_pos_y, TILE_WIDTH, TILE_HEIGHT);
@@ -768,7 +769,8 @@ static int star_load_level(int current_level)
# define DRAW_TILE( a ) \
rb->lcd_bitmap_part( star_tiles, 0, \
a*TILE_HEIGHT, \
- STRIDE( BMPWIDTH_star_tiles, \
+ STRIDE( SCREEN_MAIN, \
+ BMPWIDTH_star_tiles, \
BMPHEIGHT_star_tiles), \
STAR_OFFSET_X + x * TILE_WIDTH, \
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
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);
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);
rb->lcd_update_rect(start_x + delta_x * i - (delta_x>0?1:0),
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
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);
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);
rb->lcd_update_rect(start_x, start_y + delta_y * i - (delta_y>0?1:0),
TILE_WIDTH, TILE_HEIGHT + 1);
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c
index 3fac57b96a..02de4083dd 100644
--- a/apps/plugins/sudoku/sudoku.c
+++ b/apps/plugins/sudoku/sudoku.c
@@ -73,7 +73,7 @@ Example ".ss" file, and one with a saved state:
#include "pluginbitmaps/sudoku_start.h"
#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)
#define BITMAP_WIDTH (BMPWIDTH_sudoku_normal/2)
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c
index 225de80f11..6c8f9b7f3f 100644
--- a/apps/plugins/superdom.c
+++ b/apps/plugins/superdom.c
@@ -62,7 +62,7 @@ char buf[255];
/* These parameters define the piece image dimensions, Stride is the total width
* 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_WIDTH (BMPWIDTH_superdom_boarditems/2)
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c
index 4507923144..438c173211 100644
--- a/apps/recorder/albumart.c
+++ b/apps/recorder/albumart.c
@@ -351,7 +351,9 @@ void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear)
if (!clear)
{
/* 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);
#ifdef HAVE_LCD_INVERT
if (global_settings.invert) {
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c
index 9f83748a82..b67615b840 100644
--- a/apps/recorder/bmp.c
+++ b/apps/recorder/bmp.c
@@ -425,6 +425,7 @@ void output_row_8_native(uint32_t row, void * row_in,
#elif LCD_DEPTH == 16
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
/* M:Robe 500 */
+ (void) fb_width;
fb_data *dest = (fb_data *)ctx->bm->data + row;
int delta = 127;
unsigned r, g, b;
diff --git a/apps/screen_access.h b/apps/screen_access.h
index f0fed01722..0002e71991 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -26,13 +26,6 @@
#include "buttonbar.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)
#define NB_SCREENS 2
#else
diff --git a/firmware/drivers/lcd-16bit-vert.c b/firmware/drivers/lcd-16bit-vert.c
index 396e6f88d8..887505766c 100644
--- a/firmware/drivers/lcd-16bit-vert.c
+++ b/firmware/drivers/lcd-16bit-vert.c
@@ -69,7 +69,7 @@ static struct viewport default_vp =
/* The Gigabeat target build requires access to the current fg_pattern
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;
#else
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 */
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) \
@@ -914,7 +914,7 @@ void lcd_bitmap_transparent(const fb_data *src, int x, int y,
int width, int height)
{
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"
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 3d391d6685..3f3d8f875f 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -306,13 +306,25 @@ static inline unsigned lcd_color_to_native(unsigned color)
#endif /* HAVE_LCD_COLOR */
+enum screen_type {
+ SCREEN_MAIN
+#ifdef HAVE_REMOTE_LCD
+ ,SCREEN_REMOTE
+#endif
+};
+
/* Frame buffer stride */
+#define STRIDE_REMOTE(w, h) (w)
+
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
-#define STRIDE(w, h) (h)
+#define STRIDE_MAIN(w, h) (h)
#else
-#define STRIDE(w, h) (w)
+#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 */
#if LCD_DEPTH == 1
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING