diff options
Diffstat (limited to 'src/strife')
-rw-r--r-- | src/strife/d_main.c | 105 | ||||
-rw-r--r-- | src/strife/d_net.c | 27 | ||||
-rw-r--r-- | src/strife/doomstat.h | 1 | ||||
-rw-r--r-- | src/strife/dstrings.h | 9 | ||||
-rw-r--r-- | src/strife/g_game.c | 19 | ||||
-rw-r--r-- | src/strife/m_menu.c | 8 | ||||
-rw-r--r-- | src/strife/p_map.c | 2 | ||||
-rw-r--r-- | src/strife/p_spec.c | 7 | ||||
-rw-r--r-- | src/strife/r_data.c | 20 |
9 files changed, 102 insertions, 96 deletions
diff --git a/src/strife/d_main.c b/src/strife/d_main.c index 4260ca7d..95b1b643 100644 --- a/src/strife/d_main.c +++ b/src/strife/d_main.c @@ -126,8 +126,6 @@ int startmap; boolean autostart; int startloadgame; -FILE* debugfile; - boolean advancedemo; // villsa [STRIFE] workparm variable (similar to devparm?) @@ -475,14 +473,6 @@ void D_DoomLoop (void) if (demorecording) G_BeginRecording (); - if (M_CheckParm ("-debugfile")) - { - char filename[20]; - sprintf (filename,"debug%i.txt",consoleplayer); - printf ("debug output to: %s\n",filename); - debugfile = fopen (filename,"w"); - } - TryRunTics(); if(!showintro) // [STRIFE] @@ -745,7 +735,7 @@ void D_QuitGame(void) // These are from the original source: some of them are perhaps // not used in any dehacked patches -static char *banners[] = +static char *banners[] = { // strife1.wad: @@ -1040,9 +1030,9 @@ static void InitGameVersion(void) // "ultimate" and "final". // - p = M_CheckParm("-gameversion"); + p = M_CheckParmWithArgs("-gameversion", 1); - if (p > 0) + if (p) { for (i=0; gameversions[i].description != NULL; ++i) { @@ -1431,6 +1421,21 @@ void D_DoomMain (void) } //! + // @category net + // + // Query the Internet master server for a global list of active + // servers. + // + + if (M_CheckParm("-search")) + { + printf("\nSearching for servers on Internet ...\n"); + p = NET_MasterQuery(NET_QueryPrintCallback, NULL); + printf("\n%i server(s) found.\n", p); + exit(0); + } + + //! // @arg <address> // @category net // @@ -1438,11 +1443,12 @@ void D_DoomMain (void) // address. // - p = M_CheckParm("-query"); + p = M_CheckParmWithArgs("-query", 1); - if (p > 0) + if (p) { NET_QueryAddress(myargv[p+1]); + exit(0); } //! @@ -1451,8 +1457,13 @@ void D_DoomMain (void) // Search the local LAN for running servers. // - if (M_CheckParm("-search")) - NET_LANQuery(); + if (M_CheckParm("-localsearch")) + { + printf("\nSearching for servers on local LAN ...\n"); + p = NET_LANQuery(NET_QueryPrintCallback, NULL); + printf("\n%i server(s) found.\n", p); + exit(0); + } #endif @@ -1615,23 +1626,9 @@ void D_DoomMain (void) // add any files specified on the command line with -file wadfile // to the wad list // - // convenience hack to allow -wart e m to add a wad file - // prepend a tilde to the filename so wadfile will be reloadable - p = M_CheckParm ("-wart"); - if (p) - { - myargv[p][4] = 'p'; // big hack, change to -warp - // Map name handling. - // [STRIFE]: looks for f:/st/data - p = atoi (myargv[p+1]); - if (p<10) - sprintf (file,"~f:/st/data/map0%i.wad", p); - else - sprintf (file,"~f:/st/data/map%i.wad", p); - - D_AddFile (file); - } + // Debug: +// W_PrintDirectory(); //! // @arg <demo> @@ -1641,7 +1638,7 @@ void D_DoomMain (void) // Play back the demo named demo.lmp. // - p = M_CheckParm ("-playdemo"); + p = M_CheckParmWithArgs ("-playdemo", 1); if (!p) { @@ -1653,11 +1650,11 @@ void D_DoomMain (void) // Play back the demo named demo.lmp, determining the framerate // of the screen. // - p = M_CheckParm ("-timedemo"); + p = M_CheckParmWithArgs("-timedemo", 1); } - if (p && p < myargc-1) + if (p) { if (!strcasecmp(myargv[p+1] + strlen(myargv[p+1]) - 4, ".lmp")) { @@ -1746,9 +1743,9 @@ void D_DoomMain (void) // 0 disables all monsters. // - p = M_CheckParm ("-skill"); + p = M_CheckParmWithArgs("-skill", 1); - if (p && p < myargc-1) + if (p) { startskill = myargv[p+1][0]-'1'; autostart = true; @@ -1761,9 +1758,9 @@ void D_DoomMain (void) // Start playing on episode n (1-4) // - p = M_CheckParm ("-episode"); + p = M_CheckParmWithArgs("-episode", 1); - if (p && p < myargc-1) + if (p) { startepisode = myargv[p+1][0]-'0'; startmap = 1; @@ -1780,9 +1777,9 @@ void D_DoomMain (void) // For multiplayer games: exit each level after n minutes. // - p = M_CheckParm ("-timer"); + p = M_CheckParmWithArgs("-timer", 1); - if (p && p < myargc-1 && deathmatch) + if (p) { timelimit = atoi(myargv[p+1]); printf("timer: %i\n", timelimit); @@ -1797,10 +1794,8 @@ void D_DoomMain (void) p = M_CheckParm ("-avg"); - if (p && p < myargc-1 && deathmatch) + if (p) { - DEH_printf("Austin Virtual Gaming: Levels will end " - "after 20 minutes\n"); timelimit = 20; } @@ -1812,9 +1807,9 @@ void D_DoomMain (void) // (Doom 2) // - p = M_CheckParm ("-warp"); + p = M_CheckParmWithArgs("-warp", 1); - if (p && p < myargc-1) + if (p) { if (gamemode == commercial) startmap = atoi (myargv[p+1]); @@ -1858,9 +1853,9 @@ void D_DoomMain (void) // Load the game in slot s. // - p = M_CheckParm ("-loadgame"); + p = M_CheckParmWithArgs("-loadgame", 1); - if (p && p < myargc-1) + if (p) { startloadgame = atoi(myargv[p+1]); } @@ -1956,17 +1951,17 @@ void D_DoomMain (void) // Record a demo named x.lmp. // - p = M_CheckParm ("-record"); + p = M_CheckParmWithArgs("-record", 1); - if (p && p < myargc-1) + if (p) { G_RecordDemo (myargv[p+1]); autostart = true; } D_IntroTick(); // [STRIFE] - p = M_CheckParm ("-playdemo"); - if (p && p < myargc-1) + p = M_CheckParmWithArgs("-playdemo", 1); + if (p) { singledemo = true; // quit after one demo G_DeferedPlayDemo (demolumpname); @@ -1974,8 +1969,8 @@ void D_DoomMain (void) } D_IntroTick(); // [STRIFE] - p = M_CheckParm ("-timedemo"); - if (p && p < myargc-1) + p = M_CheckParmWithArgs("-timedemo", 1); + if (p) { G_TimeDemo (demolumpname); D_DoomLoop (); // never returns diff --git a/src/strife/d_net.c b/src/strife/d_net.c index 3480b0ad..7e1644e8 100644 --- a/src/strife/d_net.c +++ b/src/strife/d_net.c @@ -49,7 +49,6 @@ #include "net_sdl.h" #include "net_loop.h" - // // NETWORKING // @@ -292,6 +291,7 @@ void D_CheckNetGame (void) if (i > 0) { addr = NET_FindLANServer(); + NET_SV_RegisterWithMaster(); if (addr == NULL) { @@ -307,7 +307,7 @@ void D_CheckNetGame (void) // address. // - i = M_CheckParm("-connect"); + i = M_CheckParmWithArgs("-connect", 1); if (i > 0) { @@ -382,12 +382,22 @@ void D_CheckNetGame (void) // Show players here; the server might have specified a time limit - if (timelimit > 0) + if (timelimit > 0 && deathmatch) { - DEH_printf("Levels will end after %d minute", timelimit); - if (timelimit > 1) - printf("s"); - printf(".\n"); + // Gross hack to work like Vanilla: + + if (timelimit == 20 && M_CheckParm("-avg")) + { + DEH_printf("Austin Virtual Gaming: Levels will end " + "after 20 minutes\n"); + } + else + { + DEH_printf("Levels will end after %d minute", timelimit); + if (timelimit > 1) + printf("s"); + printf(".\n"); + } } } @@ -399,9 +409,6 @@ void D_CheckNetGame (void) // void D_QuitNetGame (void) { - if (debugfile) - fclose (debugfile); - #ifdef FEATURE_MULTIPLAYER NET_SV_Shutdown(); diff --git a/src/strife/doomstat.h b/src/strife/doomstat.h index ae513f78..8cb562b2 100644 --- a/src/strife/doomstat.h +++ b/src/strife/doomstat.h @@ -264,7 +264,6 @@ extern int maxammo[NUMAMMO]; // File handling stuff. extern char * savegamedir; extern char basedefault[1024]; -extern FILE* debugfile; // if true, load all graphics at level load extern boolean precache; diff --git a/src/strife/dstrings.h b/src/strife/dstrings.h index bdc6b2ce..d47fc1af 100644 --- a/src/strife/dstrings.h +++ b/src/strife/dstrings.h @@ -38,15 +38,6 @@ #define SAVEGAMENAME "doomsav" -// -// File locations, -// relative to current position. -// Path names are OS-sensitive. -// -#define DEVMAPS "devmaps" -#define DEVDATA "devdata" - - // QuitDOOM messages // 8 per each game type #define NUM_QUITMESSAGES 8 diff --git a/src/strife/g_game.c b/src/strife/g_game.c index b8496a5b..c9d49c18 100644 --- a/src/strife/g_game.c +++ b/src/strife/g_game.c @@ -138,7 +138,7 @@ int gametic; int levelstarttic; // gametic at level start int totalkills, /*totalitems,*/ totalsecret; // for intermission -char demoname[32]; +char *demoname; boolean demorecording; boolean longtics; // cph's doom 1.91 longtics hack boolean lowres_turn; // low resolution turning for longtics @@ -2280,8 +2280,8 @@ void G_RecordDemo (char* name) int maxsize; usergame = false; - strcpy (demoname, name); - strcat (demoname, ".lmp"); + demoname = Z_Malloc(strlen(name) + 5, PU_STATIC, NULL); + sprintf(demoname, "%s.lmp", name); maxsize = 0x20000; //! @@ -2292,8 +2292,8 @@ void G_RecordDemo (char* name) // Specify the demo buffer size (KiB) // - i = M_CheckParm ("-maxdemo"); - if (i && i<myargc-1) + i = M_CheckParmWithArgs("-maxdemo", 1); + if (i) maxsize = atoi(myargv[i+1])*1024; demobuffer = Z_Malloc (maxsize,PU_STATIC,NULL); demoend = demobuffer + maxsize; @@ -2450,10 +2450,11 @@ void G_DoPlayDemo (void) // Play back a demo recorded in a netgame with a single player. // - if (playeringame[1] || M_CheckParm("-netdemo") > 0) - { - netgame = true; - netdemo = true; + if (playeringame[1] || M_CheckParm("-solo-net") > 0 + || M_CheckParm("-netdemo") > 0) + { + netgame = true; + netdemo = true; } // don't spend a lot of time in loadlevel diff --git a/src/strife/m_menu.c b/src/strife/m_menu.c index 92564e96..4d16e3e8 100644 --- a/src/strife/m_menu.c +++ b/src/strife/m_menu.c @@ -1679,23 +1679,23 @@ boolean M_Responder (event_t* ev) if (ev->type == ev_joystick && joywait < I_GetTime()) { - if (ev->data3 == -1) + if (ev->data3 < 0) { key = key_menu_up; joywait = I_GetTime() + 5; } - else if (ev->data3 == 1) + else if (ev->data3 > 0) { key = key_menu_down; joywait = I_GetTime() + 5; } - if (ev->data2 == -1) + if (ev->data2 < 0) { key = key_menu_left; joywait = I_GetTime() + 2; } - else if (ev->data2 == 1) + else if (ev->data2 > 0) { key = key_menu_right; joywait = I_GetTime() + 2; diff --git a/src/strife/p_map.c b/src/strife/p_map.c index 6a1d526d..c557f968 100644 --- a/src/strife/p_map.c +++ b/src/strife/p_map.c @@ -1628,7 +1628,7 @@ static void SpechitOverrun(line_t *ld) // Use the specified magic value when emulating spechit overruns. // - p = M_CheckParm("-spechit"); + p = M_CheckParmWithArgs("-spechit", 1); if (p > 0) { diff --git a/src/strife/p_spec.c b/src/strife/p_spec.c index af070d55..e26d9144 100644 --- a/src/strife/p_spec.c +++ b/src/strife/p_spec.c @@ -1713,9 +1713,9 @@ static void DonutOverrun(fixed_t *s3_floorheight, short *s3_floorpic, // system. The default (if this option is not specified) is to // emulate the behavior when running under Windows 98. - p = M_CheckParm("-donut"); + p = M_CheckParmWithArgs("-donut", 2); - if (p > 0 && p < myargc - 2) + if (p > 0) { // Dump of needed memory: (fixed_t)0000:0000 and (short)0000:0008 // @@ -1893,10 +1893,9 @@ void P_SpawnSpecials (void) if (W_CheckNumForName(DEH_String("texture2")) >= 0) episode = 2; - // See if -TIMER was specified. - if (timelimit > 0) + if (timelimit > 0 && deathmatch) { levelTimer = true; levelTimeCount = timelimit * 60 * TICRATE; diff --git a/src/strife/r_data.c b/src/strife/r_data.c index 043df348..46138c85 100644 --- a/src/strife/r_data.c +++ b/src/strife/r_data.c @@ -409,6 +409,7 @@ R_GetColumn static void GenerateTextureHashTable(void) { + texture_t **rover; int i; int key; @@ -425,12 +426,25 @@ static void GenerateTextureHashTable(void) textures[i]->index = i; - // Hook into hash table + // Vanilla Doom does a linear search of the texures array + // and stops at the first entry it finds. If there are two + // entries with the same name, the first one in the array + // wins. The new entry must therefore be added at the end + // of the hash chain, so that earlier entries win. key = W_LumpNameHash(textures[i]->name) % numtextures; - textures[i]->next = textures_hashtable[key]; - textures_hashtable[key] = textures[i]; + rover = &textures_hashtable[key]; + + while (*rover != NULL) + { + rover = &(*rover)->next; + } + + // Hook into hash table + + textures[i]->next = NULL; + *rover = textures[i]; } } |