mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-07 03:48:15 +00:00
REVIEWED: Directory filter tag #4323
This commit is contained in:
10
src/rcore.c
10
src/rcore.c
@@ -251,9 +251,9 @@ unsigned int __stdcall timeEndPeriod(unsigned int uPeriod);
|
|||||||
#define MAX_AUTOMATION_EVENTS 16384 // Maximum number of automation events to record
|
#define MAX_AUTOMATION_EVENTS 16384 // Maximum number of automation events to record
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FILTER_FOLDER
|
#ifndef DIRECTORY_FILTER_TAG
|
||||||
#define FILTER_FOLDER "/DIR" // Filter string used in ScanDirectoryFiles, ScanDirectoryFilesRecursively and LoadDirectoryFilesEx to include directories in the result array
|
#define DIRECTORY_FILTER_TAG "DIR" // Name tag used to request directory inclusion on directory scan
|
||||||
#endif
|
#endif // NOTE: Used in ScanDirectoryFiles(), ScanDirectoryFilesRecursively() and LoadDirectoryFilesEx()
|
||||||
|
|
||||||
// Flags operation macros
|
// Flags operation macros
|
||||||
#define FLAG_SET(n, f) ((n) |= (f))
|
#define FLAG_SET(n, f) ((n) |= (f))
|
||||||
@@ -3353,7 +3353,7 @@ static void ScanDirectoryFiles(const char *basePath, FilePathList *files, const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (TextFindIndex(filter, FILTER_FOLDER) >= 0)
|
if (TextFindIndex(filter, DIRECTORY_FILTER_TAG) >= 0)
|
||||||
{
|
{
|
||||||
strcpy(files->paths[files->count], path);
|
strcpy(files->paths[files->count], path);
|
||||||
files->count++;
|
files->count++;
|
||||||
@@ -3419,7 +3419,7 @@ static void ScanDirectoryFilesRecursively(const char *basePath, FilePathList *fi
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (filter != NULL && TextFindIndex(filter, FILTER_FOLDER) >= 0)
|
if ((filter != NULL) && (TextFindIndex(filter, DIRECTORY_FILTER_TAG) >= 0))
|
||||||
{
|
{
|
||||||
strcpy(files->paths[files->count], path);
|
strcpy(files->paths[files->count], path);
|
||||||
files->count++;
|
files->count++;
|
||||||
|
Reference in New Issue
Block a user