• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ I_FatalError函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中I_FatalError函数的典型用法代码示例。如果您正苦于以下问题:C++ I_FatalError函数的具体用法?C++ I_FatalError怎么用?C++ I_FatalError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了I_FatalError函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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]
}
开发者ID:ddraigcymraeg,项目名称:scoredoomst,代码行数:24,代码来源:hardware.cpp


示例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");
	}
}
开发者ID:alexey-lysiuk,项目名称:gzdoom-osx,代码行数:24,代码来源:d_iwad.cpp


示例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);
}
开发者ID:davidsgalbraith,项目名称:odamex,代码行数:27,代码来源:i_net.cpp


示例4: NewFailure

static int NewFailure (size_t size)
{
	I_FatalError ("Failed to allocate %d bytes from process heap", size);
	return 0;
}
开发者ID:floverdevel,项目名称:zdoom,代码行数:5,代码来源:i_main.cpp


示例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);
}
开发者ID:Altazimuth,项目名称:eternity,代码行数:12,代码来源:z_native.cpp


示例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)
//.........这里部分代码省略.........
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:101,代码来源:d_main.cpp


示例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);
开发者ID:WChrisK,项目名称:Zandronum,代码行数:67,代码来源:d_iwad.cpp


示例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;
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:96,代码来源:d_main.cpp


示例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];
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:66,代码来源:r_data.cpp


示例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));
//.........这里部分代码省略.........
开发者ID:floverdevel,项目名称:zdoom,代码行数:101,代码来源:sprites.cpp


示例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);
	}
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:67,代码来源:stringtable.cpp


示例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);
			}
		}
	}
}
开发者ID:sieg-lu,项目名称:columbine-mod-doom,代码行数:66,代码来源:menudef.cpp


示例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;

//.........这里部分代码省略.........
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:101,代码来源:d_main.cpp


示例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)
    {
//.........这里部分代码省略.........
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:101,代码来源:d_main.cpp


示例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 ();

//.........这里部分代码省略.........
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:101,代码来源:d_main.cpp


示例16: SaveList

void DThinker::SerializeAll(FArchive &arc, bool hubLoad)
{
	DThinker *thinker;
	BYTE stat;
	int statcount;
	int i;

	// Save lists of thinkers, but not by storing the first one and letting
	// the archiver catch the rest. (Which leads to buttloads of recursion
	// and makes the file larger.) Instead, we explicitly save each thinker
	// in sequence. When restoring an archive, we also have to maintain
	// the thinker lists here instead of relying on the archiver to do it
	// for us.

	if (arc.IsStoring())
	{
		for (statcount = i = 0; i <= MAX_STATNUM; i++)
		{
			statcount += (!Thinkers[i].IsEmpty() || !FreshThinkers[i].IsEmpty());
		}
		arc << statcount;
		for (i = 0; i <= MAX_STATNUM; i++)
		{
			if (!Thinkers[i].IsEmpty() || !FreshThinkers[i].IsEmpty())
			{
				stat = i;
				arc << stat;
				SaveList(arc, Thinkers[i].GetHead());
				SaveList(arc, FreshThinkers[i].GetHead());
				thinker = NULL;
				arc << thinker;		// Save a final NULL for this list
			}
		}
	}
	else
	{
		if (hubLoad)
			DestroyMostThinkers();
		else
			DestroyAllThinkers();

		// Prevent the constructor from inserting thinkers into a list.
		bSerialOverride = true;

		try
		{
			arc << statcount;
			while (statcount > 0)
			{
				arc << stat << thinker;
				while (thinker != NULL)
				{
					// This may be a player stored in their ancillary list. Remove
					// them first before inserting them into the new list.
					if (thinker->NextThinker != NULL)
					{
						thinker->Remove();
					}
					// Thinkers with the OF_JustSpawned flag set go in the FreshThinkers
					// list. Anything else goes in the regular Thinkers list.
					if (thinker->ObjectFlags & OF_EuthanizeMe)
					{
						// This thinker was destroyed during the loading process. Do
						// not link it in to any list.
					}
					else if (thinker->ObjectFlags & OF_JustSpawned)
					{
						FreshThinkers[stat].AddTail(thinker);
					}
					else
					{
						Thinkers[stat].AddTail(thinker);
					}
					arc << thinker;
				}
				statcount--;
			}
		}
		catch (class CDoomError &err)
		{
			bSerialOverride = false;

			// DestroyAllThinkers cannot be called here. It will try to delete the corrupted
			// object table left behind by the serializer and crash.
			// Trying to continue is not an option here because the garbage collector will 
			// crash the next time it runs.
			// Even making this a fatal error will crash but at least the message can be seen
			// before the crash - which is not the case with all other options.

			//DestroyAllThinkers();
			I_FatalError("%s", err.GetMessage());
			throw;
		}
		bSerialOverride = false;
	}
}
开发者ID:Xeomuz,项目名称:Doom-Port-Source-Code,代码行数:96,代码来源:dthinker.cpp


示例17: I_FatalError

GLVideo::GLVideo(int parm)
{
	if (SDL_InitSubSystem (SDL_INIT_VIDEO) == -1)
	{
		I_FatalError("Could not initialize SDL video.\n");
		return;
	}

	// [Russell] - A basic version string that will eventually get replaced
	//             better than "Odamex SDL Alpha Build 001" or something :P
	std::string title = "Odamex - v";
	title += DOTVERSIONSTR;

	// [Russell] - Update window caption with name
	SDL_WM_SetCaption (title.c_str(), title.c_str());

   sdlScreen = NULL;
   infullscreen = false;
   screenw = screenh = screenbits = 0;
   palettechanged = false;

   chainHead = new cChain(NULL);

   // Get Video modes
   SDL_PixelFormat fmt;
   fmt.palette = NULL;
   fmt.BitsPerPixel = 8;
   fmt.BytesPerPixel = 1;

   SDL_Rect **sdllist = SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);

   vidModeList = NULL;
   vidModeCount = 0;

   if(!sdllist)
   {
	  // no fullscreen modes, but we could still try windowed
	  Printf(PRINT_HIGH, "SDL_ListModes returned NULL. No fullscreen video modes are available.\n");
      vidModeList = NULL;
	  vidModeCount = 0;
	  return;
   }
   else if(sdllist == (SDL_Rect **)-1)
   {
      I_FatalError("SDL_ListModes returned -1. Internal error.\n");
      return;
   }
   else
   {
      int i;
      for(i = 0; sdllist[i]; i++)
         ;

      vidModeList = new vidMode[i];
      vidModeCount = i;

      for(i = 0; sdllist[i]; i++)
      {
         vidModeList[i].width = sdllist[i]->w;
         vidModeList[i].height = sdllist[i]->h;
         vidModeList[i].bits = 8;
      }
   }
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:64,代码来源:i_glvideo.cpp


示例18: NewFailure

static void STACK_ARGS NewFailure ()
{
    I_FatalError ("Failed to allocate memory from system heap");
}
开发者ID:Xeomuz,项目名称:Doom-Port-Source-Code,代码行数:4,代码来源:i_main.cpp


示例19: D_DoomMain

void D_DoomMain (void)
{
	const char *iwad;
	
	M_ClearRandom();

	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
	
	// Always log by default
    if (!LOG.is_open())
    	C_DoCommand("logfile");

	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);
	SV_InitMultipleFiles (wadfiles);
	
	// [RH] Initialize configurable strings.
	D_InitStrings ();
	D_DoDefDehackedPatch();
	
	I_Init ();

	// Base systems have been inited; enable cvar callbacks
	cvar_t::EnableCallbacks ();

	// [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)
	{
		sv_skill.Set (val[0]-'0');
	}

	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" : "");
		sv_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");
		sv_timelimit.Set (20);
	}
	
	// [RH] Now that all text strings are set up,
	// insert them into the level and cluster data.
	G_SetLevelStrings ();
	// [RH] Parse through all loaded mapinfo lumps
	G_ParseMapInfo ();	
	// [RH] Parse any SNDINFO lumps
	S_ParseSndInfo();

	// Check for -file in shareware
	if (modifiedgame && (gameinfo.flags & GI_SHAREWARE))
		I_FatalError ("You cannot -file with the shareware version. Register!");

	Printf (PRINT_HIGH, "R_Init: Init DOOM refresh daemon.\n");
	R_Init ();

	Printf (PRINT_HIGH, "P_Init: Init Playloop state.\n");
	P_Init ();
		
	Printf (PRINT_HIGH, "SV_InitNetwork: Checking network game status.\n");
    SV_InitNetwork();
		
	// [RH] Initialize items. Still only used for the give command. :-(
//.........这里部分代码省略.........
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:101,代码来源:d_main.cpp


示例20: glBindFramebuffer

bool FGLRenderBuffers::Setup(int width, int height, int sceneWidth, int sceneHeight)
{
	if (gl_renderbuffers != BuffersActive)
	{
		if (BuffersActive)
			glBindFramebuffer(GL_FRAMEBUFFER, mOutputFB);
		BuffersActive = gl_renderbuffers;
		GLRenderer->mShaderManager->ResetFixedColormap();
	}

	if (!IsEnabled())
		return false;
		
	if (width <= 0 || height <= 0)
		I_FatalError("Requested invalid render buffer sizes: screen = %dx%d", width, height);

	int samples = clamp((int)gl_multisample, 0, mMaxSamples);
	bool needsSceneTextures = (gl_ssao != 0);

	GLint activeTex;
	GLint textureBinding;
	glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTex);
	glActiveTexture(GL_TEXTURE0);
	glGetIntegerv(GL_TEXTURE_BINDING_2D, &textureBinding);

	if (width != mWidth || height != mHeight)
		CreatePipeline(width, height);

	if (width != mWidth || height != mHeight || mSamples != samples || mSceneUsesTextures != needsSceneTextures)
		CreateScene(width, height, samples, needsSceneTextures);

	mWidth = width;
	mHeight = height;
	mSamples = samples;
	mSceneUsesTextures = needsSceneTextures;

	// Bloom bluring buffers need to match the scene to avoid bloom bleeding artifacts
	if (mSceneWidth != sceneWidth || mSceneHeight != sceneHeight)
	{
		CreateBloom(sceneWidth, sceneHeight);
		CreateExposureLevels(sceneWidth, sceneHeight);
		CreateAmbientOcclusion(sceneWidth, sceneHeight);
		mSceneWidth = sceneWidth;
		mSceneHeight = sceneHeight;
	}

	glBindTexture(GL_TEXTURE_2D, textureBinding);
	glActiveTexture(activeTex);
	glBindRenderbuffer(GL_RENDERBUFFER, 0);
	glBindFramebuffer(GL_FRAMEBUFFER, 0);

	if (FailedCreate)
	{
		ClearScene();
		ClearPipeline();
		ClearEyeBuffers();
		ClearBloom();
		ClearExposureLevels();
		mWidth = 0;
		mHeight = 0;
		mSamples = 0;
		mSceneWidth = 0;
		mSceneHeight = 0;
	}

	return !FailedCreate;
}
开发者ID:Xane123,项目名称:world-of-kirbycraft,代码行数:67,代码来源:gl_renderbuffers.cpp



注:本文中的I_FatalError函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ I_GetTime函数代码示例发布时间:2022-05-30
下一篇:
C++ I_Error函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap