diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/lib/xlcd_draw.c | 8 | ||||
-rw-r--r-- | apps/plugins/lib/xlcd_scroll.c | 20 | ||||
-rw-r--r-- | apps/plugins/lua/rocklib_img.c | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/apps/plugins/lib/xlcd_draw.c b/apps/plugins/lib/xlcd_draw.c index 0bd1c7a9e2..debdff6f04 100644 --- a/apps/plugins/lib/xlcd_draw.c +++ b/apps/plugins/lib/xlcd_draw.c @@ -356,10 +356,10 @@ void xlcd_gray_bitmap_part(const unsigned char *src, int src_x, int src_y, fb_data *dst; /* nothing to draw? */ - if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) + if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) || (x + width <= 0) || (y + height <= 0)) return; - + /* clipping */ if (x < 0) { @@ -426,10 +426,10 @@ void xlcd_color_bitmap_part(const unsigned char *src, int src_x, int src_y, fb_data *dst; /* nothing to draw? */ - if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) + if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) || (x + width <= 0) || (y + height <= 0)) return; - + /* clipping */ if (x < 0) { diff --git a/apps/plugins/lib/xlcd_scroll.c b/apps/plugins/lib/xlcd_scroll.c index 89427b6118..5ac4a366e8 100644 --- a/apps/plugins/lib/xlcd_scroll.c +++ b/apps/plugins/lib/xlcd_scroll.c @@ -74,7 +74,7 @@ void xlcd_scroll_right(int count) length = (LCD_WIDTH-count)*LCD_FBHEIGHT; - rb->memmove(lcd_fb + LCD_HEIGHT*count, + rb->memmove(lcd_fb + LCD_HEIGHT*count, lcd_fb, length * sizeof(fb_data)); oldmode = rb->lcd_get_drawmode(); @@ -92,7 +92,7 @@ void xlcd_scroll_up(int count) int width, length, oldmode; - + fb_data *data; if ((unsigned)count >= LCD_HEIGHT) @@ -102,10 +102,10 @@ void xlcd_scroll_up(int count) } length = LCD_HEIGHT - count; - + width = LCD_WIDTH-1; data = lcd_fb; - + do { rb->memmove(data,data + count,length * sizeof(fb_data)); data += LCD_HEIGHT; @@ -126,7 +126,7 @@ void xlcd_scroll_down(int count) int width, length, oldmode; - + fb_data *data; if ((unsigned)count >= LCD_HEIGHT) @@ -139,7 +139,7 @@ void xlcd_scroll_down(int count) width = LCD_WIDTH-1; data = lcd_fb; - + do { rb->memmove(data + count, data, length * sizeof(fb_data)); data += LCD_HEIGHT; @@ -408,7 +408,7 @@ void xlcd_scroll_down(int count) rb->lcd_set_drawmode(oldmode); } -#else /* LCD_PIXELFORMAT == VERTICAL_PACKING, +#else /* LCD_PIXELFORMAT == VERTICAL_PACKING, LCD_PIXELFORMAT == VERTICAL_INTERLEAVED */ /* Scroll up */ @@ -426,7 +426,7 @@ void xlcd_scroll_up(int count) rb->lcd_clear_display(); return; } - + #if (LCD_DEPTH == 1) \ || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) blockcount = count >> 3; @@ -554,7 +554,7 @@ void xlcd_scroll_down(int count) rb->lcd_clear_display(); return; } - + #if (LCD_DEPTH == 1) \ || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) blockcount = count >> 3; @@ -638,7 +638,7 @@ void xlcd_scroll_down(int count) int x, by; fb_data *addr = lcd_fb + blockcount * LCD_FBWIDTH; unsigned fill, mask; - + fill = patterns[rb->lcd_get_background() & 3] >> (8 - bitcount); mask = (0xFFu >> bitcount) << bitcount; mask |= mask << 8; diff --git a/apps/plugins/lua/rocklib_img.c b/apps/plugins/lua/rocklib_img.c index 887ef984d0..13e5503f75 100644 --- a/apps/plugins/lua/rocklib_img.c +++ b/apps/plugins/lua/rocklib_img.c @@ -1400,7 +1400,7 @@ RB_WRAP(lcd_setfont) static void checkint_arr(lua_State *L, int *val, int narg, int elems) { /* fills passed array of integers with lua integers from stack */ - for (int i = 0; i < elems; i++) + for (int i = 0; i < elems; i++) val[i] = luaL_checkint(L, narg + i); } @@ -1538,7 +1538,7 @@ RB_WRAP(lcd_bitmap_transparent_part) int v[eCNT]; checkint_arr(L, v, 2, eCNT); - RB_SCREENS(L, 9, transparent_bitmap_part, src->data, + RB_SCREENS(L, 9, transparent_bitmap_part, src->data, v[src_x], v[src_y], v[stride], v[x], v[y], v[w], v[h]); return 0; } |