本文整理汇总了C++中IsValidLayer函数的典型用法代码示例。如果您正苦于以下问题:C++ IsValidLayer函数的具体用法?C++ IsValidLayer怎么用?C++ IsValidLayer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsValidLayer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AllocateLayer
//-----------------------------------------------------------------------------
// Purpose:
// Output : int
//-----------------------------------------------------------------------------
int CBaseAnimatingOverlay::AddLayeredSequence( int sequence, int iPriority )
{
int i = AllocateLayer( iPriority );
Assert( IsValidLayer( i ) );
// No room?
if ( IsValidLayer( i ) )
{
m_AnimOverlay[i].m_flCycle = 0;
m_AnimOverlay[i].m_flPrevCycle = 0;
m_AnimOverlay[i].m_flPlaybackRate = 1.0;
m_AnimOverlay[i].m_nActivity = ACT_INVALID;
m_AnimOverlay[i].m_nSequence = sequence;
m_AnimOverlay[i].m_flWeight = 1.0f;
m_AnimOverlay[i].m_flBlendIn = 0.0f;
m_AnimOverlay[i].m_flBlendOut = 0.0f;
m_AnimOverlay[i].m_bSequenceFinished = false;
m_AnimOverlay[i].m_flLastEventCheck = 0;
m_AnimOverlay[i].m_bLooping = ((GetSequenceFlags( GetModelPtr(), sequence ) & STUDIO_LOOPING) != 0);
if (ai_sequence_debug.GetBool() == true && m_debugOverlays & OVERLAY_NPC_SELECTED_BIT)
{
Msg("%5.3f : adding %d (%d): %s : %5.3f (%.3f)\n", gpGlobals->curtime, i, m_AnimOverlay[ i ].m_nOrder.Get(), GetSequenceName( m_AnimOverlay[ i ].m_nSequence ), m_AnimOverlay[ i ].m_flCycle.Get(), m_AnimOverlay[ i ].m_flWeight.Get() );
}
}
return i;
}
示例2: GetLayerWeight
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
float CBaseAnimatingOverlay::GetLayerWeight( int iLayer )
{
if (!IsValidLayer( iLayer ))
return 0.0;
return m_AnimOverlay[iLayer].m_flWeight;
}
示例3: SetLayerDuration
void CBaseAnimatingOverlay::SetLayerDuration( int iLayer, float flDuration )
{
if (IsValidLayer( iLayer ) && flDuration > 0)
{
m_AnimOverlay[iLayer].m_flPlaybackRate = SequenceDuration( m_AnimOverlay[iLayer].m_nSequence ) / flDuration;
}
}
示例4: SetLayerLooping
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CBaseAnimatingOverlay::SetLayerLooping( int iLayer, bool bLooping )
{
if (!IsValidLayer( iLayer ))
return;
m_AnimOverlay[iLayer].m_bLooping = bLooping;
}
示例5: SetLayerBlendOut
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CBaseAnimatingOverlay::SetLayerBlendOut( int iLayer, float flBlendOut )
{
if (!IsValidLayer( iLayer ))
return;
m_AnimOverlay[iLayer].m_flBlendOut = flBlendOut;
}
示例6: GetLayerCycle
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
float CBaseAnimatingOverlay::GetLayerCycle( int iLayer )
{
if (!IsValidLayer( iLayer ))
return 0.0;
return m_AnimOverlay[iLayer].m_flCycle;
}
示例7: GetLayerSequence
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
int CBaseAnimatingOverlay::GetLayerSequence( int iLayer )
{
if (!IsValidLayer( iLayer ))
{
return ACT_INVALID;
}
return m_AnimOverlay[iLayer].m_nSequence;
}
示例8: SetLayerWeight
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CBaseAnimatingOverlay::SetLayerWeight( int iLayer, float flWeight )
{
if (!IsValidLayer( iLayer ))
return;
flWeight = clamp( flWeight, 0.0f, 1.0f );
m_AnimOverlay[iLayer].m_flWeight = flWeight;
m_AnimOverlay[iLayer].MarkActive( );
}
示例9: SetLayerPlaybackRate
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CBaseAnimatingOverlay::SetLayerPlaybackRate( int iLayer, float flPlaybackRate )
{
if (!IsValidLayer( iLayer ))
return;
Assert( flPlaybackRate > -1.0 && flPlaybackRate < 40.0);
m_AnimOverlay[iLayer].m_flPlaybackRate = flPlaybackRate;
}
示例10: GetLayerActivity
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
Activity CBaseAnimatingOverlay::GetLayerActivity( int iLayer )
{
if (!IsValidLayer( iLayer ))
{
return ACT_INVALID;
}
return m_AnimOverlay[iLayer].m_nActivity;
}
示例11: wxFAIL_MSG
void LAYERS_MAP_DIALOG::OnSelectLayer( wxCommandEvent& event )
{
int ii;
ii = event.GetId() - ID_BUTTON_0;
if( (ii < 0) || (ii >= GERBER_DRAWLAYERS_COUNT) )
{
wxFAIL_MSG( wxT("Bad layer id") );
return;
}
LAYER_NUM jj = m_layersLookUpTable[m_buttonTable[ii]];
if( jj != UNSELECTED_LAYER && !IsValidLayer( jj ) )
jj = B_Cu; // (Defaults to "Copper" layer.)
jj = m_Parent->SelectPCBLayer( jj, m_exportBoardCopperLayersCount, true );
if( jj != UNSELECTED_LAYER && !IsValidLayer( jj ) )
return;
if( jj != m_layersLookUpTable[m_buttonTable[ii]] )
{
m_layersLookUpTable[m_buttonTable[ii]] = jj;
if( jj == UNSELECTED_LAYER )
{
m_layersList[ii]->SetLabel( _( "Do not export" ) );
// Change the text color to blue (to highlight
// that this layer is *not* being exported)
m_layersList[ii]->SetForegroundColour( *wxBLUE );
}
else
{
m_layersList[ii]->SetLabel( GetPCBDefaultLayerName( jj ) );
// Change the text color to fuchsia (to highlight
// that this layer *is* being exported)
m_layersList[ii]->SetForegroundColour( wxColour( 255, 0, 128 ) );
}
}
}
示例12: SetLayerPriority
//-----------------------------------------------------------------------------
// Purpose:
// Output : int
//-----------------------------------------------------------------------------
void CBaseAnimatingOverlay::SetLayerPriority( int iLayer, int iPriority )
{
if (!IsValidLayer( iLayer ))
{
return;
}
if (m_AnimOverlay[iLayer].m_nPriority == iPriority)
{
return;
}
// look for an open slot and for existing layers that are lower priority
int i;
for (i = 0; i < m_AnimOverlay.Count(); i++)
{
if ( m_AnimOverlay[i].IsActive() )
{
if (m_AnimOverlay[i].m_nOrder > m_AnimOverlay[iLayer].m_nOrder)
{
m_AnimOverlay[i].m_nOrder--;
}
}
}
int iNewOrder = 0;
for (i = 0; i < m_AnimOverlay.Count(); i++)
{
if ( i != iLayer && m_AnimOverlay[i].IsActive() )
{
if (m_AnimOverlay[i].m_nPriority <= iPriority)
{
iNewOrder = MAX( iNewOrder, m_AnimOverlay[i].m_nOrder + 1 );
}
}
}
for (i = 0; i < m_AnimOverlay.Count(); i++)
{
if ( i != iLayer && m_AnimOverlay[i].IsActive() )
{
if ( m_AnimOverlay[i].m_nOrder >= iNewOrder)
{
m_AnimOverlay[i].m_nOrder++;
}
}
}
m_AnimOverlay[iLayer].m_nOrder = iNewOrder;
m_AnimOverlay[iLayer].m_nPriority = iPriority;
m_AnimOverlay[iLayer].MarkActive( );
VerifyOrder();
return;
}
示例13: AddLayeredSequence
//-----------------------------------------------------------------------------
// Purpose:
// Output : int
//-----------------------------------------------------------------------------
int CBaseAnimatingOverlay::AddGestureSequence( int sequence, bool autokill /*= true*/ )
{
int i = AddLayeredSequence( sequence, 0 );
// No room?
if ( IsValidLayer( i ) )
{
SetLayerAutokill( i, autokill );
}
return i;
}
示例14: SetLayerCycle
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CBaseAnimatingOverlay::SetLayerCycle( int iLayer, float flCycle )
{
if (!IsValidLayer( iLayer ))
return;
if (!m_AnimOverlay[iLayer].m_bLooping)
{
flCycle = clamp( flCycle, 0.0, 1.0 );
}
m_AnimOverlay[iLayer].m_flCycle = flCycle;
m_AnimOverlay[iLayer].MarkActive( );
}
示例15: GetLayerDuration
float CBaseAnimatingOverlay::GetLayerDuration( int iLayer )
{
if (IsValidLayer( iLayer ))
{
if (m_AnimOverlay[iLayer].m_flPlaybackRate != 0.0f)
{
return (1.0 - m_AnimOverlay[iLayer].m_flCycle) * SequenceDuration( m_AnimOverlay[iLayer].m_nSequence ) / m_AnimOverlay[iLayer].m_flPlaybackRate;
}
return SequenceDuration( m_AnimOverlay[iLayer].m_nSequence );
}
return 0.0;
}