diff options
author | Simon Howard | 2007-02-01 12:21:14 +0000 |
---|---|---|
committer | Simon Howard | 2007-02-01 12:21:14 +0000 |
commit | 2f38d73f55a8927ceca131e74874d1d544d11fac (patch) | |
tree | b8b1596420e8ead157a4d7a9ed2ede6963dfcda6 /src/d_iwad.c | |
parent | 7a6f9ad53b3917b00d3815ed8d948c69d4d48efd (diff) | |
download | chocolate-doom-2f38d73f55a8927ceca131e74874d1d544d11fac.tar.gz chocolate-doom-2f38d73f55a8927ceca131e74874d1d544d11fac.tar.bz2 chocolate-doom-2f38d73f55a8927ceca131e74874d1d544d11fac.zip |
Search IWAD search directories when loading PWAD files.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 830
Diffstat (limited to 'src/d_iwad.c')
-rw-r--r-- | src/d_iwad.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/d_iwad.c b/src/d_iwad.c index f352f1c2..1b3c29f1 100644 --- a/src/d_iwad.c +++ b/src/d_iwad.c @@ -416,10 +416,10 @@ static void BuildIWADDirList(void) } // -// Searches IWAD search paths for an IWAD with a specific name. +// Searches WAD search paths for an WAD with a specific filename. // -char *D_FindIWADByName(char *name) +char *D_FindWADByName(char *name) { char *buf; int i; @@ -457,6 +457,29 @@ char *D_FindIWADByName(char *name) } // +// D_TryWADByName +// +// Searches for a WAD by its filename, or passes through the filename +// if not found. +// + +char *D_TryFindWADByName(char *filename) +{ + char *result; + + result = D_FindWADByName(filename); + + if (result != NULL) + { + return result; + } + else + { + return filename; + } +} + +// // FindIWAD // Checks availability of IWAD files by name, // to determine whether registered/commercial features @@ -490,7 +513,7 @@ char *D_FindIWAD(void) iwadfile = myargv[iwadparm + 1]; - result = D_FindIWADByName(iwadfile); + result = D_FindWADByName(iwadfile); if (result == NULL) { @@ -762,7 +785,7 @@ void D_FindInstalledIWADs(void) for (i=0; i<sizeof(iwads) / sizeof(*iwads); ++i) { - if (D_FindIWADByName(iwads[i].name) != NULL) + if (D_FindWADByName(iwads[i].name) != NULL) { result |= 1 << i; } |