From 0a41e6b3c4afa819a2a4bc965bd3011493f1f55e Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 23 May 2014 01:57:19 +0200 Subject: [PATCH] Fix Windows compilation of lightmap_optimizer --- code/nel/tools/3d/lightmap_optimizer/main.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/code/nel/tools/3d/lightmap_optimizer/main.cpp b/code/nel/tools/3d/lightmap_optimizer/main.cpp index 25b5678ea..3323cce40 100644 --- a/code/nel/tools/3d/lightmap_optimizer/main.cpp +++ b/code/nel/tools/3d/lightmap_optimizer/main.cpp @@ -33,12 +33,13 @@ #include "nel/3d/register_3d.h" #ifdef NL_OS_WINDOWS - #include +# include #else - #include /* for directories functions */ - #include - #include - #include /* getcwd, chdir -- replacement for getCurDiretory & setCurDirectory on windows */ +# define strnicmp NLMISC::strnicmp +# include /* for directories functions */ +# include +# include +# include /* getcwd, chdir -- replacement for getCurDiretory & setCurDirectory on windows */ #endif @@ -72,7 +73,8 @@ void dir (const std::string &sFilter, std::vector &sAllFiles, bool char sCurDir[MAX_PATH]; sAllFiles.clear (); GetCurrentDirectory (MAX_PATH, sCurDir); - hFind = FindFirstFile ("*"+sFilter.c_str(), &findData); + std::string sFilterAsx = std::string("*") + sFilter; + hFind = FindFirstFile (sFilterAsx.c_str(), &findData); while (hFind != INVALID_HANDLE_VALUE) { DWORD res = GetFileAttributes(findData.cFileName); @@ -626,7 +628,7 @@ int main(int nNbArg, char **ppArgs) outString(string("ERROR: lightmaps ")+sTmp2+"*.tga not all the same size\n"); for (k = 0; k < (sint32)AllLightmapNames.size(); ++k) { - if (NLMISC::strnicmp(AllLightmapNames[k].c_str(), sTmp2.c_str(), sTmp2.size()) == 0) + if (strnicmp(AllLightmapNames[k].c_str(), sTmp2.c_str(), sTmp2.size()) == 0) { for (j = k+1; j < (sint32)AllLightmapNames.size(); ++j) {