From 9a573dfd6c318a88ee8978595cca8f7f14579821 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 6 Feb 2016 00:23:43 +0100 Subject: [PATCH 1/2] Fixed: Don't process again same directory --HG-- branch : develop --- code/ryzom/client/src/init.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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; } } From 8d2e962a7aa946a6ebf6b9c96e3d292126257fcb Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 6 Feb 2016 00:24:06 +0100 Subject: [PATCH 2/2] Fixed: Use %f to display a float --HG-- branch : develop --- code/ryzom/client/src/input.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } }