From 761ae6c116ff452787724c0f05f6a99dccf14067 Mon Sep 17 00:00:00 2001 From: ac_stef Date: Fri, 3 Jul 2009 20:42:51 +0000 Subject: [PATCH] map ressource statistics: don't count hidden cubes git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4568 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/worldio.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index cceb97af..43a5acff 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -497,13 +497,17 @@ void listmapdependencies(char *mapname) // print map dependencies to file fprintf(f, "map: \"%s\"\n", cgzname); int texuse[256] = { 0 }; - loopk(cubicsize) + loopj(ssize - 2) { - sqr *s = &world[k]; - char ttexuse[256] = { 0 }; - ttexuse[s->wtex] = 1; - if(!SOLID(s)) ttexuse[s->utex] = ttexuse[s->ftex] = ttexuse[s->ctex] = 1; - loopi(256) texuse[i] += ttexuse[i]; + loopk(ssize - 2) + { + if(SOLID(S(j + 1, k + 1)) && texuse[S(j + 1, k + 1)->wtex] && SOLID(S(j, k + 1)) && SOLID(S(j + 1, k)) && SOLID(S(j + 2, k + 1)) && SOLID(S(j + 1, k + 2))) continue; // no side visible + sqr *s = S(j + 1, k + 1); + char ttexuse[256] = { 0 }; + ttexuse[s->wtex] = 1; + if(!SOLID(s)) ttexuse[s->utex] = ttexuse[s->ftex] = ttexuse[s->ctex] = 1; + loopi(256) texuse[i] += ttexuse[i]; + } } extern vector mapmodels; loopv(ents) if(ents[i].type == MAPMODEL && mapmodels.inrange(ents[i].attr2) && ents[i].attr4) texuse[ents[i].attr4]++;