summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2019-08-04 10:35:07 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2019-08-04 17:54:03 +0200
commitd1f349bf772a8374a9c264bcff974d3db7ce32b9 (patch)
tree591b6f0398a7d5530c827c780e55285582a1dbf7 /apps/plugins
parent668eed3147d64c91ec923c22c47e94e8a51b5ff8 (diff)
lua optimize print include, fix draw_poly
Change-Id: Ibb530cfa63681727be518173404952e897c9d297
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/lua/include_lua/draw_poly.lua2
-rw-r--r--apps/plugins/lua/include_lua/print.lua8
-rw-r--r--apps/plugins/lua_scripts/print_lua_func.lua6
3 files changed, 12 insertions, 4 deletions
diff --git a/apps/plugins/lua/include_lua/draw_poly.lua b/apps/plugins/lua/include_lua/draw_poly.lua
index fd76a582b1..0354a5fdfd 100644
--- a/apps/plugins/lua/include_lua/draw_poly.lua
+++ b/apps/plugins/lua/include_lua/draw_poly.lua
@@ -29,6 +29,8 @@
if not rb.lcd_framebuffer then rb.splash(rb.HZ, "No Support!") return nil end
local _poly = {} do
+ -- Internal Constants
+ local rocklib_image = getmetatable(rb.lcd_framebuffer())
local BSAND = 8 -- blits color to dst if src <> 0
local _NIL = nil -- nil placeholder
diff --git a/apps/plugins/lua/include_lua/print.lua b/apps/plugins/lua/include_lua/print.lua
index 87fd11d4b6..5ea0423f01 100644
--- a/apps/plugins/lua/include_lua/print.lua
+++ b/apps/plugins/lua/include_lua/print.lua
@@ -299,23 +299,23 @@ local _print = {} do
end
-- Helper function that acts mostly like a normal printf() would
- local function printf(...)
+ local function printf(fmt, v1, ...)
local o = get_settings(true)
local w, h, msg
local line = o.line - 1 -- rb is 0-based lua is 1-based
- if not (...) or (...) == "\n" then -- handles blank line / single '\n'
+ if not (fmt) or (fmt) == "\n" then -- handles blank line / single '\n'
local res, w, h = text_extent(" ", o.font)
clear_line(o, line, h)
update_line(o.autoupdate, o, line, h)
- if (...) then set_line(_NIL) end
+ if (fmt) then set_line(_NIL) end
return o.line, o.max_line, o.width, h
end
- msg = string.format(...)
+ msg = string.format(fmt, v1, ...)
show_selected(o.line, msg)
diff --git a/apps/plugins/lua_scripts/print_lua_func.lua b/apps/plugins/lua_scripts/print_lua_func.lua
index f2642a187b..ef0290bbd8 100644
--- a/apps/plugins/lua_scripts/print_lua_func.lua
+++ b/apps/plugins/lua_scripts/print_lua_func.lua
@@ -4,7 +4,13 @@ require "audio"
require "buttons"
require "color"
require "draw"
+require "draw_floodfill"
+require "draw_poly"
+require "draw_text"
+
require "image"
+require "image_save"
+
require "lcd"
require "math_ex"
require "pcm"