summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/gray_parm.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib/gray_parm.c')
-rw-r--r--apps/plugins/lib/gray_parm.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/plugins/lib/gray_parm.c b/apps/plugins/lib/gray_parm.c
index a6064e3ad3..ea39eadc66 100644
--- a/apps/plugins/lib/gray_parm.c
+++ b/apps/plugins/lib/gray_parm.c
@@ -11,7 +11,8 @@
11* Parameter handling 11* Parameter handling
12* 12*
13* This is a generic framework to display up to 33 shades of grey 13* This is a generic framework to display up to 33 shades of grey
14* on low-depth bitmap LCDs (Archos b&w, Iriver 4-grey) within plugins. 14* on low-depth bitmap LCDs (Archos b&w, Iriver 4-grey, iPod 4-grey)
15* within plugins.
15* 16*
16* Copyright (C) 2004-2006 Jens Arnold 17* Copyright (C) 2004-2006 Jens Arnold
17* 18*
@@ -29,11 +30,19 @@
29#include "gray.h" 30#include "gray.h"
30 31
31/* Set position of the top left corner of the greyscale overlay 32/* Set position of the top left corner of the greyscale overlay
32 Note that by is in pixel-block units (8 pixels) */ 33 Note that depending on the target LCD, either x or y gets rounded
33void gray_set_position(int x, int by) 34 to the nearest multiple of 8 */
35void gray_set_position(int x, int y)
34{ 36{
37#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
38 _gray_info.bx = (x + 3) / 8;
39 x = 8 * _gray_info.bx;
40#else
41 _gray_info.by = (y + 3) / 8;
42 y = 8 * _gray_info.by;
43#endif
35 _gray_info.x = x; 44 _gray_info.x = x;
36 _gray_info.by = by; 45 _gray_info.y = y;
37 46
38 if (_gray_info.flags & _GRAY_RUNNING) 47 if (_gray_info.flags & _GRAY_RUNNING)
39 { 48 {