From 1fab90da10f9dcee3d2e4078c6760ac0b4b0e0bf Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 28 May 2014 22:40:12 +0000 Subject: [PATCH] lunatic/util/mapypan.lua: omit MIRROR, don't print maps w/o problematic tiles. git-svn-id: https://svn.eduke32.com/eduke32@4483 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/lunatic/util/mapypan.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/source/lunatic/util/mapypan.lua b/polymer/eduke32/source/lunatic/util/mapypan.lua index 5b87e3dc8..d226b26e6 100644 --- a/polymer/eduke32/source/lunatic/util/mapypan.lua +++ b/polymer/eduke32/source/lunatic/util/mapypan.lua @@ -33,7 +33,7 @@ function init(arg) end if (artargend==nil or artargend==0) then - printf("Usage: luajit ./foreachmap.lua [, ...] -- ...\n") + printf("Usage: luajit ./foreachmap.lua %s [, ...] -- ...\n", arg[1]) return -1 end @@ -107,15 +107,19 @@ function success(map, fn) if (pic < 0 or pic > 30720) then -- MAXTILES badoverpicnum = true else - ysiz = tile.sizy[pic] - if (bit.band(wall[w].cstat, 16+32)==0) then -- we don't care about non-masked/1-way walls - ysiz = 0 + ysiz = nil + else + ysiz = tile.sizy[pic] end end end + if (pic == 560) then -- Don't care for MIRROR + ysiz = nil + end + if (ysiz~=nil and ysiz > 0 and bit.band(ysiz, bit.bnot(ysiz-1))~=ysiz) then -- non-pow2 ysize @@ -132,6 +136,10 @@ function success(map, fn) -- report our findings + if (#np2walls == 0) then + return + end + -- sort in wall index order table.sort(np2walls)