本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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() );
}
}
示例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;
}
示例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 )
//.........这里部分代码省略.........