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

C++ SFxHelper类代码示例

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

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



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

示例1: ParseFX

static bool ParseFX( const CGPProperty& grp, CFxScheduler& scheduler, CMediaHandles& handles, SFxHelper& helper, int& flags, int successFlags, gsl::czstring loadError, gsl::czstring emptyError )
{
	bool any = false;
	for( auto& value : grp.GetValues() )
	{
		if( !value.empty() )
		{
			any = true;
			// TODO: string_view parameter
			int handle = scheduler.RegisterEffect( std::string( value.begin(), value.end() ).c_str() );
			if( handle )
			{
				handles.AddHandle( handle );
				flags |= successFlags;
			}
			else
			{
				helper.Print( "%s", loadError );
			}
		}
	}
	if( !any )
	{
		helper.Print( "%s", emptyError );
	}
	return any;
}
开发者ID:nikaza,项目名称:OpenJK,代码行数:27,代码来源:FxTemplate.cpp


示例2:

//-------------------------
// FX_Init
//
// Preps system for use
//-------------------------
int	FX_Init( refdef_t* refdef )
{ 
//	FX_Free( true );
	if ( fxInitialized == qfalse )
	{
		fxInitialized = qtrue;

		for ( int i = 0; i < MAX_EFFECTS; i++ )
		{
			effectList[i].mEffect = 0;
		}
	}
	nextValidEffect = &effectList[0];

#ifdef _DEBUG
	fx_freeze = Cvar_Get("fx_freeze", "0", CVAR_CHEAT);
#endif
	fx_debug = Cvar_Get("fx_debug", "0", CVAR_TEMP);
	fx_countScale = Cvar_Get("fx_countScale", "1", CVAR_ARCHIVE);
	fx_nearCull = Cvar_Get("fx_nearCull", "16", CVAR_ARCHIVE);

	fx_forcePhysics = Cvar_Get("fx_forcePhysics", "13", CVAR_ARCHIVE);

	theFxHelper.ReInit(refdef);

	return true;
}
开发者ID:Stoiss,项目名称:jaMME,代码行数:32,代码来源:FxUtil.cpp


示例3: FX_CopeWithAnyLoadedSaveGames

//-------------------------
// FX_Init
//
// Preps system for use
//-------------------------
int	FX_Init( void )
{ 
	if ( fxInitialized == qfalse )
	{
		fxInitialized = qtrue;

		for ( int i = 0; i < MAX_EFFECTS; i++ )
		{
			effectList[i].mEffect = 0;
		}
	}

	FX_Free();

	mMax = 0;
	mMaxTime = 0;

	nextValidEffect = &effectList[0];
	theFxHelper.Init();

	// ( nothing to see here, go away )
	//
	extern void FX_CopeWithAnyLoadedSaveGames();
	FX_CopeWithAnyLoadedSaveGames();

	return true;
}
开发者ID:BSzili,项目名称:OpenJK,代码行数:32,代码来源:FxUtil.cpp


示例4: FX_Add

//-------------------------
// FX_Add
//
// Adds all fx to the view
//-------------------------
void FX_Add( bool portal )
{
	int			i;
	SEffectList	*ef;
	
	drawnFx = 0;

	int numFx = activeFx;	//but stop when there can't be any more left!
	for ( i = 0, ef = effectList; i < MAX_EFFECTS && numFx; i++, ef++ )
	{
		if ( ef->mEffect != 0)
		{ 
			--numFx;
			if (portal != ef->mPortal)
			{
				continue;	//this one does not render in this scene
			}
			// Effect is active
			if ( theFxHelper.mTime > ef->mKillTime )
			{ 
				// Clean up old effects, calling any death effects as needed
				// this flag just has to be cleared otherwise death effects might not happen correctly
				ef->mEffect->ClearFlags( FX_KILL_ON_IMPACT ); 
				FX_FreeMember( ef );
			}
			else
			{
				if ( ef->mEffect->Update() == false )
				{
					// We've been marked for death
					FX_FreeMember( ef );
					continue;
				}
			}
		}
	}


	if ( fx_debug->integer && !portal)
	{
		theFxHelper.Print( "Active    FX: %i\n", activeFx );
		theFxHelper.Print( "Drawn     FX: %i\n", drawnFx );
		theFxHelper.Print( "Scheduled FX: %i\n", theFxScheduler.NumScheduledFx() );
	}
}
开发者ID:Stoiss,项目名称:jaMME,代码行数:50,代码来源:FxUtil.cpp


示例5:

//-------------------------
// FX_Init
//
// Preps system for use
//-------------------------
int	FX_Init( void )
{ 
	if ( fxInitialized == qfalse )
	{
		fxInitialized = qtrue;

		for ( int i = 0; i < MAX_EFFECTS; i++ )
		{
			effectList[i].mEffect = 0;
		}
	}

	FX_Free();

	mMax = 0;
	mMaxTime = 0;

	nextValidEffect = &effectList[0];
	theFxHelper.Init();

	return true;
}
开发者ID:Almightygir,项目名称:OpenJK,代码行数:27,代码来源:FxUtil.cpp


示例6: FX_Add

//-------------------------
// FX_Add
//
// Adds all fx to the view
//-------------------------
void FX_Add( void )
{
	int			i;
	SEffectList	*ef;

	drawnFx = 0;
	mParticles = 0;
	mOParticles = 0;
	mLines = 0;
	mTails = 0;

	// Blah....plow through the whole dang list.
	for ( i = 0, ef = effectList; i < MAX_EFFECTS; i++, ef++ )
	{
		if ( ef->mEffect != 0 )
		{ 
			// Effect is active
			if ( theFxHelper.mTime > ef->mKillTime )
			{ 
				// Clean up old effects, calling any death effects as needed
				// this flag just has to be cleared otherwise death effects might not happen correctly
				ef->mEffect->ClearFlags( FX_KILL_ON_IMPACT ); 
				FX_FreeMember( ef );
			}
			else
			{
				if ( ef->mEffect->Update() == false )
				{
					// We've been marked for death
					FX_FreeMember( ef );
					continue;
				}
			}
		}
	}

	if ( fx_debug.integer )
	{
		if ( theFxHelper.mTime > mMaxTime )
		{
			// decay pretty harshly when we do it
			mMax *= 0.9f;
			mMaxTime = theFxHelper.mTime + 200; // decay 5 times a second if we haven't set a new max
		}
		if ( activeFx > mMax )
		{
			// but we can never be less that the current activeFx count
			mMax = activeFx;
			mMaxTime = theFxHelper.mTime + 4000; // since we just increased the max, hold it for at least 4 seconds
		}

		// Particles
		if ( mParticles > 500 )
		{
			theFxHelper.Print( ">Particles  ^1%4i  ", mParticles );
		}
		else if ( mParticles > 250 )
		{
			theFxHelper.Print( ">Particles  ^3%4i  ", mParticles );
		}
		else
		{
			theFxHelper.Print( ">Particles  %4i  ", mParticles );
		}

		// Lines
		if ( mLines > 500 )
		{
			theFxHelper.Print( ">Lines ^1%4i\n", mLines );
		}
		else if ( mLines > 250 )
		{
			theFxHelper.Print( ">Lines ^3%4i\n", mLines );
		}
		else
		{
			theFxHelper.Print( ">Lines %4i\n", mLines );
		}

		// OParticles
		if ( mOParticles > 500 )
		{
			theFxHelper.Print( ">OParticles ^1%4i  ", mOParticles );
		}
		else if ( mOParticles > 250 )
		{
			theFxHelper.Print( ">OParticles ^3%4i  ", mOParticles );
		}
		else
		{
			theFxHelper.Print( ">OParticles %4i  ", mOParticles );
		}

		// Tails
		if ( mTails > 400 )
//.........这里部分代码省略.........
开发者ID:Almightygir,项目名称:OpenJK,代码行数:101,代码来源:FxUtil.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ SGFContext类代码示例发布时间:2022-05-31
下一篇:
C++ SFlowNodeConfig类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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