本文整理汇总了C++中I_FatalError函数的典型用法代码示例。如果您正苦于以下问题:C++ I_FatalError函数的具体用法?C++ I_FatalError怎么用?C++ I_FatalError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了I_FatalError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: I_InitHardware
void I_InitHardware ()
{
UCVarValue val;
val.Bool = !!Args.CheckParm ("-devparm");
ticker.SetGenericRepDefault (val, CVAR_Bool);
if ( OPENGL_GetCurrentRenderer( ) == RENDERER_OPENGL )
Video = new OpenGLVideo( );
else
Video = new Win32Video (0);
if (Video == NULL)
I_FatalError ("Failed to initialize display");
if (!initialized) // [ZDoomGL]
{
atterm (I_ShutdownHardware);
}
Video->SetWindowedScale (vid_winscale);
initialized = true; // [ZDoomGL]
}
示例2: ParseIWadInfo
void FIWadManager::ParseIWadInfos(const char *fn)
{
FResourceFile *resfile = FResourceFile::OpenResourceFile(fn, NULL, true);
if (resfile != NULL)
{
DWORD cnt = resfile->LumpCount();
for(int i=cnt-1; i>=0; i--)
{
FResourceLump *lmp = resfile->GetLump(i);
if (lmp->Namespace == ns_global && !stricmp(lmp->Name, "IWADINFO"))
{
// Found one!
ParseIWadInfo(resfile->Filename, (const char*)lmp->CacheLump(), lmp->LumpSize);
break;
}
}
delete resfile;
}
if (mIWadNames.Size() == 0 || mIWads.Size() == 0)
{
I_FatalError("No IWAD definitions found");
}
}
示例3: InitNetCommon
//
// InitNetCommon
//
void InitNetCommon(void)
{
unsigned long _true = true;
#ifdef _WIN32
WSADATA wsad;
WSAStartup( MAKEWORD(2,2), &wsad );
#endif
inet_socket = UDPsocket ();
#ifdef ODA_HAVE_MINIUPNP
init_upnp();
#endif
BindToLocalPort (inet_socket, localport);
if (ioctlsocket (inet_socket, FIONBIO, &_true) == -1)
I_FatalError ("UDPsocket: ioctl FIONBIO: %s", strerror(errno));
// enter message information into message info structs
InitNetMessageFormats();
SZ_Clear(&net_message);
}
示例4: NewFailure
static int NewFailure (size_t size)
{
I_FatalError ("Failed to allocate %d bytes from process heap", size);
return 0;
}
示例5: Z_IDCheckNB
//
// Z_IDCheckNB
//
// Performs a fatal error condition check contingent on the definition
// of ZONEIDCHECK, in any context where a memblock pointer is not available.
//
static void Z_IDCheckNB(bool err, const char *errmsg,
const char *file, int line)
{
if(err)
I_FatalError(I_ERR_KILL, "%s\nSource: %s:%d\n", errmsg, file, line);
}
示例6: D_DoomMain
//
// D_DoomMain
//
void D_DoomMain (void)
{
unsigned p;
extern std::string defdemoname;
gamestate = GS_STARTUP;
M_FindResponseFile(); // [ML] 23/1/07 - Add Response file support back in
if (lzo_init () != LZO_E_OK) // [RH] Initialize the minilzo package.
I_FatalError ("Could not initialize LZO routines");
C_ExecCmdLineParams (false, true); // [Nes] test for +logfile command
Printf (PRINT_HIGH, "Heapsize: %u megabytes\n", got_heapsize);
M_LoadDefaults (); // load before initing other systems
C_ExecCmdLineParams (true, false); // [RH] do all +set commands on the command line
const char* iwad = Args.CheckValue("-iwad");
if (!iwad)
iwad = "";
std::vector<std::string> newwadfiles, newpatchfiles;
newwadfiles.push_back(iwad);
D_AddWadCommandLineFiles(newwadfiles);
D_AddDehCommandLineFiles(newpatchfiles);
D_LoadResourceFiles(newwadfiles, newpatchfiles);
I_Init();
V_Init();
atterm(V_Close);
#ifdef _WIN32
const char *sdlv = getenv("SDL_VIDEODRIVER");
Printf (PRINT_HIGH, "Using %s video driver.\n",sdlv);
#endif
C_InitConsole(screen->width, screen->height, true);
atterm(C_ShutdownConsole);
// SDL needs video mode set up first before input code can be used
I_InitInput();
D_Init();
atterm(D_Shutdown);
// Base systems have been inited; enable cvar callbacks
cvar_t::EnableCallbacks();
// [RH] User-configurable startup strings. Because BOOM does.
if (GStrings(STARTUP1)[0]) Printf (PRINT_HIGH, "%s\n", GStrings(STARTUP1));
if (GStrings(STARTUP2)[0]) Printf (PRINT_HIGH, "%s\n", GStrings(STARTUP2));
if (GStrings(STARTUP3)[0]) Printf (PRINT_HIGH, "%s\n", GStrings(STARTUP3));
if (GStrings(STARTUP4)[0]) Printf (PRINT_HIGH, "%s\n", GStrings(STARTUP4));
if (GStrings(STARTUP5)[0]) Printf (PRINT_HIGH, "%s\n", GStrings(STARTUP5));
// Nomonsters
sv_nomonsters = Args.CheckParm("-nomonsters");
// Respawn
sv_monstersrespawn = Args.CheckParm("-respawn");
// Fast
sv_fastmonsters = Args.CheckParm("-fast");
// developer mode
devparm = Args.CheckParm ("-devparm");
// Record a vanilla demo
p = Args.CheckParm ("-record");
if (p)
{
autorecord = true;
autostart = true;
demorecordfile = Args.GetArg (p+1);
}
// get skill / episode / map from parms
strcpy (startmap, (gameinfo.flags & GI_MAPxx) ? "MAP01" : "E1M1");
// Check for -playdemo, play a single demo then quit.
p = Args.CheckParm ("-playdemo");
// Hack to check for +playdemo command, since if you just add it normally
// it won't run because it's attempting to run a demo and still set up the
// first map as normal.
if (!p)
p = Args.CheckParm ("+playdemo");
if (p && p < Args.NumArgs()-1)
{
Printf (PRINT_HIGH, "Playdemo parameter found on command line.\n");
singledemo = true;
defdemoname = Args.GetArg (p+1);
}
// [SL] check for -timedemo (was removed at some point)
//.........这里部分代码省略.........
示例7: IdentifyVersion
//.........这里部分代码省略.........
if (i != numwads)
{
wads[numwads] = wads[i];
}
foundwads[wads[numwads].Type] = numwads + 1;
numwads++;
}
}
if (foundwads[IWAD_HexenDK] && !foundwads[IWAD_Hexen])
{ // Cannot play Hexen DK without Hexen
size_t kill = foundwads[IWAD_HexenDK];
for (i = kill; i < numwads; ++i)
{
wads[i - 1] = wads[i];
}
numwads--;
foundwads[IWAD_HexenDK] = 0;
for (i = 0; i < NUM_IWAD_TYPES; ++i)
{
if (foundwads[i] > kill)
{
foundwads[i]--;
}
}
}
if (numwads == 0)
// [BB] Skulltag uses Rivecoder's IWAD setup screen now (only available under Windows).
#ifdef _WIN32
throw CNoIWADError(); // [RC]
#else
{
I_FatalError ("Cannot find a game IWAD (doom.wad, doom2.wad, heretic.wad, etc.).\n"
"Did you install "GAMENAME" properly? You can do either of the following:\n"
"\n"
"1. Place one or more of these wads in the same directory as "GAMENAME".\n"
"2. Edit your "GAMENAMELOWERCASE"-username.ini and add the directories of your iwads\n"
"to the list beneath [IWADSearch.Directories]");
}
#endif
pickwad = 0;
if (!iwadparmfound && numwads > 1)
{
int defiwad = 0;
// Locate the user's prefered IWAD, if it was found.
if (defaultiwad[0] != '\0')
{
for (i = 0; i < numwads; ++i)
{
FString basename = ExtractFileBase (wads[i].Path);
if (stricmp (basename, defaultiwad) == 0)
{
defiwad = (int)i;
break;
}
}
}
pickwad = I_PickIWad (wads, (int)numwads, queryiwad, defiwad);
if (pickwad >= 0)
{
// The newly selected IWAD becomes the new default
FString basename = ExtractFileBase (wads[pickwad].Path);
示例8: D_DoomWadReboot
//
// [denis] D_DoomWadReboot
// change wads at runtime
// on 404, returns a vector of bad files
//
std::vector<size_t> D_DoomWadReboot(
const std::vector<std::string> &wadnames,
const std::vector<std::string> &patch_files,
std::vector<std::string> needhashes
)
{
std::vector<size_t> fails;
size_t i;
if (modifiedgame && (gameinfo.flags & GI_SHAREWARE))
I_FatalError ("\nYou cannot switch WAD with the shareware version. Register!");
SV_SendReconnectSignal();
G_ExitLevel(0, 0);
DThinker::DestroyAllThinkers();
// Close all open WAD files
W_Close();
// [ML] 9/11/10: Reset custom wad level information from MAPINFO et al.
// I have never used memset, I hope I am not invoking satan by doing this :(
if (wadlevelinfos)
{
for (i = 0; i < numwadlevelinfos; i++)
if (wadlevelinfos[i].snapshot)
{
delete wadlevelinfos[i].snapshot;
wadlevelinfos[i].snapshot = NULL;
}
memset(wadlevelinfos,0,sizeof(wadlevelinfos));
numwadlevelinfos = 0;
}
if (wadclusterinfos)
{
memset(wadclusterinfos,0,sizeof(wadclusterinfos));
numwadclusterinfos = 0;
}
// Restart the memory manager
Z_Init();
wadfiles.clear();
modifiedgame = false;
std::string custwad;
if(wadnames.empty() == false)
custwad = wadnames[0];
D_AddDefWads(custwad);
for(i = 0; i < wadnames.size(); i++)
{
std::string file = BaseFileSearch(wadnames[i], ".WAD");
if(file.length())
wadfiles.push_back(file);
else
{
if (wadnames[i] != "") {
Printf (PRINT_HIGH, "could not find WAD: %s\n", wadnames[i].c_str());
fails.push_back(i);
}
}
}
if(wadnames.size() > 1)
modifiedgame = true;
wadhashes = W_InitMultipleFiles (wadfiles);
SV_InitMultipleFiles (wadfiles);
// get skill / episode / map from parms
strcpy (startmap, (gameinfo.flags & GI_MAPxx) ? "MAP01" : "E1M1");
UndoDehPatch();
patchfiles.clear();
D_InitStrings ();
D_DoDefDehackedPatch(patch_files);
G_SetLevelStrings ();
G_ParseMapInfo ();
S_ParseSndInfo();
R_Init();
P_Init();
return fails;
}
示例9: R_InitTextures
//.........这里部分代码省略.........
delete[] texturecompositesize;
delete[] texturewidthmask;
delete[] textureheight;
delete[] texturescalex;
delete[] texturescaley;
numtextures = numtextures1 + numtextures2;
textures = new texture_t *[numtextures];
texturecolumnlump = new short *[numtextures];
texturecolumnofs = new unsigned int *[numtextures];
texturecomposite = new byte *[numtextures];
texturecompositesize = new int[numtextures];
texturewidthmask = new int[numtextures];
textureheight = new fixed_t[numtextures];
texturescalex = new fixed_t[numtextures];
texturescaley = new fixed_t[numtextures];
totalwidth = 0;
for (i = 0; i < numtextures; i++, directory++)
{
if (i == numtextures1)
{
// Start looking in second texture file.
maptex = maptex2;
maxoff = maxoff2;
directory = maptex+1;
}
offset = LELONG(*directory);
if (offset > maxoff)
I_FatalError ("R_InitTextures: bad texture directory");
mtexture = (maptexture_t *) ( (byte *)maptex + offset);
texture = textures[i] = (texture_t *)
Z_Malloc (sizeof(texture_t)
+ sizeof(texpatch_t)*(SAFESHORT(mtexture->patchcount)-1),
PU_STATIC, 0);
texture->width = SAFESHORT(mtexture->width);
texture->height = SAFESHORT(mtexture->height);
texture->patchcount = SAFESHORT(mtexture->patchcount);
strncpy (texture->name, mtexture->name, 9); // denis - todo string limit?
std::transform(texture->name, texture->name + strlen(texture->name), texture->name, toupper);
mpatch = &mtexture->patches[0];
patch = &texture->patches[0];
for (j=0 ; j<texture->patchcount ; j++, mpatch++, patch++)
{
patch->originx = LESHORT(mpatch->originx);
patch->originy = LESHORT(mpatch->originy);
patch->patch = patchlookup[LESHORT(mpatch->patch)];
if (patch->patch == -1)
{
Printf (PRINT_HIGH, "R_InitTextures: Missing patch in texture %s\n", texture->name);
errors++;
}
}
texturecolumnlump[i] = new short[texture->width];
texturecolumnofs[i] = new unsigned int[texture->width];
示例10: R_InstallSprite
// [RH] Seperated out of R_InitSpriteDefs()
static void R_InstallSprite (int num, spriteframewithrotate *sprtemp, int &maxframe)
{
int frame;
int framestart;
int rot;
// int undefinedFix;
if (maxframe == -1)
{
sprites[num].numframes = 0;
return;
}
maxframe++;
// [RH] If any frames are undefined, but there are some defined frames, map
// them to the first defined frame. This is a fix for Doom Raider, which actually
// worked with ZDoom 2.0.47, because of a bug here. It does not define frames A,
// B, or C for the sprite PSBG, but because I had sprtemp[].rotate defined as a
// bool, this code never detected that it was not actually present. After switching
// to the unified texture system, this caused it to crash while loading the wad.
// [RH] Let undefined frames actually be blank because LWM uses this in at least
// one of her wads.
// for (frame = 0; frame < maxframe && sprtemp[frame].rotate == -1; ++frame)
// { }
//
// undefinedFix = frame;
for (frame = 0; frame < maxframe; ++frame)
{
switch (sprtemp[frame].rotate)
{
case -1:
// no rotations were found for that frame at all
//I_FatalError ("R_InstallSprite: No patches found for %s frame %c", sprites[num].name, frame+'A');
break;
case 0:
// only the first rotation is needed
for (rot = 1; rot < 16; ++rot)
{
sprtemp[frame].Texture[rot] = sprtemp[frame].Texture[0];
}
// If the frame is flipped, they all should be
if (sprtemp[frame].Flip & 1)
{
sprtemp[frame].Flip = 0xFFFF;
}
break;
case 1:
// must have all 8 frame pairs
for (rot = 0; rot < 8; ++rot)
{
if (!sprtemp[frame].Texture[rot*2+1].isValid())
{
sprtemp[frame].Texture[rot*2+1] = sprtemp[frame].Texture[rot*2];
if (sprtemp[frame].Flip & (1 << (rot*2)))
{
sprtemp[frame].Flip |= 1 << (rot*2+1);
}
}
if (!sprtemp[frame].Texture[rot*2].isValid())
{
sprtemp[frame].Texture[rot*2] = sprtemp[frame].Texture[rot*2+1];
if (sprtemp[frame].Flip & (1 << (rot*2+1)))
{
sprtemp[frame].Flip |= 1 << (rot*2);
}
}
}
for (rot = 0; rot < 16; ++rot)
{
if (!sprtemp[frame].Texture[rot].isValid())
I_FatalError ("R_InstallSprite: Sprite %s frame %c is missing rotations",
sprites[num].name, frame+'A');
}
break;
}
}
for (frame = 0; frame < maxframe; ++frame)
{
if (sprtemp[frame].rotate == -1)
{
memset (&sprtemp[frame].Texture, 0, sizeof(sprtemp[0].Texture));
sprtemp[frame].Flip = 0;
sprtemp[frame].rotate = 0;
}
}
// allocate space for the frames present and copy sprtemp to it
sprites[num].numframes = maxframe;
sprites[num].spriteframes = WORD(framestart = SpriteFrames.Reserve (maxframe));
for (frame = 0; frame < maxframe; ++frame)
{
memcpy (SpriteFrames[framestart+frame].Texture, sprtemp[frame].Texture, sizeof(sprtemp[frame].Texture));
//.........这里部分代码省略.........
示例11: LELONG
void FStringTable::LoadStrings (int lump, int expectedSize, bool enuOnly)
{
BYTE *strData = (BYTE *)W_CacheLumpNum (lump, PU_CACHE);
int lumpLen = LELONG(((Header *)strData)->FileSize);
int nameCount = LESHORT(((Header *)strData)->NameCount);
int nameLen = LESHORT(((Header *)strData)->NameLen);
int languageStart = sizeof(Header) + nameCount*4 + nameLen;
languageStart += (4 - languageStart) & 3;
if (expectedSize >= 0 && nameCount != expectedSize)
{
char name[9];
W_GetLumpName (name, lump);
name[8] = 0;
I_FatalError ("%s had %d strings.\nThis version of ZDoom expects it to have %d.",
name, nameCount, expectedSize);
}
FreeStandardStrings ();
NumStrings = nameCount;
LumpNum = lump;
if (Strings == NULL)
{
Strings = new char *[nameCount];
StringStatus = new BYTE[(nameCount+7)/8];
memset (StringStatus, 0, (nameCount+7)/8); // 0 means: from wad (standard)
memset (Strings, 0, sizeof(char *)*nameCount);
}
BYTE *const start = strData + languageStart;
BYTE *const end = strData + lumpLen;
int loadedCount, i;
for (loadedCount = i = 0; i < NumStrings; ++i)
{
if (Strings[i] != NULL)
{
++loadedCount;
}
}
if (!enuOnly)
{
for (i = 0; i < 4 && loadedCount != nameCount; ++i)
{
loadedCount += LoadLanguage (LanguageIDs[i], true, start, end);
loadedCount += LoadLanguage (LanguageIDs[i] & MAKE_ID(0xff,0xff,0,0), true, start, end);
loadedCount += LoadLanguage (LanguageIDs[i], false, start, end);
}
}
// Fill in any missing strings with the default language (enu)
if (loadedCount != nameCount)
{
loadedCount += LoadLanguage (MAKE_ID('e','n','u',0), true, start, end);
}
DoneLoading (start, end);
if (loadedCount != nameCount)
{
I_FatalError ("Loaded %d strings (expected %d)", loadedCount, nameCount);
}
}
示例12: M_ParseMenuDefs
void M_ParseMenuDefs()
{
int lump, lastlump = 0;
OptionSettings.mTitleColor = V_FindFontColor(gameinfo.mTitleColor);
OptionSettings.mFontColor = V_FindFontColor(gameinfo.mFontColor);
OptionSettings.mFontColorValue = V_FindFontColor(gameinfo.mFontColorValue);
OptionSettings.mFontColorMore = V_FindFontColor(gameinfo.mFontColorMore);
OptionSettings.mFontColorHeader = V_FindFontColor(gameinfo.mFontColorHeader);
OptionSettings.mFontColorHighlight = V_FindFontColor(gameinfo.mFontColorHighlight);
OptionSettings.mFontColorSelection = V_FindFontColor(gameinfo.mFontColorSelection);
DefaultListMenuSettings.Reset();
DefaultOptionMenuSettings.Reset();
atterm( DeinitMenus);
DeinitMenus();
while ((lump = Wads.FindLump ("MENUDEF", &lastlump)) != -1)
{
FScanner sc(lump);
sc.SetCMode(true);
while (sc.GetString())
{
if (sc.Compare("LISTMENU"))
{
ParseListMenu(sc);
}
else if (sc.Compare("DEFAULTLISTMENU"))
{
ParseListMenuBody(sc, &DefaultListMenuSettings);
if (DefaultListMenuSettings.mItems.Size() > 0)
{
I_FatalError("You cannot add menu items to the menu default settings.");
}
}
else if (sc.Compare("OPTIONVALUE"))
{
ParseOptionValue(sc);
}
else if (sc.Compare("OPTIONSTRING"))
{
ParseOptionString(sc);
}
else if (sc.Compare("OPTIONMENUSETTINGS"))
{
ParseOptionSettings(sc);
}
else if (sc.Compare("OPTIONMENU"))
{
ParseOptionMenu(sc);
}
else if (sc.Compare("DEFAULTOPTIONMENU"))
{
ParseOptionMenuBody(sc, &DefaultOptionMenuSettings);
if (DefaultOptionMenuSettings.mItems.Size() > 0)
{
I_FatalError("You cannot add menu items to the menu default settings.");
}
}
else
{
sc.ScriptError("Unknown keyword '%s'", sc.String);
}
}
}
}
示例13: D_Display
//
// D_Display
// draw current display, possibly wiping it from the previous
//
void D_Display (void)
{
BOOL wipe;
if (nodrawers)
return; // for comparative timing / profiling
BEGIN_STAT(D_Display);
if (gamestate == GS_LEVEL && viewactive && consoleplayer().camera)
R_SetFOV (consoleplayer().camera->player ?
consoleplayer().camera->player->fov : 90.0f);
// [RH] change the screen mode if needed
if (setmodeneeded)
{
int oldwidth = screen->width;
int oldheight = screen->height;
int oldbits = DisplayBits;
// Change screen mode.
if (!V_SetResolution (NewWidth, NewHeight, NewBits))
if (!V_SetResolution (oldwidth, oldheight, oldbits))
I_FatalError ("Could not change screen mode");
// Recalculate various view parameters.
setsizeneeded = true;
// Trick status bar into rethinking its position
st_scale.Callback ();
// Refresh the console.
C_NewModeAdjust ();
}
// change the view size if needed
if (setsizeneeded)
{
R_ExecuteSetViewSize ();
setmodeneeded = false;
}
I_BeginUpdate ();
// [RH] Allow temporarily disabling wipes
if (NoWipe)
{
NoWipe--;
wipe = false;
wipegamestate = gamestate;
}
else if (gamestate != wipegamestate && gamestate != GS_FULLCONSOLE)
{ // save the current screen if about to wipe
wipe = true;
wipe_StartScreen ();
wipegamestate = gamestate;
}
else
{
wipe = false;
}
switch (gamestate)
{
case GS_FULLCONSOLE:
case GS_DOWNLOAD:
case GS_CONNECTING:
C_DrawConsole ();
M_Drawer ();
I_FinishUpdate ();
return;
case GS_LEVEL:
if (!gametic)
break;
// denis - freshen the borders (ffs..)
R_DrawViewBorder (); // erase old menu stuff
if (viewactive)
R_RenderPlayerView (&displayplayer());
if (automapactive)
AM_Drawer ();
C_DrawMid ();
CTF_DrawHud ();
ST_Drawer ();
HU_Drawer ();
break;
case GS_INTERMISSION:
if (viewactive)
R_RenderPlayerView (&displayplayer());
C_DrawMid ();
CTF_DrawHud ();
WI_Drawer ();
HU_Drawer ();
break;
//.........这里部分代码省略.........
示例14: D_DoomMain
//
// D_DoomMain
//
void D_DoomMain (void)
{
unsigned p;
const char *iwad;
extern std::string defdemoname;
M_ClearRandom();
gamestate = GS_STARTUP;
SetLanguageIDs ();
M_FindResponseFile(); // [ML] 23/1/07 - Add Response file support back in
if (lzo_init () != LZO_E_OK) // [RH] Initialize the minilzo package.
I_FatalError ("Could not initialize LZO routines");
C_ExecCmdLineParams (false, true); // [Nes] test for +logfile command
Printf (PRINT_HIGH, "Heapsize: %u megabytes\n", got_heapsize);
M_LoadDefaults (); // load before initing other systems
C_ExecCmdLineParams (true, false); // [RH] do all +set commands on the command line
iwad = Args.CheckValue("-iwad");
if(!iwad)
iwad = "";
D_AddDefWads(iwad);
D_AddCmdParameterFiles();
wadhashes = W_InitMultipleFiles (wadfiles);
// [RH] Initialize localizable strings.
GStrings.LoadStrings (W_GetNumForName ("LANGUAGE"), STRING_TABLE_SIZE, false);
GStrings.Compact ();
// [RH] Initialize configurable strings.
//D_InitStrings ();
D_DoDefDehackedPatch ();
// [RH] Moved these up here so that we can do most of our
// startup output in a fullscreen console.
HU_Init ();
I_Init ();
V_Init ();
// Base systems have been inited; enable cvar callbacks
cvar_t::EnableCallbacks ();
// [RH] User-configurable startup strings. Because BOOM does.
if (GStrings(STARTUP1)[0]) Printf (PRINT_HIGH, "%s\n", GStrings(STARTUP1));
if (GStrings(STARTUP2)[0]) Printf (PRINT_HIGH, "%s\n", GStrings(STARTUP2));
if (GStrings(STARTUP3)[0]) Printf (PRINT_HIGH, "%s\n", GStrings(STARTUP3));
if (GStrings(STARTUP4)[0]) Printf (PRINT_HIGH, "%s\n", GStrings(STARTUP4));
if (GStrings(STARTUP5)[0]) Printf (PRINT_HIGH, "%s\n", GStrings(STARTUP5));
// Nomonsters
sv_nomonsters = Args.CheckParm("-nomonsters");
// Respawn
sv_monstersrespawn = Args.CheckParm("-respawn");
// Fast
sv_fastmonsters = Args.CheckParm("-fast");
// developer mode
devparm = Args.CheckParm ("-devparm");
// Record a vanilla demo
p = Args.CheckParm ("-record");
if (p)
{
autorecord = true;
autostart = true;
demorecordfile = Args.GetArg (p+1);
}
// get skill / episode / map from parms
strcpy (startmap, (gameinfo.flags & GI_MAPxx) ? "MAP01" : "E1M1");
// Check for -playdemo, play a single demo then quit.
p = Args.CheckParm ("-playdemo");
// Hack to check for +playdemo command, since if you just add it normally
// it won't run because it's attempting to run a demo and still set up the
// first map as normal.
if (!p)
p = Args.CheckParm ("+playdemo");
if (p && p < Args.NumArgs()-1)
{
Printf (PRINT_HIGH, "Playdemo parameter found on command line.\n");
singledemo = true;
defdemoname = Args.GetArg (p+1);
}
const char *val = Args.CheckValue ("-skill");
if (val)
{
//.........这里部分代码省略.........
示例15: D_DoomMain
void D_DoomMain (void)
{
M_ClearRandom();
gamestate = GS_STARTUP;
if (lzo_init () != LZO_E_OK) // [RH] Initialize the minilzo package.
I_FatalError ("Could not initialize LZO routines");
C_ExecCmdLineParams (false, true); // [Nes] test for +logfile command
I_Init ();
D_CheckNetGame ();
M_LoadDefaults (); // load before initing other systems
M_FindResponseFile(); // [ML] 23/1/07 - Add Response file support back in
C_ExecCmdLineParams (true, false); // [RH] do all +set commands on the command line
//D_AddDefWads();
//SV_InitMultipleFiles (wadfiles);
//wadhashes = W_InitMultipleFiles (wadfiles);
// Base systems have been inited; enable cvar callbacks
cvar_t::EnableCallbacks ();
// [RH] Initialize configurable strings.
D_InitStrings ();
// [RH] User-configurable startup strings. Because BOOM does.
if (STARTUP1[0]) Printf (PRINT_HIGH, "%s\n", STARTUP1);
if (STARTUP2[0]) Printf (PRINT_HIGH, "%s\n", STARTUP2);
if (STARTUP3[0]) Printf (PRINT_HIGH, "%s\n", STARTUP3);
if (STARTUP4[0]) Printf (PRINT_HIGH, "%s\n", STARTUP4);
if (STARTUP5[0]) Printf (PRINT_HIGH, "%s\n", STARTUP5);
devparm = Args.CheckParm ("-devparm");
// get skill / episode / map from parms
strcpy (startmap, (gameinfo.flags & GI_MAPxx) ? "MAP01" : "E1M1");
const char *val = Args.CheckValue ("-skill");
if (val)
{
skill.Set (val[0]-'0');
}
unsigned p = Args.CheckParm ("-warp");
if (p && p < Args.NumArgs() - (1+(gameinfo.flags & GI_MAPxx ? 0 : 1)))
{
int ep, map;
if (gameinfo.flags & GI_MAPxx)
{
ep = 1;
map = atoi (Args.GetArg(p+1));
}
else
{
ep = Args.GetArg(p+1)[0]-'0';
map = Args.GetArg(p+2)[0]-'0';
}
strncpy (startmap, CalcMapName (ep, map), 8);
autostart = true;
}
// [RH] Hack to handle +map
p = Args.CheckParm ("+map");
if (p && p < Args.NumArgs()-1)
{
strncpy (startmap, Args.GetArg (p+1), 8);
((char *)Args.GetArg (p))[0] = '-';
autostart = true;
}
if (devparm)
Printf (PRINT_HIGH, "%s", Strings[0].builtin); // D_DEVSTR
const char *v = Args.CheckValue ("-timer");
if (v)
{
double time = atof (v);
Printf (PRINT_HIGH, "Levels will end after %g minute%s.\n", time, time > 1 ? "s" : "");
timelimit.Set ((float)time);
}
const char *w = Args.CheckValue ("-avg");
if (w)
{
Printf (PRINT_HIGH, "Austin Virtual Gaming: Levels will end after 20 minutes\n");
timelimit.Set (20);
}
// Check for -file in shareware
if (modifiedgame && (gameinfo.flags & GI_SHAREWARE))
I_FatalError ("You cannot -file with the shareware version. Register!");
// [RH] Initialize items. Still only used for the give command. :-(
InitItems ();
//.........这里部分代码省略.........