From deb29392c58b08d58bb3ce7650717ae7d4ece655 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 7 Jun 2010 07:36:00 +0200 Subject: [PATCH] Changed: #964 Allow disabling of consistency check in rbank build tool, because it's immensely slow. --- .../nel/tools/pacs/build_rbank/build_surf.cpp | 50 ++++++++++--------- code/nel/tools/pacs/build_rbank/build_surf.h | 7 ++- code/nel/tools/pacs/build_rbank/main.cpp | 3 ++ 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/code/nel/tools/pacs/build_rbank/build_surf.cpp b/code/nel/tools/pacs/build_rbank/build_surf.cpp index 98e452a03..1500e9543 100644 --- a/code/nel/tools/pacs/build_rbank/build_surf.cpp +++ b/code/nel/tools/pacs/build_rbank/build_surf.cpp @@ -1614,21 +1614,23 @@ void NLPACS::CZoneTessellation::generateBorders(float smooth) sint lsurf = cborder.Left; sint rsurf = cborder.Right; - if (lsurf >= 0) + if (CheckConsistency) { - CComputableSurface& surf = Surfaces[lsurf]; - if (!surf.checkConsistency()) + if (lsurf >= 0) { - nlwarning("Before smooth of border '%d', surface '%d' not consistent", border, lsurf); + CComputableSurface& surf = Surfaces[lsurf]; + if (!surf.checkConsistency()) + { + nlwarning("Before smooth of border '%d', surface '%d' not consistent", border, lsurf); + } } - } - - if (rsurf >= 0) - { - CComputableSurface& surf = Surfaces[rsurf]; - if (!surf.checkConsistency()) + if (rsurf >= 0) { - nlwarning("Before smooth of border '%d', surface '%d' not consistent", border, rsurf); + CComputableSurface& surf = Surfaces[rsurf]; + if (!surf.checkConsistency()) + { + nlwarning("Before smooth of border '%d', surface '%d' not consistent", border, rsurf); + } } } @@ -1642,22 +1644,24 @@ void NLPACS::CZoneTessellation::generateBorders(float smooth) uint after = (uint)Borders[border].Vertices.size(); totalBefore += before; totalAfter += after; - - if (lsurf >= 0) + + if (CheckConsistency) { - CComputableSurface& surf = Surfaces[lsurf]; - if (!surf.checkConsistency()) + if (lsurf >= 0) { - nlwarning("After smooth of border '%d', surface '%d' not consistent", border, lsurf); + CComputableSurface& surf = Surfaces[lsurf]; + if (!surf.checkConsistency()) + { + nlwarning("After smooth of border '%d', surface '%d' not consistent", border, lsurf); + } } - } - - if (rsurf >= 0) - { - CComputableSurface& surf = Surfaces[rsurf]; - if (!surf.checkConsistency()) + if (rsurf >= 0) { - nlwarning("After smooth of border '%d', surface '%d' not consistent", border, rsurf); + CComputableSurface& surf = Surfaces[rsurf]; + if (!surf.checkConsistency()) + { + nlwarning("After smooth of border '%d', surface '%d' not consistent", border, rsurf); + } } } } diff --git a/code/nel/tools/pacs/build_rbank/build_surf.h b/code/nel/tools/pacs/build_rbank/build_surf.h index 2a62268fe..0e8849bb5 100644 --- a/code/nel/tools/pacs/build_rbank/build_surf.h +++ b/code/nel/tools/pacs/build_rbank/build_surf.h @@ -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,7 +393,8 @@ public: template void floodFill(CSurfElement *first, sint32 surfId, const A &cmp, CZoneTessellation *zoneTessel) { - nldebug("flood fill surface %d", surfId); + if (Verbose) + nldebug("flood fill surface %d", surfId); std::vector stack; sint i; @@ -433,7 +435,8 @@ public: } } - nldebug("%d elements added", Elements.size()); + if (Verbose) + nldebug("%d elements added", Elements.size()); Center = NLMISC::CVector::Null; for (i=0; i<(sint)Elements.size(); ++i) diff --git a/code/nel/tools/pacs/build_rbank/main.cpp b/code/nel/tools/pacs/build_rbank/main.cpp index e5f5be80f..82e6a5724 100644 --- a/code/nel/tools/pacs/build_rbank/main.cpp +++ b/code/nel/tools/pacs/build_rbank/main.cpp @@ -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");