summaryrefslogtreecommitdiff
path: root/src/fileio.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-18 11:04:12 +0000
committerrubidium <rubidium@openttd.org>2007-06-18 11:04:12 +0000
commit5718743722122a7a9f53925b5a5a015b3a9e16cb (patch)
tree468aa0cdfe3932fe95960f971648f8b2bbf74a38 /src/fileio.h
parent3ccc83e64062b95f8ae1d6a7c7afde3224b03b63 (diff)
downloadopenttd-5718743722122a7a9f53925b5a5a015b3a9e16cb.tar.xz
(svn r10198) -Fix (r10194): did not search all search paths.
Diffstat (limited to 'src/fileio.h')
-rw-r--r--src/fileio.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/fileio.h b/src/fileio.h
index 15047f7c5..8596dc123 100644
--- a/src/fileio.h
+++ b/src/fileio.h
@@ -40,12 +40,13 @@ enum Subdirectory {
* Types of searchpaths OpenTTD might use
*/
enum Searchpath {
- SP_WORKING_DIR, ///< Search in the working directory
- SP_PERSONAL_DIR, ///< Search in the personal directory
- SP_SHARED_DIR, ///< Search in the shared directory, like 'Shared Files' under Windows
- SP_BINARY_DIR, ///< Search in the directory where the binary resides
- SP_INSTALLATION_DIR, ///< Search in the installation directory
- SP_APPLICATION_BUNDLE_DIR, ///< Search within the application bundle
+ SP_FIRST_DIR,
+ SP_WORKING_DIR = SP_FIRST_DIR, ///< Search in the working directory
+ SP_PERSONAL_DIR, ///< Search in the personal directory
+ SP_SHARED_DIR, ///< Search in the shared directory, like 'Shared Files' under Windows
+ SP_BINARY_DIR, ///< Search in the directory where the binary resides
+ SP_INSTALLATION_DIR, ///< Search in the installation directory
+ SP_APPLICATION_BUNDLE_DIR, ///< Search within the application bundle
NUM_SEARCHPATHS
};
@@ -70,7 +71,7 @@ static inline bool IsValidSearchPath(Searchpath sp)
}
/** Iterator for all the search paths */
-#define FOR_ALL_SEARCHPATHS(sp) for (sp = SP_PERSONAL_DIR; sp < NUM_SEARCHPATHS; sp++) if (IsValidSearchPath(sp))
+#define FOR_ALL_SEARCHPATHS(sp) for (sp = SP_FIRST_DIR; sp < NUM_SEARCHPATHS; sp++) if (IsValidSearchPath(sp))
FILE *FioFOpenFile(const char *filename, const char *mode = "rb", Subdirectory subdir = DATA_DIR);
bool FioCheckFileExists(const char *filename, Subdirectory subdir = DATA_DIR);