raze-gles/polymer/eduke32/source/lunatic/mapstats.lua
helixhorned 3697842bc5 Add ART loader for the LuaJIT BUILD struct loader module, 2 more examples.
The map iterator now has init/finish capability, making it possible to
write scripts that aggregate data over multiple map files.  One such example
calculates some statistics, the other loads art metadata and looks for
red walls with non-pow2 ysize tiles.

git-svn-id: https://svn.eduke32.com/eduke32@2814 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:11 +00:00

25 lines
576 B
Lua

-- Print out some statistics for a BUILD map,
-- foreachmap module.
local string = require "string"
local print = print
module(...)
local function printf(fmt, ...)
print(string.format(fmt, ...))
end
function success(map, fn)
printf("--- %s:", fn)
printf(" version: %d", map.version)
printf(" numsectors: %d\n numwalls: %d\n numsprites: %d",
map.numsectors, map.numwalls, map.numsprites)
printf(" walls/sector: %.02f\n sprites/sector: %.02f",
map.numwalls/map.numsectors, map.numsprites/map.numsectors)
printf("")
end