diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-11-16 21:09:23 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-11-16 21:09:23 +0000 |
commit | 5b2cba17aa95ececfdb6a498540de4dfa215e920 (patch) | |
tree | 3574eab7dc84f588268b72f6db56744fcc4d0e64 /apps/plugins/lib | |
parent | 15046f99b3840c07bdd9d52e7014c6e775267c55 (diff) | |
download | rockbox-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')
-rw-r--r-- | apps/plugins/lib/gray.h | 10 | ||||
-rw-r--r-- | apps/plugins/lib/gray_parm.c | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/apps/plugins/lib/gray.h b/apps/plugins/lib/gray.h index dadac9298f..f82cf389c3 100644 --- a/apps/plugins/lib/gray.h +++ b/apps/plugins/lib/gray.h | |||
@@ -51,11 +51,11 @@ void gray_update_rect(int x, int y, int width, int height); | |||
51 | void gray_set_position(int x, int by); | 51 | void gray_set_position(int x, int by); |
52 | void gray_set_drawmode(int mode); | 52 | void gray_set_drawmode(int mode); |
53 | int gray_get_drawmode(void); | 53 | int gray_get_drawmode(void); |
54 | void gray_set_foreground(int brightness); | 54 | void gray_set_foreground(unsigned brightness); |
55 | int gray_get_foreground(void); | 55 | unsigned gray_get_foreground(void); |
56 | void gray_set_background(int brightness); | 56 | void gray_set_background(unsigned brightness); |
57 | int gray_get_background(void); | 57 | unsigned gray_get_background(void); |
58 | void gray_set_drawinfo(int mode, int fg_brightness, int bg_brightness); | 58 | void gray_set_drawinfo(int mode, unsigned fg_brightness, unsigned bg_brightness); |
59 | void gray_setfont(int newfont); | 59 | void gray_setfont(int newfont); |
60 | int gray_getstringsize(const unsigned char *str, int *w, int *h); | 60 | int gray_getstringsize(const unsigned char *str, int *w, int *h); |
61 | 61 | ||
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 */ |
56 | void gray_set_foreground(int brightness) | 56 | void 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 */ |
64 | int gray_get_foreground(void) | 64 | unsigned 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 */ |
71 | void gray_set_background(int brightness) | 71 | void 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 */ |
79 | int gray_get_background(void) | 79 | unsigned 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 */ |
86 | void gray_set_drawinfo(int mode, int fg_brightness, int bg_brightness) | 86 | void 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); |