From 091f93809ee554571a6ed6145b8ac69f17814d91 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 30 Oct 2008 02:10:50 +0000 Subject: 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 --- src/hexen/h2_main.c | 48 ++++++++++++------------------------------------ 1 file changed, 12 insertions(+), 36 deletions(-) (limited to 'src/hexen/h2_main.c') 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 -- cgit v1.2.3