mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 19:50:45 +00:00
3697842bc5
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
25 lines
576 B
Lua
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
|