• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1function tostr(t)
2    local str = ""
3    for k, v in next, t do
4        if #str > 0 then
5            str = str .. ", "
6        end
7        if type(k) == "number" then
8            str = str .. "[" .. k .. "] = "
9        else
10            str = str .. tostring(k) .. " = "
11        end
12        if type(v) == "table" then
13            str = str .. "{ " .. tostr(v) .. " }"
14        else
15            str = str .. tostring(v)
16        end
17    end
18    return str
19end
20
21function sk_scrape_startcanvas(c, fileName) end
22
23function sk_scrape_endcanvas(c, fileName) end
24
25local effects = {}
26
27function count_fields(t)
28    for k, v in next, t do
29        effects[k] = (effects[k] or 0) + 1
30    end
31end
32
33local total_paints = 0;
34
35function sk_scrape_accumulate(t)
36    if (t.paint) then
37        total_paints = total_paints + 1
38        count_fields(t.paint:getEffects())
39    end
40end
41
42function sk_scrape_summarize()
43    io.write("total paints ", total_paints, " ", tostr(effects), "\n");
44end
45
46