Changed: #964 Allow disabling of consistency check in rbank build tool, because it's immensely slow.

This commit is contained in:
kaetemi 2010-06-07 07:36:00 +02:00
parent 85d980b816
commit 401dafe705
3 changed files with 35 additions and 25 deletions

View file

@ -1614,6 +1614,8 @@ void NLPACS::CZoneTessellation::generateBorders(float smooth)
sint lsurf = cborder.Left;
sint rsurf = cborder.Right;
if (CheckConsistency)
{
if (lsurf >= 0)
{
CComputableSurface& surf = Surfaces[lsurf];
@ -1622,7 +1624,6 @@ void NLPACS::CZoneTessellation::generateBorders(float smooth)
nlwarning("Before smooth of border '%d', surface '%d' not consistent", border, lsurf);
}
}
if (rsurf >= 0)
{
CComputableSurface& surf = Surfaces[rsurf];
@ -1631,6 +1632,7 @@ void NLPACS::CZoneTessellation::generateBorders(float smooth)
nlwarning("Before smooth of border '%d', surface '%d' not consistent", border, rsurf);
}
}
}
float smScale = (Borders[border].Right < 0) ? 0.2f : 1.0f;
uint before = (uint)Borders[border].Vertices.size();
@ -1643,6 +1645,8 @@ void NLPACS::CZoneTessellation::generateBorders(float smooth)
totalBefore += before;
totalAfter += after;
if (CheckConsistency)
{
if (lsurf >= 0)
{
CComputableSurface& surf = Surfaces[lsurf];
@ -1651,7 +1655,6 @@ void NLPACS::CZoneTessellation::generateBorders(float smooth)
nlwarning("After smooth of border '%d', surface '%d' not consistent", border, lsurf);
}
}
if (rsurf >= 0)
{
CComputableSurface& surf = Surfaces[rsurf];
@ -1661,6 +1664,7 @@ void NLPACS::CZoneTessellation::generateBorders(float smooth)
}
}
}
}
if (Verbose)
nlinfo("smooth process: %d -> %d (%.1f percent reduction)", totalBefore, totalAfter, 100.0*(1.0-(double)totalAfter/(double)totalBefore));
}

View file

@ -77,6 +77,7 @@ extern std::string GlobalUL;
extern std::string GlobalDR;
extern bool ProcessGlobal;
extern bool Verbose;
extern bool CheckConsistency;
extern CPrimChecker PrimChecker;
@ -392,6 +393,7 @@ public:
template<class A>
void floodFill(CSurfElement *first, sint32 surfId, const A &cmp, CZoneTessellation *zoneTessel)
{
if (Verbose)
nldebug("flood fill surface %d", surfId);
std::vector<CSurfElement *> stack;
@ -433,6 +435,7 @@ public:
}
}
if (Verbose)
nldebug("%d elements added", Elements.size());
Center = NLMISC::CVector::Null;

View file

@ -86,6 +86,7 @@ string LevelDesignWorldPath;
string IgLandPath;
string IgVillagePath;
bool Verbose = false;
bool CheckConsistency = true;
CPrimChecker PrimChecker;
@ -187,6 +188,8 @@ void initMoulinette()
WaterThreshold = getFloat(cf, "WaterThreshold", 1.0);
CheckConsistency = getBool(cf, "CheckConsistency", true);
//if (TessellateZones || MoulineZones)
{
ZoneExt = getString(cf, "ZoneExt", ".zonew");