summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-08-31 13:23:12 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-08-31 13:23:12 +0000
commitb01bae51a4162b5c3526e981c04718a8d98b7353 (patch)
treef245ff769feb6e6818fde87c49a87fee669a9c65 /apps
parent5fc5b5093a9f916150a50e7c28dfc7298108a115 (diff)
Jewels: Add support for vertical stride.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22571 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/jewels.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index 8f799e973f..b133aa1e45 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -511,12 +511,14 @@ 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),
- TILE_WIDTH, j*TILE_WIDTH, i*TILE_HEIGHT+YOFS,
+ STRIDE(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),
- TILE_WIDTH, j*TILE_WIDTH, i*TILE_HEIGHT+YOFS,
+ STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
+ j*TILE_WIDTH, i*TILE_HEIGHT+YOFS,
TILE_WIDTH, TILE_HEIGHT);
#endif
}
@@ -727,14 +729,16 @@ 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),
- TILE_WIDTH, j*TILE_WIDTH,
+ STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
+ j*TILE_WIDTH,
(i-1)*TILE_HEIGHT+YOFS+
((((TILE_HEIGHT<<10)*k)/8)>>10),
TILE_WIDTH, TILE_HEIGHT);
#else
rb->lcd_bitmap_part(jewels, 0,
TILE_HEIGHT*(bj->playboard[i][j].type),
- TILE_WIDTH, j*TILE_WIDTH,
+ STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
+ j*TILE_WIDTH,
(i-1)*TILE_HEIGHT+YOFS+
((((TILE_HEIGHT<<10)*k)/8)>>10),
TILE_WIDTH, TILE_HEIGHT);
@@ -952,7 +956,8 @@ static unsigned int jewels_swapjewels(struct game_context* bj,
#ifdef HAVE_LCD_COLOR
rb->lcd_bitmap_transparent_part(jewels,
0, TILE_HEIGHT*(bj->playboard
- [y+1+vertmod][x+horzmod].type), TILE_WIDTH,
+ [y+1+vertmod][x+horzmod].type),
+ STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
(x+horzmod)*TILE_WIDTH-horzmod*
((((movelen<<10)*k)/8)>>10),
(y+vertmod)*TILE_HEIGHT-vertmod*
@@ -960,7 +965,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),
- TILE_WIDTH, x*TILE_WIDTH+horzmod*
+ STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
+ x*TILE_WIDTH+horzmod*
((((movelen<<10)*k)/8)>>10),
y*TILE_HEIGHT+vertmod*
((((movelen<<10)*k)/8)>>10)+YOFS,
@@ -968,7 +974,8 @@ static unsigned int jewels_swapjewels(struct game_context* bj,
#else
rb->lcd_bitmap_part(jewels,
0, TILE_HEIGHT*(bj->playboard
- [y+1+vertmod][x+horzmod].type), TILE_WIDTH,
+ [y+1+vertmod][x+horzmod].type),
+ STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
(x+horzmod)*TILE_WIDTH-horzmod*
((((movelen<<10)*k)/8)>>10),
(y+vertmod)*TILE_HEIGHT-vertmod*
@@ -977,7 +984,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),
- TILE_WIDTH, x*TILE_WIDTH+horzmod*
+ STRIDE(BMPWIDTH_jewels, BMPHEIGHT_jewels),
+ x*TILE_WIDTH+horzmod*
((((movelen<<10)*k)/8)>>10),
y*TILE_HEIGHT+vertmod*
((((movelen<<10)*k)/8)>>10)+YOFS,