/*---------------------------------------------------------------------------*/
-static const char *game_path(const char *path)
-{
- if (fs_exists(path))
- return path;
-
- /* Chop off directories until we have a match. */
-
- while ((path = path_next_sep(path)))
- {
- /* Skip separator. */
-
- path += 1;
-
- if (fs_exists(path))
- return path;
- }
-
- return NULL;
-}
-
int main(int argc, char *argv[])
{
SDL_Joystick *joy = NULL;
}
else if (opt_level)
{
- const char *path = game_path(opt_level);
+ const char *path = fs_resolve(opt_level);
int loaded = 0;
if (path)
Array fs_dir_scan(const char *, int (*filter)(struct dir_item *));
void fs_dir_free(Array);
+const char *fs_resolve(const char *);
+
#endif
}
/*---------------------------------------------------------------------------*/
+
+const char *fs_resolve(const char *path)
+{
+ if (fs_exists(path))
+ return path;
+
+ /* Chop off directories until we have a match. */
+
+ while ((path = path_next_sep(path)))
+ {
+ /* Skip separator. */
+
+ path += 1;
+
+ if (fs_exists(path))
+ return path;
+ }
+
+ return NULL;
+}
+
+/*---------------------------------------------------------------------------*/