summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2018-07-24 07:09:01 +0200
committerWilliam Wilgus <me.theuser@yahoo.com>2018-07-24 07:09:01 +0200
commitaefdd2061dc8bd0ab0f1219e9ce2d7b59224f6d2 (patch)
tree298951e452828a77363c9c11658d392a2d4f279f
parentaf35d1991633f33965801dcb153a9860c4432816 (diff)
downloadrockbox-aefdd20.tar.gz
rockbox-aefdd20.zip
Lua Fix image saving for 32 bit targets -- update make file
Hopefully this will fix the build faliures for a few targets Change-Id: I68f6c85513ef589e5f6a50a8efc7bfae9fd62acd
-rw-r--r--apps/plugins/lua/include_lua/image.lua26
-rw-r--r--apps/plugins/lua/lua.make6
2 files changed, 22 insertions, 10 deletions
diff --git a/apps/plugins/lua/include_lua/image.lua b/apps/plugins/lua/include_lua/image.lua
index c30e8ab556..71c6c46b1b 100644
--- a/apps/plugins/lua/include_lua/image.lua
+++ b/apps/plugins/lua/include_lua/image.lua
@@ -235,9 +235,12 @@ local _img = {} do
elseif depth <= 16 then
bpp = 16
bypl = (w * 2 + 3)
- else
+ elseif depth <= 24 then
bpp = 24
bypl = (w * 3 + 3)
+ else
+ bpp = 32
+ bypl = (w * 4 + 3)
end
local linebytes = bit.band(bypl, bit.bnot(3))
@@ -294,12 +297,21 @@ local _img = {} do
bmpheader[#bmpheader + 1] = bmp_color_mix(0xFFFFFF, 0, 2, 3)
bmpheader[#bmpheader + 1] = bmp_color(0x0)
elseif depth == 16 then
- -- red bitfield mask
- bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x0000F800)
- -- green bitfield mask
- bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x000007E0)
- -- blue bitfield mask
- bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x0000001F)
+ if format == 565 then
+ -- red bitfield mask
+ bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x0000F800)
+ -- green bitfield mask
+ bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x000007E0)
+ -- blue bitfield mask
+ bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x0000001F)
+ else -- 555
+ -- red bitfield mask
+ bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x00007C00)
+ -- green bitfield mask
+ bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x000003E0)
+ -- blue bitfield mask
+ bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x0000001F)
+ end
end
dump_fbuffer(0) -- write the header to the file now
diff --git a/apps/plugins/lua/lua.make b/apps/plugins/lua/lua.make
index e36ace4759..2d24d7e815 100644
--- a/apps/plugins/lua/lua.make
+++ b/apps/plugins/lua/lua.make
@@ -16,7 +16,7 @@ LUA_OBJ := $(call c2obj, $(LUA_SRC))
OTHER_SRC += $(LUA_SRC)
LUA_INCLUDEDIR := $(LUA_SRCDIR)/include_lua
-LUA_INCLUDELIST = blit color draw image lcd math_ex print timer
+LUA_INCLUDELIST := $(addprefix $(LUA_BUILDDIR)/,blit.lua color.lua draw.lua image.lua lcd.lua math_ex.lua print.lua timer.lua)
ifndef APP_TYPE
ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
@@ -49,8 +49,8 @@ $(LUA_BUILDDIR)/rocklib_aux.c: $(APPSDIR)/plugin.h $(LUA_OBJ) $(LUA_SRCDIR)/rock
$(LUA_BUILDDIR)/rocklib_aux.o: $(LUA_BUILDDIR)/rocklib_aux.c
$(call PRINTS,CC $(<F))$(CC) $(INCLUDES) $(PLUGINFLAGS) -I $(LUA_SRCDIR) -c $< -o $@
-$(LUA_INCLUDELIST): %: $(LUA_INCLUDEDIR)/%.lua
- $(call PRINTS,CP $(subst $(LUA_INCLUDEDIR)/,,$<))cp $< $(LUA_BUILDDIR)/$@.lua
+$(LUA_BUILDDIR)/%.lua: $(LUA_INCLUDEDIR)/%.lua
+ $(call PRINTS,CP $(subst $(LUA_INCLUDEDIR)/,,$<))cp $< $@
$(LUA_BUILDDIR)/lua.refmap: $(LUA_OBJ) $(TLSFLIB)