📄 d_main.c
字号:
devparm=M_CheckParm("-devparm"); nomonsters = M_CheckParm ("-nomonsters"); //added:11-01-98:removed the repeated spaces in title strings, // because GCC doesn't expand the TABS from my text editor. // Now the string is centered in a larger one just before output, // and the date and time of compilation is added. (see below) switch ( gamemode ) { case retail :strcpy (title,"The Ultimate DOOM Startup"); break; case shareware :strcpy (title,"DOOM Shareware Startup"); break; case registered:strcpy (title,"DOOM Registered Startup"); break; case commercial:strcpy (title,"DOOM 2: Hell on Earth"); break;/*FIXME case pack_plut :strcpy (title,"DOOM 2: Plutonia Experiment");break; case pack_tnt :strcpy (title,"DOOM 2: TNT - Evilution"); break;*/ default :strcpy (title,"Public DOOM"); break; } //added:11-01-98:center the string, add compilation time and date. sprintf(legacy,"Doom LEGACY v%i.%i"VERSIONSTRING,VERSION/100,VERSION%100); D_MakeTitleString(legacy);#ifdef PC_DOS D_Titlebar(legacy,title);#else CONS_Printf ("%s\n%s\n",legacy,title);#endif#ifdef __OS2__ // set PM window title snprintf( pmData->title, sizeof( pmData->title), "Doom LEGACY v%i.%i" VERSIONSTRING ": %s", VERSION/100, VERSION%100, title);#endif if (devparm) CONS_Printf(D_DEVSTR); // default savegame strcpy(savegamename,text[NORM_SAVEI_NUM]); { char *userhome,legacyhome[256]; if(M_CheckParm("-home") && M_IsNextParm()) userhome = M_GetNextParm(); else userhome = getenv("HOME");#ifdef LINUX if (!userhome) I_Error("Please set $HOME to your home directory\n");#endif if(userhome) { // use user specific config file sprintf(legacyhome, "%s/"DEFAULTDIR, userhome); sprintf(configfile, "%s/"CONFIGFILENAME, legacyhome); // can't use sprintf since there is %d in savegamename strcatbf(savegamename,legacyhome,"/"); I_mkdir(legacyhome, 0700); } } if (M_CheckParm("-cdrom")) { CONS_Printf(D_CDROM); I_mkdir("c:\\doomdata",700); strcpy (configfile,"c:/doomdata/"CONFIGFILENAME); strcpy (savegamename,text[CDROM_SAVEI_NUM]); } // 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. switch (gamemode ) { case shareware: case retail: case registered: sprintf (file,"~"DEVMAPS"E%cM%c.wad", myargv[p+1][0], myargv[p+2][0]); CONS_Printf("Warping to Episode %s, Map %s.\n", myargv[p+1],myargv[p+2]); break; case commercial: default: p = atoi (myargv[p+1]); if (p<10) sprintf (file,"~"DEVMAPS"cdata/map0%i.wad", p); else sprintf (file,"~"DEVMAPS"cdata/map%i.wad", p); break; } D_AddFile (file); } if (M_CheckParm ("-file")) { // the parms after p are wadfile/lump names, // until end of parms or another - preceded parm modifiedgame = true; // homebrew levels while (M_IsNextParm()) D_AddFile (M_GetNextParm()); } // load dehacked file p = M_CheckParm ("-dehacked"); if (!p) p = M_CheckParm ("-deh"); //Fab:02-08-98:like Boom & DosDoom if(p!=0) { while (M_IsNextParm()) D_AddFile (M_GetNextParm()); } // get skill / episode / map from parms gameskill = sk_medium; startepisode = 1; startmap = 1; autostart = false; p = M_CheckParm ("-skill"); if (p && p < myargc-1) { gameskill = myargv[p+1][0]-'1'; autostart = true; } p = M_CheckParm ("-episode"); if (p && p < myargc-1) { startepisode = myargv[p+1][0]-'0'; startmap = 1; autostart = true; } p = M_CheckParm ("-warp"); if (p && p < myargc-1) { if (gamemode == commercial) startmap = atoi (myargv[p+1]); else { startepisode = myargv[p+1][0]-'0'; if (p < myargc-2 && myargv[p+2][0]>='0' && myargv[p+2][0]<='9' ) startmap = myargv[p+2][0]-'0'; else startmap = 1; } autostart = true; } CONS_Printf (text[Z_INIT_NUM]); Z_Init (); // adapt tables to legacy needs P_PatchInfoTables(); if( gamemode == heretic ) HereticPatchEngine(); CONS_Printf (text[W_INIT_NUM]); // load wad, including the main wad file if(!W_InitMultipleFiles (startupwadfiles)) CONS_Error("A WAD file was not found\n"); if(!M_CheckParm("-nocheckwadversion")) D_CheckWadVersion(); //Hurdler: someone wants to keep those lines? //BP: i agree with you why should be registered to play someone wads ? // unfotunately most addistional wad have more texture and monsters // that sharware wad do, so there will miss resourse :( //added:28-02-98: check for Ultimate doom. //if ( (gamemode==registered) && (W_CheckNumForName("E4M1") > 0) ) // gamemode = retail; // Check for -file in shareware if (modifiedgame) { // These are the lumps that will be checked in IWAD, // if any one is not present, execution will be aborted. char name[23][8]= { "e2m1","e2m2","e2m3","e2m4","e2m5","e2m6","e2m7","e2m8","e2m9", "e3m1","e3m3","e3m3","e3m4","e3m5","e3m6","e3m7","e3m8","e3m9", "dphoof","bfgga0","heada1","cybra1","spida1d1" }; int i; if ( gamemode == shareware) I_Error("\nYou cannot -file with the shareware " "version. Register!"); // Check for fake IWAD with right name, // but w/o all the lumps of the registered version. if (gamemode == registered) for (i = 0;i < 23; i++) if (W_CheckNumForName(name[i])<0) I_Error("\nThis is not the registered version."); } // If additonal PWAD files are used, print modified banner if (modifiedgame) CONS_Printf ( text[MODIFIED_NUM] ); // Check and print which version is executed. switch ( gamemode ) { case shareware: case indetermined: CONS_Printf (text[SHAREWARE_NUM]); break; case registered: case retail: case commercial: CONS_Printf (text[COMERCIAL_NUM]); break; default: // Ouch. break; } cht_Init(); //---------------------------------------------------- READY SCREEN //printf("\nI_StartupComm..."); CONS_Printf("I_StartupTimer...\n"); I_StartupTimer (); // now initted automatically by use_mouse var code //CONS_Printf("I_StartupMouse...\n"); //I_StartupMouse (); //CONS_Printf ("I_StartupKeyboard...\n"); //I_StartupKeyboard (); // FIXME: this is a dummy, we can remove it! // now initialised automatically by use_joystick var code //CONS_Printf (text[I_INIT_NUM]); //I_InitJoystick (); CONS_Printf("I_StartupGraphics...\n"); I_StartupGraphics (); //--------------------------------------------------------- CONSOLE // setup loading screen SCR_Startup (); // we need the font of the console CONS_Printf (text[HU_INIT_NUM]); HU_Init (); COM_Init (); CON_Init (); D_RegisterClientCommands (); //Hurdler: be sure that this is called before D_CheckNetGame D_AddDeathmatchCommands (); ST_AddCommands (); T_AddCommands(); P_Info_AddCommands(); R_RegisterEngineStuff (); S_RegisterSoundStuff (); CV_RegisterVar (&cv_screenslink); //Fab:29-04-98: do some dirty chatmacros strings initialisation HU_HackChatmacros (); //--------------------------------------------------------- CONFIG.CFG M_FirstLoadConfig(); // WARNING : this do a "COM_BufExecute()"#ifdef LINUX VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen#endif // set user default mode or mode set at cmdline SCR_CheckDefaultMode (); wipegamestate = gamestate; //------------------------------------------------ COMMAND LINE PARAMS // Initialize CD-Audio if (!M_CheckParm ("-nocd")) I_InitCD (); if (M_CheckParm ("-respawn")) COM_BufAddText ("respawnmonsters 1\n"); if (M_CheckParm("-teamplay")) COM_BufAddText ("teamplay 1\n"); if (M_CheckParm("-teamskin")) COM_BufAddText ("teamplay 2\n"); if (M_CheckParm("-splitscreen")) CV_SetValue(&cv_splitscreen,1); if (M_CheckParm ("-altdeath")) COM_BufAddText ("deathmatch 2\n"); else if (M_CheckParm ("-deathmatch")) COM_BufAddText ("deathmatch 1\n"); if (M_CheckParm ("-fast")) COM_BufAddText ("fastmonsters 1\n"); if (M_CheckParm ("-timer")) { char *s=M_GetNextParm(); COM_BufAddText(va("timelimit %s\n",s )); } if (M_CheckParm ("-avg")) { COM_BufAddText("timelimit 20\n"); CONS_Printf(text[AUSTIN_NUM]); } // turbo option, is not meant to be saved in config, still // supported at cmd-line for compatibility if ( M_CheckParm ("-turbo") && M_IsNextParm()) COM_BufAddText (va("turbo %s\n",M_GetNextParm())); // push all "+" parameter at the command buffer M_PushSpecialParameters(); CONS_Printf (text[M_INIT_NUM]); M_Init (); CONS_Printf (text[R_INIT_NUM]); R_Init (); // // setting up sound // CONS_Printf (text[S_SETSOUND_NUM]); nosound = M_CheckParm("-nosound"); nomusic = M_CheckParm("-nomusic"); // WARNING: DOS version initmusic in I_StartupSound I_StartupSound (); I_InitMusic (); // setup music buffer for quick mus2mid S_Init (cv_soundvolume.value, cv_musicvolume.value); CONS_Printf (text[ST_INIT_NUM]); ST_Init (); //////////////////////////////// // SoM: Init FraggleScript //////////////////////////////// T_Init(); // init all NETWORK CONS_Printf (text[D_CHECKNET_NUM]); if( D_CheckNetGame () ) autostart = true; // check for a driver that wants intermission stats p = M_CheckParm ("-statcopy"); if (p && p<myargc-1) { I_Error("Sorry but statcopy isn't supported at this time\n"); /* // for statistics driver extern void* statcopy; statcopy = (void*)atoi(myargv[p+1]); CONS_Printf (text[STATREG_NUM]); */ } // start the apropriate game based on parms p = M_CheckParm ("-record"); if (p && p < myargc-1) { G_RecordDemo (myargv[p+1]); autostart = true; } // demo doesn't need anymore to be added with D_AddFile() p = M_CheckParm ("-playdemo"); if (!p) p = M_CheckParm ("-timedemo"); if (p && M_IsNextParm()) { char tmp[MAX_WADPATH]; // add .lmp to identify the EXTERNAL demo file // it is NOT possible to play an internal demo using -playdemo, // rather push a playdemo command.. to do. strcpy (tmp,M_GetNextParm()); // get spaced filename or directory while(M_IsNextParm()) { strcat(tmp," ");strcat(tmp,M_GetNextParm()); } FIL_DefaultExtension (tmp,".lmp"); CONS_Printf ("Playing demo %s.\n",tmp); if ( (p=M_CheckParm("-playdemo")) ) { singledemo = true; // quit after one demo G_DeferedPlayDemo (tmp); } else G_TimeDemo (tmp); gamestate = wipegamestate = GS_NULL; return; } p = M_CheckParm ("-loadgame"); if (p && p < myargc-1) { G_LoadGame (atoi(myargv[p+1])); } else { if(dedicated && server) { pagename = "TITLEPIC"; gamestate = GS_DEDICATEDSERVER; } else if (autostart || netgame || M_CheckParm("+connect") || M_CheckParm("-connect")) { //added:27-02-98: reset the current version number G_Downgrade(VERSION); gameaction = ga_nothing; if(server && !M_CheckParm("+map")) COM_BufAddText (va("map \"%s\"\n",G_BuildMapName(startepisode, startmap))); } else D_StartTitle (); // start up intro loop }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -