summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/gray_parm.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-11-16 21:09:23 +0000
committerJens Arnold <amiconn@rockbox.org>2005-11-16 21:09:23 +0000
commit5b2cba17aa95ececfdb6a498540de4dfa215e920 (patch)
tree3574eab7dc84f588268b72f6db56744fcc4d0e64 /apps/plugins/lib/gray_parm.c
parent15046f99b3840c07bdd9d52e7014c6e775267c55 (diff)
downloadrockbox-5b2cba17aa95ececfdb6a498540de4dfa215e920.tar.gz
rockbox-5b2cba17aa95ececfdb6a498540de4dfa215e920.zip
Changed the LCD_COLOR pixel value format to packed RGB (unsigned int). Now all LCDs with depth > 1 use the same datatype. Added macros for easy pixel value definition.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7912 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/gray_parm.c')
-rw-r--r--apps/plugins/lib/gray_parm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/plugins/lib/gray_parm.c b/apps/plugins/lib/gray_parm.c
index a8c238a4eb..c4ee92f9cc 100644
--- a/apps/plugins/lib/gray_parm.c
+++ b/apps/plugins/lib/gray_parm.c
@@ -53,7 +53,7 @@ int gray_get_drawmode(void)
53} 53}
54 54
55/* Set the foreground shade for subsequent drawing operations */ 55/* Set the foreground shade for subsequent drawing operations */
56void gray_set_foreground(int brightness) 56void gray_set_foreground(unsigned brightness)
57{ 57{
58 unsigned data = MULU16(_gray_info.depth, brightness & 0xFF) + 127; 58 unsigned data = MULU16(_gray_info.depth, brightness & 0xFF) + 127;
59 59
@@ -61,14 +61,14 @@ void gray_set_foreground(int brightness)
61} 61}
62 62
63/* Return the current foreground shade */ 63/* Return the current foreground shade */
64int gray_get_foreground(void) 64unsigned gray_get_foreground(void)
65{ 65{
66 return (_gray_info.fg_brightness * 255 + (_gray_info.depth >> 1)) 66 return (_gray_info.fg_brightness * 255 + (_gray_info.depth >> 1))
67 / _gray_info.depth; 67 / _gray_info.depth;
68} 68}
69 69
70/* Set the background shade for subsequent drawing operations */ 70/* Set the background shade for subsequent drawing operations */
71void gray_set_background(int brightness) 71void gray_set_background(unsigned brightness)
72{ 72{
73 unsigned data = MULU16(_gray_info.depth, brightness & 0xFF) + 127; 73 unsigned data = MULU16(_gray_info.depth, brightness & 0xFF) + 127;
74 74
@@ -76,14 +76,14 @@ void gray_set_background(int brightness)
76} 76}
77 77
78/* Return the current background shade */ 78/* Return the current background shade */
79int gray_get_background(void) 79unsigned gray_get_background(void)
80{ 80{
81 return (_gray_info.bg_brightness * 255 + (_gray_info.depth >> 1)) 81 return (_gray_info.bg_brightness * 255 + (_gray_info.depth >> 1))
82 / _gray_info.depth; 82 / _gray_info.depth;
83} 83}
84 84
85/* Set draw mode, foreground and background shades at once */ 85/* Set draw mode, foreground and background shades at once */
86void gray_set_drawinfo(int mode, int fg_brightness, int bg_brightness) 86void gray_set_drawinfo(int mode, unsigned fg_brightness, unsigned bg_brightness)
87{ 87{
88 gray_set_drawmode(mode); 88 gray_set_drawmode(mode);
89 gray_set_foreground(fg_brightness); 89 gray_set_foreground(fg_brightness);