diff options
author | Simon Howard | 2008-10-30 02:10:50 +0000 |
---|---|---|
committer | Simon Howard | 2008-10-30 02:10:50 +0000 |
commit | 091f93809ee554571a6ed6145b8ac69f17814d91 (patch) | |
tree | 25e8e1f92ef66e95f5ab19f5d588562292a02785 /src/hexen/h2_main.c | |
parent | 8c045b4bfee2e859f800f8fbd76f5ae3d5d3f435 (diff) | |
download | chocolate-doom-091f93809ee554571a6ed6145b8ac69f17814d91.tar.gz chocolate-doom-091f93809ee554571a6ed6145b8ac69f17814d91.tar.bz2 chocolate-doom-091f93809ee554571a6ed6145b8ac69f17814d91.zip |
Factor out Heretic and Hexen versions of m_misc.c. Make -file for
Heretic and Hexen use WAD path lookup.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1368
Diffstat (limited to 'src/hexen/h2_main.c')
-rw-r--r-- | src/hexen/h2_main.c | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index 9d253575..15b6b1b6 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -214,6 +214,13 @@ static void D_HexenQuitMessage(void) printf("\nHexen: Beyond Heretic\n"); } +static void D_AddFile(char *filename) +{ + printf(" adding %s\n", filename); + + W_AddFile(filename); +} + //========================================================================== // // H2_Main @@ -275,7 +282,7 @@ void D_DoomMain(void) "one with the '-iwad' command line parameter."); } - W_AddFile(iwadfile); + D_AddFile(iwadfile); HandleArgs(); @@ -467,12 +474,15 @@ static void ExecOptionSKILL(char **args, int tag) static void ExecOptionFILE(char **args, int tag) { + char *filename; int p; p = M_CheckParm("-file"); while (++p != myargc && myargv[p][0] != '-') { - W_AddFile(myargv[p]); + filename = D_TryFindWADByName(myargv[p]); + + D_AddFile(filename); } } @@ -505,40 +515,6 @@ static void ExecOptionSCRIPTS(char **args, int tag) } -long superatol(char *s) -{ - long int n = 0, r = 10, x, mul = 1; - char *c = s; - - for (; *c; c++) - { - x = (*c & 223) - 16; - - if (x == -3) - { - mul = -mul; - } - else if (x == 72 && r == 10) - { - n -= (r = n); - if (!r) - r = 16; - if (r < 2 || r > 36) - return -1; - } - else - { - if (x > 10) - x -= 39; - if (x >= r) - return -1; - n = (n * r) + x; - } - } - return (mul * n); -} - - //========================================================================== // // H2_GameLoop |