From 725ca563878dc8939f0a26a0cb1fb890affcb833 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 19 Feb 2012 15:08:09 +0100 Subject: [PATCH] Changed: Allow build_interface to continue on bad input images, lower error to warning. --HG-- branch : build_pipeline_v3 --- code/nel/tools/3d/build_interface/main.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp index 9150f6b66..1a0ef6ee2 100644 --- a/code/nel/tools/3d/build_interface/main.cpp +++ b/code/nel/tools/3d/build_interface/main.cpp @@ -263,9 +263,10 @@ int main(int nNbArg, char **ppArgs) sint32 i, j; // Load all maps - sint32 mapSize = (sint32)AllMapNames.size(); - AllMaps.resize( mapSize ); - for( i = 0; i < mapSize; ++i ) + //sint32 mapSize = (sint32)AllMapNames.size(); + //AllMaps.resize( mapSize ); + AllMaps.reserve(AllMapNames.size()); + for (std::vector::size_type i = 0; i < AllMapNames.size(); ++i) { try { @@ -276,17 +277,22 @@ int main(int nNbArg, char **ppArgs) NLMISC::CIFile inFile; inFile.open( AllMapNames[i] ); pBtmp->load(inFile); - AllMaps[i] = pBtmp; + AllMaps.push_back(pBtmp); } catch (const NLMISC::Exception &e) { + // Allow the build process to continue without the bad file. + outString (string("ERROR :") + e.what()); - ToolLogger.writeError(PIPELINE::ERROR, AllMapNames[i], e.what()); - ToolLogger.release(); - return -1; + ToolLogger.writeError(PIPELINE::WARNING, AllMapNames[i], e.what()); + + AllMapNames.erase(AllMapNames.begin() + i); + --i; } + nlassert(AllMaps.size() == i + 1); // It's a coding error otherwise. } - + + sint32 mapSize = (sint32)AllMapNames.size(); // Sort all maps by decreasing size for (i = 0; i < mapSize-1; ++i) for (j = i+1; j < mapSize; ++j)