diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index faa83b51c..828506c2d 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -678,12 +678,9 @@ static void addPaths(IProgressCallback &progress, const std::vector if (CFile::isDirectory(getRyzomSharePrefix())) directoryPrefixes.push_back(CPath::standardizePath(getRyzomSharePrefix())); #endif - std::vector directoriesToProcess; + std::map directoriesToProcess; - // reserve maximum memory space for all combinations - directoriesToProcess.reserve(directoryPrefixes.size() * paths.size()); - - // first pass, build a vector with all existing directories to process in second pass + // first pass, build a map with all existing directories to process in second pass for (uint j = 0; j < directoryPrefixes.size(); j++) { std::string directoryPrefix = directoryPrefixes[j]; @@ -698,15 +695,17 @@ static void addPaths(IProgressCallback &progress, const std::vector // only process existing directories if (CFile::isExists(directory)) - directoriesToProcess.push_back(directory); + directoriesToProcess[directory] = 1; } } uint total = (uint)directoriesToProcess.size(); uint current = 0, next = 0; + std::map::const_iterator it = directoriesToProcess.begin(), iend = directoriesToProcess.end(); + // second pass, add search paths - for (uint i = 0, len = directoriesToProcess.size(); i < len; ++i) + while (it != iend) { // update next progress value ++next; @@ -717,9 +716,11 @@ static void addPaths(IProgressCallback &progress, const std::vector // next is current value current = next; - CPath::addSearchPath(directoriesToProcess[i], recurse, false, &progress); + CPath::addSearchPath(it->first, recurse, false, &progress); progress.popCropedValues(); + + ++it; } } diff --git a/code/ryzom/client/src/input.cpp b/code/ryzom/client/src/input.cpp index 6d0834f07..403947538 100644 --- a/code/ryzom/client/src/input.cpp +++ b/code/ryzom/client/src/input.cpp @@ -112,7 +112,7 @@ bool InitMouseWithCursor (bool hardware) } else if (width != 0 && height != 0) { - nlwarning("mouse pos %u, %u", x, y); + nlwarning("Mouse pos %f, %f", x, y); Driver->setMousePos(x / width, y / height); } }