From e759674bec2b756ebd9417d581fe564492a74f57 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 19 Sep 2010 23:14:07 +0200 Subject: [PATCH] Changed: #964 Allow setting hls info dir in panoply config. --- .../tools/3d/panoply_maker/panoply_maker.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/code/nel/tools/3d/panoply_maker/panoply_maker.cpp b/code/nel/tools/3d/panoply_maker/panoply_maker.cpp index 933ec4e0d..9f51d86f7 100644 --- a/code/nel/tools/3d/panoply_maker/panoply_maker.cpp +++ b/code/nel/tools/3d/panoply_maker/panoply_maker.cpp @@ -38,7 +38,7 @@ using namespace std; string DivideBy2Dir= "/d4/"; -string HlsInfoDir= "hlsInfo/"; +//string HlsInfoDir= "hlsInfo/"; // ======================================================================================================== @@ -57,6 +57,7 @@ struct CBuildInfo { std::string InputPath; std::string OutputPath; + std::string HlsInfoPath; std::string CachePath; std::vector BitmapExtensions; // the supported extension for bitmaps std::string OutputFormat; // png or tga @@ -277,6 +278,16 @@ int main(int argc, char* argv[]) { } + /// hls info path + try + { + bi.HlsInfoPath = NLMISC::CPath::standardizePath(cf.getVar("hls_info_path").asString()); + } + catch (NLMISC::EUnknownVar &) + { + bi.HlsInfoPath = "hlsInfo/"; + } + /// output try { @@ -533,7 +544,7 @@ static bool CheckIfNeedRebuildColoredVersionForOneBitmap(const CBuildInfo &bi, c } // get hls info version that is in the cache. if not possible, must rebuild - std::string outputHLSInfo = HlsInfoDir + fileName + ".hlsinfo"; + std::string outputHLSInfo = bi.HlsInfoPath + fileName + ".hlsinfo"; std::string cacheHLSInfo = bi.CachePath + fileName + ".hlsinfo"; if (!NLMISC::CFile::fileExists(cacheHLSInfo.c_str()) ) return true; @@ -843,13 +854,13 @@ static void BuildColoredVersionForOneBitmap(const CBuildInfo &bi, const std::str // **** save the TMP hlsInfo NLMISC::COFile os; - if (os.open(HlsInfoDir + fileName + ".hlsinfo")) + if (os.open(bi.HlsInfoPath + fileName + ".hlsinfo")) { os.serial(hlsInfo); } else { - nlwarning(("Couldn't write " + HlsInfoDir + fileName + ".hlsinfo").c_str()); + nlwarning(("Couldn't write " + bi.HlsInfoPath + fileName + ".hlsinfo").c_str()); } }