? read-zip.zip ? build ? flicker-fix.patch ? cbitmap-new.patch ? ticking-reduce.patch ? cbitmap.patch ? apps/gui/combined-bmp-tmp.c ? apps/plugins/zip_read.c ? tools/rdf2binary ? tools/mkboot ? tools/codepages ? wps/tt.txt Index: apps/screen_access.c =================================================================== RCS file: /cvsroot/rockbox/apps/screen_access.c,v retrieving revision 1.20 diff -u -r1.20 screen_access.c --- apps/screen_access.c 28 Jan 2006 23:12:20 -0000 1.20 +++ apps/screen_access.c 29 Jan 2006 20:48:23 -0000 @@ -52,6 +52,7 @@ screen->getstringsize=&lcd_remote_getstringsize; screen->putsxy=&lcd_remote_putsxy; screen->mono_bitmap=&lcd_remote_mono_bitmap; + screen->mono_bitmap_part=&lcd_remote_mono_bitmap_part; screen->set_drawmode=&lcd_remote_set_drawmode; #if LCD_REMOTE_DEPTH > 1 screen->set_background=&lcd_remote_set_background; @@ -118,6 +119,7 @@ screen->getstringsize=&lcd_getstringsize; screen->putsxy=&lcd_putsxy; screen->mono_bitmap=&lcd_mono_bitmap; + screen->mono_bitmap_part=&lcd_mono_bitmap_part; screen->set_drawmode=&lcd_set_drawmode; #if LCD_DEPTH > 1 screen->bitmap=&lcd_bitmap; @@ -126,6 +128,7 @@ screen->transparent_bitmap=&lcd_bitmap; #else screen->transparent_bitmap=&lcd_bitmap_transparent; + screen->transparent_bitmap_part=&lcd_bitmap_transparent_part; #endif screen->set_background=&lcd_set_background; #endif Index: apps/screen_access.h =================================================================== RCS file: /cvsroot/rockbox/apps/screen_access.h,v retrieving revision 1.22 diff -u -r1.22 screen_access.h --- apps/screen_access.h 28 Jan 2006 23:12:20 -0000 1.22 +++ apps/screen_access.h 29 Jan 2006 20:48:23 -0000 @@ -82,10 +82,16 @@ int style, int offset); void (*mono_bitmap)(const unsigned char *src, int x, int y, int width, int height); + void (*mono_bitmap_part)(const unsigned char *src, int src_x, + int src_y, int stride, int x, int y, + int width, int height); void (*bitmap)(const fb_data *src, int x, int y, int width, int height); void (*transparent_bitmap)(const fb_data *src, int x, int y, int width, int height); + void (*transparent_bitmap_part)(const fb_data *src, int src_x, int src_y, + int stride, int x, int y, int width, + int height); void (*set_drawmode)(int mode); #if (LCD_DEPTH > 1) || (LCD_REMOTE_DEPTH > 1) void (*set_background)(unsigned background); Index: apps/gui/gwps-common.c =================================================================== RCS file: /cvsroot/rockbox/apps/gui/gwps-common.c,v retrieving revision 1.33 diff -u -r1.33 gwps-common.c --- apps/gui/gwps-common.c 29 Jan 2006 19:16:35 -0000 1.33 +++ apps/gui/gwps-common.c 29 Jan 2006 20:48:30 -0000 @@ -234,6 +234,97 @@ char imgname[MAX_PATH]; char qual = *ptr; + if(qual == 'p') + { + ptr = strchr(ptr, '|') + 1; + pos = strchr(ptr, '|'); + int src = -1; + if (pos) + { + /* get the image ID */ + n = get_image_id(*ptr); + + + if(n < 0 || n >= MAX_IMAGES) + break; + ptr = pos+1; + + /* check the image number and load state */ + if (data->img[n].loaded) + return false; + else + { + /* get the source image ID */ + src = get_image_id(*ptr); + + if(src < 0 || src >= MAX_IMAGES + || !data->img[src].loaded) + { + return false; + } + pos = strchr(ptr, '|'); + ptr = pos+1; + + /* get src_x */ + pos = strchr(ptr, '|'); + if (pos) + data->img[n].src_x = atoi(ptr); + else + return false; + + ptr = pos+1; + + /* get src_y */ + pos = strchr(ptr, '|'); + if (pos) + data->img[n].src_y = atoi(ptr); + else + return false; + + ptr = pos+1; + + /* get width */ + pos = strchr(ptr, '|'); + if (pos) + data->img[n].bm.width = atoi(ptr); + else + return false; + + ptr = pos+1; + + /* get height */ + pos = strchr(ptr, '|'); + if (pos) + data->img[n].bm.height = atoi(ptr); + else + return false; + + ptr = pos+1; + + /* get x-position */ + pos = strchr(ptr, '|'); + if (pos) + data->img[n].x = atoi(ptr); + else + return false; + + + /* get y-position */ + ptr = pos+1; + pos = strchr(ptr, '|'); + if (pos) + data->img[n].y = atoi(ptr); + else + return false; + + + data->img[n].bm.data = data->img[src].bm.data; + data->img[n].stride = data->img[src].bm.width; + data->img[n].loaded = true; + return true; + } + } + } if (qual == 'l' || qual == '|') /* format: %x|n|filename.bmp|x|y| or @@ -248,22 +339,13 @@ n = get_image_id(*ptr); if(n < 0 || n >= MAX_IMAGES) - { - /* Skip the rest of the line */ - while(*buf != '\n') - buf++; return false; - } + ptr = pos+1; /* check the image number and load state */ if (data->img[n].loaded) - { - /* Skip the rest of the line */ - while(*buf != '\n') - buf++; return false; - } else { /* get filename */ @@ -279,7 +361,7 @@ } else /* filename too long */ - imgname[0] = 0; + return false; ptr = pos+1; @@ -288,11 +370,7 @@ if (pos) data->img[n].x = atoi(ptr); else - { - /* weird syntax, bail out */ - buf++; return false; - } /* get y-position */ ptr = pos+1; @@ -300,11 +378,7 @@ if (pos) data->img[n].y = atoi(ptr); else - { - /* weird syntax, bail out */ - buf++; return false; - } /* load the image */ data->img[n].bm.data = data->img_buf_ptr; @@ -1366,15 +1440,33 @@ #if LCD_DEPTH > 1 if(data->img[n].bm.format == FORMAT_MONO) { #endif - display->mono_bitmap(data->img[n].bm.data, data->img[n].x, - data->img[n].y, data->img[n].bm.width, - data->img[n].bm.height); + if(data->img[n].stride > 0) { + display->mono_bitmap_part(data->img[n].bm.data, data->img[n].src_x, + data->img[n].src_y, data->img[n].stride, + data->img[n].x, data->img[n].y, + data->img[n].bm.width, + data->img[n].bm.height); + } + else { + display->mono_bitmap(data->img[n].bm.data, data->img[n].x, + data->img[n].y, data->img[n].bm.width, + data->img[n].bm.height); + } #if LCD_DEPTH > 1 } else { - display->transparent_bitmap((fb_data *)data->img[n].bm.data, - data->img[n].x, - data->img[n].y, data->img[n].bm.width, - data->img[n].bm.height); + if(data->img[n].stride > 0) { + display->transparent_bitmap_part((fb_data *)data->img[n].bm.data, + data->img[n].src_x, data->img[n].src_y, + data->img[n].stride, data->img[n].x, + data->img[n].y, data->img[n].bm.width, + data->img[n].bm.height); + } + else { + display->transparent_bitmap((fb_data *)data->img[n].bm.data, + data->img[n].x, + data->img[n].y, data->img[n].bm.width, + data->img[n].bm.height); + } } #endif } Index: apps/gui/gwps.c =================================================================== RCS file: /cvsroot/rockbox/apps/gui/gwps.c,v retrieving revision 1.20 diff -u -r1.20 gwps.c --- apps/gui/gwps.c 29 Jan 2006 14:16:30 -0000 1.20 +++ apps/gui/gwps.c 29 Jan 2006 20:48:31 -0000 @@ -767,6 +767,7 @@ wps_data->img[i].loaded = false; wps_data->img[i].display = false; wps_data->img[i].always_display = false; + wps_data->img[i].stride = 0; } wps_data->wps_sb_tag = false; wps_data->show_sb_on_wps = false; @@ -790,6 +791,7 @@ data->img[i].loaded = false; data->img[i].display = false; data->img[i].always_display = false; + data->img[i].stride = -1; } data->wps_sb_tag = false; data->show_sb_on_wps = false; Index: apps/gui/gwps.h =================================================================== RCS file: /cvsroot/rockbox/apps/gui/gwps.h,v retrieving revision 1.17 diff -u -r1.17 gwps.h --- apps/gui/gwps.h 28 Jan 2006 12:12:42 -0000 1.17 +++ apps/gui/gwps.h 29 Jan 2006 20:48:32 -0000 @@ -258,9 +258,12 @@ struct bitmap bm; int x; /* x-pos */ int y; /* y-pos */ + int src_x; /* source x-pos (only for combined-bitmaps) */ + int src_y; /* source y-pos (only for combined-bitmaps) */ bool loaded; /* load state */ bool display; /* is to be displayed */ bool always_display; /* not using the preload/display mechanism */ + int stride; /* stride (only for combined-bitmaps) */ }; #endif