summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/lib/xlcd_draw.c8
-rw-r--r--apps/plugins/lib/xlcd_scroll.c20
-rw-r--r--apps/plugins/lua/rocklib_img.c4
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,
356 fb_data *dst; 356 fb_data *dst;
357 357
358 /* nothing to draw? */ 358 /* nothing to draw? */
359 if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) 359 if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
360 || (x + width <= 0) || (y + height <= 0)) 360 || (x + width <= 0) || (y + height <= 0))
361 return; 361 return;
362 362
363 /* clipping */ 363 /* clipping */
364 if (x < 0) 364 if (x < 0)
365 { 365 {
@@ -426,10 +426,10 @@ void xlcd_color_bitmap_part(const unsigned char *src, int src_x, int src_y,
426 fb_data *dst; 426 fb_data *dst;
427 427
428 /* nothing to draw? */ 428 /* nothing to draw? */
429 if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) 429 if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
430 || (x + width <= 0) || (y + height <= 0)) 430 || (x + width <= 0) || (y + height <= 0))
431 return; 431 return;
432 432
433 /* clipping */ 433 /* clipping */
434 if (x < 0) 434 if (x < 0)
435 { 435 {
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)
74 74
75 length = (LCD_WIDTH-count)*LCD_FBHEIGHT; 75 length = (LCD_WIDTH-count)*LCD_FBHEIGHT;
76 76
77 rb->memmove(lcd_fb + LCD_HEIGHT*count, 77 rb->memmove(lcd_fb + LCD_HEIGHT*count,
78 lcd_fb, length * sizeof(fb_data)); 78 lcd_fb, length * sizeof(fb_data));
79 79
80 oldmode = rb->lcd_get_drawmode(); 80 oldmode = rb->lcd_get_drawmode();
@@ -92,7 +92,7 @@ void xlcd_scroll_up(int count)
92 92
93 93
94 int width, length, oldmode; 94 int width, length, oldmode;
95 95
96 fb_data *data; 96 fb_data *data;
97 97
98 if ((unsigned)count >= LCD_HEIGHT) 98 if ((unsigned)count >= LCD_HEIGHT)
@@ -102,10 +102,10 @@ void xlcd_scroll_up(int count)
102 } 102 }
103 103
104 length = LCD_HEIGHT - count; 104 length = LCD_HEIGHT - count;
105 105
106 width = LCD_WIDTH-1; 106 width = LCD_WIDTH-1;
107 data = lcd_fb; 107 data = lcd_fb;
108 108
109 do { 109 do {
110 rb->memmove(data,data + count,length * sizeof(fb_data)); 110 rb->memmove(data,data + count,length * sizeof(fb_data));
111 data += LCD_HEIGHT; 111 data += LCD_HEIGHT;
@@ -126,7 +126,7 @@ void xlcd_scroll_down(int count)
126 126
127 127
128 int width, length, oldmode; 128 int width, length, oldmode;
129 129
130 fb_data *data; 130 fb_data *data;
131 131
132 if ((unsigned)count >= LCD_HEIGHT) 132 if ((unsigned)count >= LCD_HEIGHT)
@@ -139,7 +139,7 @@ void xlcd_scroll_down(int count)
139 139
140 width = LCD_WIDTH-1; 140 width = LCD_WIDTH-1;
141 data = lcd_fb; 141 data = lcd_fb;
142 142
143 do { 143 do {
144 rb->memmove(data + count, data, length * sizeof(fb_data)); 144 rb->memmove(data + count, data, length * sizeof(fb_data));
145 data += LCD_HEIGHT; 145 data += LCD_HEIGHT;
@@ -408,7 +408,7 @@ void xlcd_scroll_down(int count)
408 rb->lcd_set_drawmode(oldmode); 408 rb->lcd_set_drawmode(oldmode);
409} 409}
410 410
411#else /* LCD_PIXELFORMAT == VERTICAL_PACKING, 411#else /* LCD_PIXELFORMAT == VERTICAL_PACKING,
412 LCD_PIXELFORMAT == VERTICAL_INTERLEAVED */ 412 LCD_PIXELFORMAT == VERTICAL_INTERLEAVED */
413 413
414/* Scroll up */ 414/* Scroll up */
@@ -426,7 +426,7 @@ void xlcd_scroll_up(int count)
426 rb->lcd_clear_display(); 426 rb->lcd_clear_display();
427 return; 427 return;
428 } 428 }
429 429
430#if (LCD_DEPTH == 1) \ 430#if (LCD_DEPTH == 1) \
431 || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) 431 || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED)
432 blockcount = count >> 3; 432 blockcount = count >> 3;
@@ -554,7 +554,7 @@ void xlcd_scroll_down(int count)
554 rb->lcd_clear_display(); 554 rb->lcd_clear_display();
555 return; 555 return;
556 } 556 }
557 557
558#if (LCD_DEPTH == 1) \ 558#if (LCD_DEPTH == 1) \
559 || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) 559 || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED)
560 blockcount = count >> 3; 560 blockcount = count >> 3;
@@ -638,7 +638,7 @@ void xlcd_scroll_down(int count)
638 int x, by; 638 int x, by;
639 fb_data *addr = lcd_fb + blockcount * LCD_FBWIDTH; 639 fb_data *addr = lcd_fb + blockcount * LCD_FBWIDTH;
640 unsigned fill, mask; 640 unsigned fill, mask;
641 641
642 fill = patterns[rb->lcd_get_background() & 3] >> (8 - bitcount); 642 fill = patterns[rb->lcd_get_background() & 3] >> (8 - bitcount);
643 mask = (0xFFu >> bitcount) << bitcount; 643 mask = (0xFFu >> bitcount) << bitcount;
644 mask |= mask << 8; 644 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)
1400static void checkint_arr(lua_State *L, int *val, int narg, int elems) 1400static void checkint_arr(lua_State *L, int *val, int narg, int elems)
1401{ 1401{
1402 /* fills passed array of integers with lua integers from stack */ 1402 /* fills passed array of integers with lua integers from stack */
1403 for (int i = 0; i < elems; i++) 1403 for (int i = 0; i < elems; i++)
1404 val[i] = luaL_checkint(L, narg + i); 1404 val[i] = luaL_checkint(L, narg + i);
1405} 1405}
1406 1406
@@ -1538,7 +1538,7 @@ RB_WRAP(lcd_bitmap_transparent_part)
1538 int v[eCNT]; 1538 int v[eCNT];
1539 checkint_arr(L, v, 2, eCNT); 1539 checkint_arr(L, v, 2, eCNT);
1540 1540
1541 RB_SCREENS(L, 9, transparent_bitmap_part, src->data, 1541 RB_SCREENS(L, 9, transparent_bitmap_part, src->data,
1542 v[src_x], v[src_y], v[stride], v[x], v[y], v[w], v[h]); 1542 v[src_x], v[src_y], v[stride], v[x], v[y], v[w], v[h]);
1543 return 0; 1543 return 0;
1544} 1544}