Index: framework/FileSystem.cpp =================================================================== --- framework/FileSystem.cpp (revision 528) +++ framework/FileSystem.cpp (working copy) @@ -159,7 +159,7 @@ }; // 3 search patch (fs_savepath fs_basepath fs_cdpath) -// .jpg then .tga for +// often .jpg and .tga patterns #define MAX_CACHED_DIRS 6 class idDEntry : public idStrList { @@ -173,6 +173,11 @@ void Init(const char *directory, const char *extension, const idStrList &list ); }; +typedef struct { + idStr path; + idStr OSpath; +} casematch_t; + class idFileSystem_local : public idFileSystem { public: idFileSystem_local( void ); @@ -227,11 +232,14 @@ int numServerPaks; int serverPaks[MAX_SEARCH_PATHS]; - idDEntry dir_cache[MAX_CACHED_DIRS]; // fifo + idDEntry dir_cache[MAX_CACHED_DIRS]; // fifo int dir_cache_index; int dir_cache_count; + + idList dir_case; // match directories in a case insensitive way private: + const char * CaseSearch(const char *in_dir); void ReplaceSeparators( idStr &path, char sep = PATHSEPERATOR_CHAR ); long HashFileName( const char *fname ) const; bool FilenameCompare( const char *s1, const char *s2 ); @@ -1118,6 +1126,89 @@ /* =============== +idFileSystem_local::CaseSearch +=============== +*/ +const char* idFileSystem_local::CaseSearch(const char *in_dir) { + const char *ret; + int i, j; + // FIXME: go faster with a hash? + for( i=0; i=0; i-- ) { + Com_Printf("chunk: %s\n", dirs[i].c_str() ); + bMatched = false; + for( j=0 ; j Index: sys/sys_public.h =================================================================== --- sys/sys_public.h (revision 528) +++ sys/sys_public.h (working copy) @@ -137,6 +137,7 @@ // use fs_debug to verbose Sys_ListFiles // returns -1 if directory was not found (the list is cleared) +// if there is a / passed as extension, return directories int Sys_ListFiles( const char *directory, const char *extension, idStrList &list); // For the mac, we need to explicitly flush vertex buffer areas before using them