diff options
author | Matthias Richter <vrld@vrld.org> | 2013-04-08 15:52:20 +0200 |
---|---|---|
committer | Matthias Richter <vrld@vrld.org> | 2013-04-08 15:52:20 +0200 |
commit | 63124bd1faa4f87ce95e8c4d32aae92971781627 (patch) | |
tree | 726f06921fa033158b734f87f4b0f2f6c03c2bf4 | |
parent | 54f9222990985cec2e48ab6d41a1963d4d613141 (diff) | |
download | Quickie-63124bd1faa4f87ce95e8c4d32aae92971781627.tar.gz Quickie-63124bd1faa4f87ce95e8c4d32aae92971781627.tar.bz2 Quickie-63124bd1faa4f87ce95e8c4d32aae92971781627.tar.xz Quickie-63124bd1faa4f87ce95e8c4d32aae92971781627.zip |
Remove save_(un)pack
-rw-r--r-- | core.lua | 20 |
1 files changed, 2 insertions, 18 deletions
@@ -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, } |