当前位置: 首页>>代码示例>>C++>>正文


C++ FindArg函数代码示例

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


在下文中一共展示了FindArg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: EvalSoundArgs

void EvalSoundArgs (void)
{
	int	t;

#if USE_SDL_MIXER
#	ifdef __macosx__
void * volatile function_p = (void *)&(Mix_OpenAudio);
if (function_p == NULL) {

	// the SDL_mixer framework is not present,
	// so regardless of what conf.h or d2x.ini says,
	// we don't want to use SDL_mixer
	
	gameOptions [0].sound.bUseSDLMixer = 0;
	}
else 
#	endif //__macosx__
if ((t = FindArg ("-sdl_mixer")))
	gameOptions [0].sound.bUseSDLMixer = NumArg (t, 1);
#endif //USE_SDL_MIXER
if ((t = FindArg ("-noredbook")))
	gameOptions [0].sound.bUseRedbook = 0;
#if USE_SDL_MIXER
if (gameOptions [0].sound.bUseSDLMixer) {
	if ((t = FindArg ("-hires_sound")))
		gameOptions [0].sound.bHires [0] =
		gameOptions [0].sound.bHires [1] = NumArg (t, 2);
	}
#endif
}
开发者ID:paud,项目名称:d2x-xl,代码行数:30,代码来源:gameargs.cpp

示例2: arch_init

void arch_init()
{
 // Initialise the library
#ifdef __SDL__
	arch_sdl_init();
#endif
#ifdef __SVGALIB__
	arch_svgalib_init();
#endif
	if (!FindArg( "-nojoystick" ))  {
		if (Inferno_verbose) printf( "\n%s", TXT_VERBOSE_6);
		joy_init();
	}
	//added 06/09/99 Matt Mueller - fix nonetwork compile
#ifdef NETWORK
	//end addition -MM
//added on 10/19/98 by Victor Rachels to add serial support (from DPH)
    if(!(FindArg("-noserial")))
     com_init();
//end this section addition - Victor 
	//added 06/09/99 Matt Mueller - fix nonetwork compile
#endif
	//end addition -MM
     timer_init();
    key_init();
}
开发者ID:Ringdingcoder,项目名称:d1x,代码行数:26,代码来源:init.c

示例3: dd_gfx_init

int dd_gfx_init()
{
	int i;
	
	if (dd_gfx_initialized) return 1;

	for (i = 0; i < MAX_GFX_BITMAPS; i++)
		gfxBitmap[i].lpdds = NULL;

	gfxBitmapHandleCur = 1;

	atexit(dd_gfx_close);


	if (FindArg("-disallowgfx")) dd_gfx_initialized = 0;
	else if (FindArg("-forcegfx")) dd_gfx_initialized = 1;
	else {
		if (ddDriverCaps.hwcolorkey) 
			logentry("Card supports HW colorkeying.\n");

		if (ddDriverCaps.hwbltstretch)
			logentry("Card supports HW bitmap stretching.\n");
		
		if (ddDriverCaps.hwcolorkey) dd_gfx_initialized = 1;
		else dd_gfx_initialized = 0;
	}

	return 0;
}
开发者ID:btb,项目名称:d2x,代码行数:29,代码来源:ddgfx.c

示例4: gamefont_init

void gamefont_init()
{
	int i;

	if (Gamefont_installed) return;
	Gamefont_installed = 1;

	for (i=0;i<MAX_FONTS;i++){
		Gamefonts[i]=NULL;
		addfontconf(i,0,Gamefont_filenames_l[i]);
		addfontconf(i,640,Gamefont_filenames_h[i]);
	}

//	addfontconf(640,"pc6x8.fnt");
//	addfontconf(1024,"pc8x16.fnt");
	if ((i=FindArg("-font320")))
		addfontconf(4,320,Args[i+1]);
	if ((i=FindArg("-font640")))
		addfontconf(4,640,Args[i+1]);
	if ((i=FindArg("-font800")))
		addfontconf(4,800,Args[i+1]);
	if ((i=FindArg("-font1024")))
		addfontconf(4,1024,Args[i+1]);
	
	gamefont_choose_game_font(grd_curscreen->sc_canvas.cv_bitmap.bm_w,grd_curscreen->sc_canvas.cv_bitmap.bm_h);
	
	atexit( gamefont_close );
}
开发者ID:Ringdingcoder,项目名称:d1x,代码行数:28,代码来源:gamefont.c

示例5: EvalDemoArgs

void EvalDemoArgs (void)
{
	int	t;

if ((t = FindArg ("-revert_demos")))
	gameOpts->demo.bRevertFormat = NumArg (t, 1);
if ((t = FindArg ("-auto_demos")))
	gameStates.app.bAutoDemos = NumArg (t, 1);
}
开发者ID:paud,项目名称:d2x-xl,代码行数:9,代码来源:gameargs.cpp

示例6: GrInit

int GrInit (void)
{
	int mode = SM (800, 600);
	int retcode, t;

// Only do this function once!
if (gameStates.gfx.bInstalled)
	return -1;

#ifdef OGL_RUNTIME_LOAD
OglInitLoadLibrary ();
#endif
/***/PrintLog ("   initializing SDL\n");
#if !USE_IRRLICHT
if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) {
	PrintLog ("SDL library video initialisation failed: %s.\n", SDL_GetError());
	Error ("SDL library video initialisation failed: %s.", SDL_GetError());
}
#endif
#if DBG
	ogl.m_states.bFullScreen = 0;
#else
if ((t = FindArg ("-fullscreen"))) {
	/***/PrintLog ("   switching to fullscreen\n");
	ogl.m_states.bFullScreen = NumArg (t, 1);
	//GrToggleFullScreen();
	}
#endif
/***/PrintLog ("   initializing internal texture list\n");
textureManager.Init ();
/***/PrintLog ("   allocating screen buffer\n");
screen.Canvas ()->SetBuffer (NULL);

// Set the mode.
for (t = 0; scrSizes [t].x && scrSizes [t].y; t++)
	if (FindArg (ScrSizeArg (scrSizes [t].x, scrSizes [t].y))) {
		gameStates.gfx.bOverride = 1;
		gameStates.gfx.nStartScrSize =
		mode = SM (scrSizes [t].x, scrSizes [t].y);
		gameStates.gfx.nStartScrMode = FindDisplayMode (mode);
		break;
		}
if ((retcode = GrSetMode (mode)))
	return retcode;

gameStates.gfx.bInstalled = 1;
InitGammaRamp ();
//atexit(GrClose);
/***/PrintLog ("   initializing OpenGL extensions\n");
ogl.SetRenderQuality ();
ogl.SetupExtensions ();
ogl.DestroyDrawBuffer ();
ogl.CreateDrawBuffer ();
ogl.SetDrawBuffer (GL_BACK, 1);
return 0;
}
开发者ID:paud,项目名称:d2x-xl,代码行数:56,代码来源:gr.cpp

示例7: EvalGameplayArgs

void EvalGameplayArgs (void)
{
	int	t;

if ((t = FindArg ("-noscreens")))
	gameOpts->gameplay.bSkipBriefingScreens = NumArg (t, 1);
if ((t = FindArg ("-secretsave")))
	gameOptions [0].gameplay.bSecretSave = NumArg (t, 1);
if ((t = FindArg ("-nobotai")))
	gameStates.gameplay.bNoBotAI = NumArg (t, 1);
}
开发者ID:paud,项目名称:d2x-xl,代码行数:11,代码来源:gameargs.cpp

示例8: DoJoystickInit

void DoJoystickInit ()
{

if (!FindArg ("-nojoystick")) {
	JoyInit ();
	if (FindArg ("-joyslow"))
		JoySetSlowReading (JOY_SLOW_READINGS);
	if (FindArg ("-joypolled"))
		JoySetSlowReading (JOY_POLLED_READINGS);
	if (FindArg ("-joybios"))
		JoySetSlowReading (JOY_BIOS_READINGS);
	}
}
开发者ID:paud,项目名称:d2x-xl,代码行数:13,代码来源:descent.cpp

示例9: state_save_all

int state_save_all(int between_levels)
{
	char filename[128], desc[DESC_LENGTH+1];

	if ( Game_mode & GM_MULTI )	{
#ifdef MULTI_SAVE
		if ( FindArg( "-multisave" ) )
			multi_initiate_save_game();
		else
#endif  
			HUD_init_message( "Can't save in a multiplayer game!" );
		return 0;
	}

	mprintf(( 0, "CL=%d, NL=%d\n", Current_level_num, Next_level_num ));
	
	stop_time();

	if (!state_get_save_file(filename,desc,0))	{
		start_time();
		return 0;
	}
		
	return state_save_all_sub(filename, desc, between_levels);
}
开发者ID:osgcc,项目名称:descent-mac,代码行数:25,代码来源:state.c

示例10: sizeof

char *GetIniFileName (char *fnIni, int bDebug)
{
	int	i;

if ((i = FindArg ("-ini")))
	strncpy (fnIni, Args [i + 1], sizeof (fnIni) - 1);
else {
#if defined(__unix__)
	FFS		ffs;
	strcpy (fnIni, gameFolders.szHomeDir);
	if (bDebug)
		strcat (fnIni, "/.d2x-xl-dbg");
	else
		strcat (fnIni, "/.d2x-xl");
	if (FFF (fnIni, &ffs, 0) <= 0) {
#endif
	strcpy (fnIni, gameFolders.szConfigDir);
	if (*fnIni)
		strcat (fnIni, "/");
	if (bDebug)
		strcat (fnIni, "d2xdebug.ini");
	else
		strcat (fnIni, "d2x.ini");
#if defined(__unix__)
   }
#endif //!__unix__
	}
return fnIni;
}
开发者ID:paud,项目名称:d2x-xl,代码行数:29,代码来源:args.c

示例11: EvalMusicArgs

void EvalMusicArgs (void)
{
	int	t;
	char	*p;

if ((t = FindArg ("-playlist")) && (p = pszArgList [t+1]))
	songManager.LoadPlayList (p);
if ((t = FindArg ("-introsong")) && (p = pszArgList [t+1]))
	strncpy (songManager.IntroSong (), p, FILENAME_LEN);
if ((t = FindArg ("-briefingsong")) && (p = pszArgList [t+1]))
	strncpy (songManager.BriefingSong (), p, FILENAME_LEN);
if ((t = FindArg ("-creditssong")) && (p = pszArgList [t+1]))
	strncpy (songManager.CreditsSong (), p, FILENAME_LEN);
if ((t = FindArg ("-menusong")) && (p = pszArgList [t+1]))
	strncpy (songManager.MenuSong (), p, FILENAME_LEN);
}
开发者ID:paud,项目名称:d2x-xl,代码行数:16,代码来源:gameargs.cpp

示例12: PiggyRegisterBitmap

tBitmapIndex PiggyRegisterBitmap (grsBitmap *bmP, const char *name, int bInFile)
{
	tBitmapIndex temp;
	Assert (gameData.pig.tex.nBitmaps [gameStates.app.bD1Data] < MAX_BITMAP_FILES);

if (strstr (name, "door13"))
	name = name;
temp.index = gameData.pig.tex.nBitmaps [gameStates.app.bD1Data];
if (!bInFile) {
#ifdef EDITOR
	if (FindArg ("-macdata"))
		swap_0_255 (bmP);
#endif
	if (!bBigPig)  
		gr_bitmap_rle_compress (bmP);
	nBitmapFilesNew++;
	}
strncpy (gameData.pig.tex.pBitmapFiles [gameData.pig.tex.nBitmaps [gameStates.app.bD1Data]].name, name, 12);
HashTableInsert (bitmapNames + gameStates.app.bD1Mission, 
						gameData.pig.tex.pBitmapFiles[gameData.pig.tex.nBitmaps [gameStates.app.bD1Data]].name, 
						gameData.pig.tex.nBitmaps [gameStates.app.bD1Data]);
gameData.pig.tex.pBitmaps [gameData.pig.tex.nBitmaps [gameStates.app.bD1Data]] = *bmP;
if (!bInFile) {
	bitmapOffsets [gameStates.app.bD1Data][gameData.pig.tex.nBitmaps [gameStates.app.bD1Data]] = 0;
	gameData.pig.tex.bitmapFlags [gameStates.app.bD1Data][gameData.pig.tex.nBitmaps [gameStates.app.bD1Data]] = bmP->bmProps.flags;
	}
gameData.pig.tex.nBitmaps [gameStates.app.bD1Data]++;
return temp;
}
开发者ID:paud,项目名称:d2x-xl,代码行数:29,代码来源:piggy.cpp

示例13: RBAInit

void RBAInit()
{
	if (initialised) return;
	if (FindArg("-nocdrom")) return; 

	if (SDL_Init(SDL_INIT_CDROM) < 0)
	{
		Warning("SDL library initialisation failed: %s.",SDL_GetError());
		return;
	}

	if (SDL_CDNumDrives() == 0)
	{
		Warning("No cdrom drives found!\n");
		return;
	}
	s_cd = SDL_CDOpen(0);
	if (s_cd == NULL) {
		Warning("Could not open cdrom for redbook audio!\n");
		return;
	}

	SDL_CDStatus(s_cd); /* update the drive status */

	atexit(RBAExit);
	initialised = 1;
}
开发者ID:btb,项目名称:d2x,代码行数:27,代码来源:rbaudio.c

示例14: EvalInputArgs

void EvalInputArgs (void)
{
	int	t;

if ((t = FindArg ("-grabmouse")))
	gameStates.input.bGrabMouse = NumArg (t, 1);
}
开发者ID:paud,项目名称:d2x-xl,代码行数:7,代码来源:gameargs.cpp

示例15: ShowTitleScreens

int ShowTitleScreens (void)
{
	int nPlayed = MOVIE_NOT_PLAYED;	//default is not nPlayed
#if DBG
if (FindArg ("-notitles"))
	songManager.Play (SONG_TITLE, 1);
else
#endif
 {	//NOTE LINK TO ABOVE!
	int bSongPlaying = 0;
	if (movieManager.m_bHaveExtras) {
		nPlayed = movieManager.Play ("starta.mve", MOVIE_REQUIRED, 0, gameOpts->movies.bResize);
		if (nPlayed == MOVIE_ABORTED)
			nPlayed = MOVIE_PLAYED_FULL;
		else
			nPlayed = movieManager.Play ("startb.mve", MOVIE_REQUIRED, 0, gameOpts->movies.bResize);
		}
	else {
		movieManager.PlayIntro ();
		}

	if (!bSongPlaying)
		songManager.Play (SONG_TITLE, 1);
	}
return (nPlayed != MOVIE_NOT_PLAYED);	//default is not nPlayed
}
开发者ID:paud,项目名称:d2x-xl,代码行数:26,代码来源:descent.cpp


注:本文中的FindArg函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。