aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Richter <vrld@vrld.org>2013-04-08 15:52:20 +0200
committerMatthias Richter <vrld@vrld.org>2013-04-08 15:52:20 +0200
commit63124bd1faa4f87ce95e8c4d32aae92971781627 (patch)
tree726f06921fa033158b734f87f4b0f2f6c03c2bf4
parent54f9222990985cec2e48ab6d41a1963d4d613141 (diff)
downloadQuickie-63124bd1faa4f87ce95e8c4d32aae92971781627.tar.gz
Quickie-63124bd1faa4f87ce95e8c4d32aae92971781627.tar.bz2
Quickie-63124bd1faa4f87ce95e8c4d32aae92971781627.tar.xz
Quickie-63124bd1faa4f87ce95e8c4d32aae92971781627.zip
Remove save_(un)pack
-rw-r--r--core.lua20
1 files changed, 2 insertions, 18 deletions
diff --git a/core.lua b/core.lua
index 533ab96..cbccbae 100644
--- a/core.lua
+++ b/core.lua
@@ -48,20 +48,6 @@ local function strictOr(...)
return ret
end
--- allow packed nil
-local function save_pack(...)
- return {n = select('#', ...), ...}
-end
-
-local function save_unpack_helper(t, i, ...)
- if i <= 0 then return ... end
- return save_unpack_helper(t, i-1, t[i], ...)
-end
-
-local function save_unpack(t)
- return save_unpack_helper(t, t.n)
-end
-
--
-- Widget ID
--
@@ -90,11 +76,11 @@ local function registerDraw(id, f, ...)
if mouse.isHot(id) or keyboard.hasFocus(id) then
state = mouse.isActive(id) and 'active' or 'hot'
end
- local rest = save_pack(...)
+ local rest = {n = select('#', ...), ...}
draw_items.n = draw_items.n + 1
draw_items[draw_items.n] = function()
if font then love.graphics.setFont(font) end
- f(state, save_unpack(rest))
+ f(state, unpack(rest, 1, rest.n))
end
end
@@ -137,6 +123,4 @@ return {
strictAnd = strictAnd,
strictOr = strictOr,
- save_pack = save_pack,
- save_unpack = save_unpack,
}