PATCH: x86UNIXFileio.cc ignores recursion depth
by Todd "zaz" Koeckeritz · in Torque Game Engine · 07/21/2006 (12:48 pm) · 1 replies
The Linux version of Platform::dumpPath failed to pass recurseDepth/depth to Platform::RecurseDumpPath. This patch fixes that.
I noticed that uses of GuiDirectoryFileListCtrl::setCurrentPath used for picking terrain painting textures and loading shapes for the show mod, showed all of the matching file types from the entire directory tree, not just those from the selected/current directory. I tracked the problem down to the lack of honoring the depth parameter to Platform::dumpPath.
You can download the patch here for now: x86UNIXFileio.cc-recurse.patch.
Here's alternative access to the patch in a code block:
I'll drop a pointer in the linux forum to this post and send an email to Ron so he's aware.
I noticed that uses of GuiDirectoryFileListCtrl::setCurrentPath used for picking terrain painting textures and loading shapes for the show mod, showed all of the matching file types from the entire directory tree, not just those from the selected/current directory. I tracked the problem down to the lack of honoring the depth parameter to Platform::dumpPath.
You can download the patch here for now: x86UNIXFileio.cc-recurse.patch.
Here's alternative access to the patch in a code block:
Index: engine/platformX86UNIX/x86UNIXFileio.cc
===================================================================
RCS file: /cvs/torque/torque/engine/platformX86UNIX/x86UNIXFileio.cc,v
retrieving revision 2.7
diff -w -u -r2.7 x86UNIXFileio.cc
--- engine/platformX86UNIX/x86UNIXFileio.cc 2006/03/12 17:33:00 2.7
+++ engine/platformX86UNIX/x86UNIXFileio.cc 2006/07/21 19:45:57
@@ -307,7 +307,7 @@
}
//-----------------------------------------------------------------------------
- static bool RecurseDumpPath(const char *path, const char* relativePath, const char *pattern, Vector<Platform::FileInfo> &fileVector)
+static bool RecurseDumpPath(const char *path, const char* relativePath, const char *pattern, Vector<Platform::FileInfo> &fileVector, int recurseDepth)
{
char search[1024];
@@ -354,7 +354,11 @@
relativePath, fEntry->d_name);
childRelative = childRelativeBuf;
}
- RecurseDumpPath(child, childRelative, pattern, fileVector);
+
+ if (recurseDepth > 0)
+ RecurseDumpPath(child, childRelative, pattern, fileVector, recurseDepth - 1);
+ else if (recurseDepth == -1)
+ RecurseDumpPath(child, childRelative, pattern, fileVector, -1);
}
else
{
@@ -867,7 +871,7 @@
{
char prefPathName[MaxPath];
MungePath(prefPathName, MaxPath, path, GetPrefDir());
- RecurseDumpPath(prefPathName, path, pattern, fileVector);
+ RecurseDumpPath(prefPathName, path, pattern, fileVector, depth);
}
// munge the requested path and dump it
@@ -875,7 +879,7 @@
char cwd[MaxPath];
getcwd(cwd, MaxPath);
MungePath(mungedPath, MaxPath, path, cwd);
- return RecurseDumpPath(mungedPath, path, pattern, fileVector);
+ return RecurseDumpPath(mungedPath, path, pattern, fileVector, depth);
}
//-----------------------------------------------------------------------------I'll drop a pointer in the linux forum to this post and send an email to Ron so he's aware.
About the author
Torque Owner David .NfoCipher. Bunt
Default Studio Name