summaryrefslogtreecommitdiff
path: root/apps/plugins/helloworld.lua
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-06-15 13:46:10 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-06-15 13:46:10 +0000
commit153ac73c04ec06a2402c78cf24b8a8908749c70d (patch)
tree6f9014dad17ca80c163fcf079f74b7b6e8517e7c /apps/plugins/helloworld.lua
parente55bdff3509fa978f4a8c9b7a62c662bba401d33 (diff)
downloadrockbox-153ac73c04ec06a2402c78cf24b8a8908749c70d.tar.gz
rockbox-153ac73c04ec06a2402c78cf24b8a8908749c70d.zip
Fix helloworld.lua for mono targets (+ add lcd_mono_bitmap() & lcd_mono_bitmap_part() to Lua API)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21291 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/helloworld.lua')
-rw-r--r--apps/plugins/helloworld.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/plugins/helloworld.lua b/apps/plugins/helloworld.lua
index 047e31a644..c0e75540c7 100644
--- a/apps/plugins/helloworld.lua
+++ b/apps/plugins/helloworld.lua
@@ -35,7 +35,10 @@ function draw_image(img)
35 35
36 local func = rb.lcd_bitmap_transparent_part 36 local func = rb.lcd_bitmap_transparent_part
37 if(func == nil) then 37 if(func == nil) then
38 func = rb.lcd_bitmap_part -- Fallback version for mono targets 38 func = rb.lcd_bitmap_part -- Fallback version for grayscale targets
39 if(func == nil) then
40 func = rb.lcd_mono_bitmap_part -- Fallback version for mono targets
41 end
39 end 42 end
40 func(img, 0, 0, img:width(), x, y, img:width(), img:height()) 43 func(img, 0, 0, img:width(), x, y, img:width(), img:height())
41 rb.lcd_update() 44 rb.lcd_update()
@@ -120,6 +123,9 @@ end
120local backdrop = rb.read_bmp_file("/.rockbox/icons/tango_small_viewers.bmp") -- This image should always be present? 123local backdrop = rb.read_bmp_file("/.rockbox/icons/tango_small_viewers.bmp") -- This image should always be present?
121if(backdrop == nil) then 124if(backdrop == nil) then
122 backdrop = rb.read_bmp_file("/.rockbox/icons/tango_small_viewers_mono.bmp") -- Try using the mono version 125 backdrop = rb.read_bmp_file("/.rockbox/icons/tango_small_viewers_mono.bmp") -- Try using the mono version
126 if(backdrop == nil) then
127 backdrop = rb.read_bmp_file("/.rockbox/icons/viewers.bmp") -- Try using the builtin version
128 end
123end 129end
124-- Draws the image using our own draw_image() function; see up 130-- Draws the image using our own draw_image() function; see up
125draw_image(backdrop) 131draw_image(backdrop)