summaryrefslogtreecommitdiff
path: root/src/m_misc.c
diff options
context:
space:
mode:
authorSimon Howard2006-12-21 21:43:47 +0000
committerSimon Howard2006-12-21 21:43:47 +0000
commit37c6b72103cc9d7965a669cdca01edae83f765e4 (patch)
tree829da412a95f0138e21ea1122bf756c1bf28d69f /src/m_misc.c
parentf7a83bd1057494c688acfaff9c1453ac4be34711 (diff)
downloadchocolate-doom-37c6b72103cc9d7965a669cdca01edae83f765e4.tar.gz
chocolate-doom-37c6b72103cc9d7965a669cdca01edae83f765e4.tar.bz2
chocolate-doom-37c6b72103cc9d7965a669cdca01edae83f765e4.zip
Split off IWAD-related code into separate d_iwad.c. On Windows, search
the registry to automatically find the locations of installed IWADs. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 791
Diffstat (limited to 'src/m_misc.c')
-rw-r--r--src/m_misc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/m_misc.c b/src/m_misc.c
index 5930140c..42736371 100644
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -122,6 +122,25 @@ void M_MakeDirectory(char *path)
#endif
}
+// Check if a file exists
+
+boolean M_FileExists(char *filename)
+{
+ FILE *fstream;
+
+ fstream = fopen(filename, "r");
+
+ if (fstream != NULL)
+ {
+ fclose(fstream);
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+