本文整理汇总了C++中CStudioHdr::GetNumSeq方法的典型用法代码示例。如果您正苦于以下问题:C++ CStudioHdr::GetNumSeq方法的具体用法?C++ CStudioHdr::GetNumSeq怎么用?C++ CStudioHdr::GetNumSeq使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStudioHdr
的用法示例。
在下文中一共展示了CStudioHdr::GetNumSeq方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CFmtStr
void IFaceposerModels::CFacePoserModel::RecreateAllAnimationBitmaps()
{
StudioModel *model = m_pModel;
if ( !model )
return;
CStudioHdr *hdr = model->GetStudioHdr();
if ( !hdr )
return;
g_pProgressDialog->Start( CFmtStr( "%s - Animation Thumbnails", GetShortModelName() ), "", true );
for ( int i = 0; i < hdr->GetNumSeq(); ++i )
{
const mstudioseqdesc_t &seq = hdr->pSeqdesc( i );
g_pProgressDialog->UpdateText( "%s", seq.pszLabel() );
g_pProgressDialog->Update( (float)i / (float)hdr->GetNumSeq() );
RecreateAnimationBitmap( i, false );
if ( g_pProgressDialog->IsCancelled() )
{
Msg( "Cancelling\n" );
break;
}
}
g_pProgressDialog->Finish();
ReconcileAnimationBitmaps();
}
示例2: HasPoseParameter
//=========================================================
//=========================================================
bool CAnimating::HasPoseParameter( int iSequence, int iParameter )
{
CStudioHdr *pstudiohdr = GetModelPtr( );
if ( !pstudiohdr )
{
return false;
}
if ( !pstudiohdr->SequencesAvailable() )
{
return false;
}
if (iSequence < 0 || iSequence >= pstudiohdr->GetNumSeq())
{
return false;
}
mstudioseqdesc_t &seqdesc = pstudiohdr->pSeqdesc( iSequence );
if (pstudiohdr->GetSharedPoseParameter( iSequence, seqdesc.paramindex[0] ) == iParameter ||
pstudiohdr->GetSharedPoseParameter( iSequence, seqdesc.paramindex[1] ) == iParameter)
{
return true;
}
return false;
}
示例3: PrecacheAnimationEventMaterials
void CEnvParticleScript::PrecacheAnimationEventMaterials()
{
CStudioHdr *hdr = GetModelPtr();
if ( hdr )
{
int numseq = hdr->GetNumSeq();
for ( int i = 0; i < numseq; ++i )
{
mstudioseqdesc_t& seqdesc = hdr->pSeqdesc( i );
int ecount = seqdesc.numevents;
for ( int j = 0 ; j < ecount; ++j )
{
const mstudioevent_t* event = (const mstudioevent_for_client_server_t*)seqdesc.pEvent( j );
if ( event->Event() == CL_EVENT_SPRITEGROUP_CREATE )
{
char pAttachmentName[256];
char pSpriteName[256];
int nArgs = sscanf( event->pszOptions(), "%255s %255s", pAttachmentName, pSpriteName );
if ( nArgs == 2 )
{
PrecacheMaterial( pSpriteName );
}
}
}
}
}
}
示例4: EnsureCorrectRenderingModel
// If the local player is visible (thirdperson mode, tf2 taunts, etc., then make sure that we are using the
// w_ (world) model not the v_ (view) model or else the model can flicker, etc.
// Otherwise, if we're not the local player, always use the world model
void C_BaseCombatWeapon::EnsureCorrectRenderingModel()
{
C_BasePlayer *localplayer = C_BasePlayer::GetLocalPlayer();
if ( localplayer &&
localplayer == GetOwner() &&
!localplayer->ShouldDrawLocalPlayer() )
{
return;
}
MDLCACHE_CRITICAL_SECTION();
// BRJ 10/14/02
// FIXME: Remove when Yahn's client-side prediction is done
// It's a hacky workaround for the model indices fighting
// (GetRenderBounds uses the model index, which is for the view model)
SetModelIndex( GetWorldModelIndex() );
// Validate our current sequence just in case ( in theory the view and weapon models should have the same sequences for sequences that overlap at least )
CStudioHdr *pStudioHdr = GetModelPtr();
if ( pStudioHdr &&
GetSequence() >= pStudioHdr->GetNumSeq() )
{
SetSequence( 0 );
}
}
示例5: GetRenderBounds
void C_BaseAnimatingOverlay::GetRenderBounds( Vector& theMins, Vector& theMaxs )
{
BaseClass::GetRenderBounds( theMins, theMaxs );
if ( !IsRagdoll() )
{
CStudioHdr *pStudioHdr = GetModelPtr();
if ( !pStudioHdr || !pStudioHdr->SequencesAvailable() )
return;
int nSequences = pStudioHdr->GetNumSeq();
int i;
for (i = 0; i < m_AnimOverlay.Count(); i++)
{
if (m_AnimOverlay[i].m_flWeight > 0.0)
{
if ( m_AnimOverlay[i].m_nSequence >= nSequences )
{
continue;
}
mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( m_AnimOverlay[i].m_nSequence );
VectorMin( seqdesc.bbmin, theMins, theMins );
VectorMax( seqdesc.bbmax, theMaxs, theMaxs );
}
}
}
}
示例6: scaleMeshes
void StudioModel::scaleMeshes (float scale)
{
CStudioHdr *pStudioHdr = GetStudioHdr();
if (!pStudioHdr)
return;
int i, j, k;
// manadatory to access correct verts
SetCurrentModel();
// scale verts
int tmp = m_bodynum;
for (i = 0; i < pStudioHdr->numbodyparts(); i++)
{
mstudiobodyparts_t *pbodypart = pStudioHdr->pBodypart( i );
for (j = 0; j < pbodypart->nummodels; j++)
{
SetBodygroup (i, j);
SetupModel (i);
const mstudio_modelvertexdata_t *vertData = m_pmodel->GetVertexData();
for (k = 0; k < m_pmodel->numvertices; k++)
{
*vertData->Position(k) *= scale;
}
}
}
m_bodynum = tmp;
// scale complex hitboxes
int hitboxset = g_MDLViewer->GetCurrentHitboxSet();
mstudiobbox_t *pbboxes = pStudioHdr->pHitbox( 0, hitboxset );
for (i = 0; i < pStudioHdr->iHitboxCount( hitboxset ); i++)
{
VectorScale (pbboxes[i].bbmin, scale, pbboxes[i].bbmin);
VectorScale (pbboxes[i].bbmax, scale, pbboxes[i].bbmax);
}
// scale bounding boxes
for (i = 0; i < pStudioHdr->GetNumSeq(); i++)
{
mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( i );
Vector tmp;
tmp = seqdesc.bbmin;
VectorScale( tmp, scale, tmp );
seqdesc.bbmin = tmp;
tmp = seqdesc.bbmax;
VectorScale( tmp, scale, tmp );
seqdesc.bbmax = tmp;
}
// maybe scale exeposition, pivots, attachments
}
示例7: QuerySequences
int SEditModelRender::QuerySequences( char ***list )
{
if ( !IsModelReady() )
return 0;
MDLCACHE_CRITICAL_SECTION();
CStudioHdr *pHdr = pModelInstance->GetModelPtr();
if ( !pHdr )
return 0;
CUtlVector< mstudioseqdesc_t* >hSeqs;
for ( int i = 0; i < pHdr->GetNumSeq(); i++ )
if ( !( pHdr->pSeqdesc( i ).flags & STUDIO_HIDDEN ) )
hSeqs.AddToTail( &pHdr->pSeqdesc( i ) );
int numSequences = hSeqs.Count();
if ( !numSequences )
return 0;
hSeqs.Sort( SequenceSort );
CUtlVector< const char* >hNameList;
for ( int i = 0; i < numSequences; i++ )
{
const char *seqName = NULL;
const mstudioseqdesc_t &seqPtr = *hSeqs[ i ];
if ( seqPtr.pszLabel() )
seqName = seqPtr.pszLabel();
else
seqName = "Unknown Sequence";
hNameList.AddToTail( seqName );
}
*list = new char*[numSequences];
int iTotalLength = 0;
for ( int i = 0; i < numSequences; i++ )
iTotalLength += Q_strlen( hNameList[i] ) + 1;
**list = new char[ iTotalLength ];
int curpos = 0;
for ( int i = 0; i < numSequences; i++ )
{
int curLength = Q_strlen( hNameList[i] ) + 1;
(*list)[ i ] = **list + curpos;
Q_strcpy( (*list)[ i ], hNameList[i] );
curpos += curLength;
}
hNameList.Purge();
hSeqs.Purge();
return numSequences;
}
示例8: GetNumFrames
int StudioModel::GetNumFrames( int iSequence )
{
CStudioHdr *pStudioHdr = GetStudioHdr();
if ( !pStudioHdr || iSequence < 0 || iSequence >= pStudioHdr->GetNumSeq() )
{
return 1;
}
return Studio_MaxFrame( pStudioHdr, iSequence, m_poseparameter );
}
示例9: PopulateSequenceList
void CEventPropertiesSequenceDialog::PopulateSequenceList( HWND wnd )
{
CStudioHdr *hdr = models->GetActiveStudioModel()->GetStudioHdr();
if (hdr)
{
for (int i = 0; i < hdr->GetNumSeq(); i++)
{
SendMessage( wnd, CB_ADDSTRING, 0, (LPARAM)hdr->pSeqdesc(i).pszLabel() );
}
}
}
示例10: PopulateGestureList
void CEventPropertiesGestureDialog::PopulateGestureList( HWND wnd )
{
CStudioHdr *hdr = models->GetActiveStudioModel()->GetStudioHdr();
if (hdr)
{
int i;
for (i = 0; i < hdr->GetNumSeq(); i++)
{
if (CheckSequenceType( models->GetActiveStudioModel(), i, "gesture" ))
{
SendMessage( wnd, CB_ADDSTRING, 0, (LPARAM)hdr->pSeqdesc(i).pszLabel() );
}
}
for (i = 0; i < hdr->GetNumSeq(); i++)
{
if (CheckSequenceType( models->GetActiveStudioModel(), i, "posture" ))
{
SendMessage( wnd, CB_ADDSTRING, 0, (LPARAM)hdr->pSeqdesc(i).pszLabel() );
}
}
}
}
示例11:
void
ControlPanel::initSequenceChoices()
{
CStudioHdr *hdr = models->GetActiveStudioModel()->GetStudioHdr();
if (hdr)
{
cSequence->removeAll();
for (int i = 0; i < hdr->GetNumSeq(); i++)
{
cSequence->add (hdr->pSeqdesc(i).pszLabel());
}
cSequence->select (0);
}
}
示例12: GetBitmapCRC
void IFaceposerModels::CFacePoserModel::BuildValidChecksums( CUtlRBTree< CRC32_t > &tree )
{
StudioModel *model = m_pModel;
if ( !model )
return;
CStudioHdr *hdr = model->GetStudioHdr();
if ( !hdr )
return;
for ( int i = 0; i < hdr->GetNumSeq(); i++ )
{
CRC32_t crc = GetBitmapCRC( i );
tree.Insert( crc );
}
}
示例13: LookupActivity
int StudioModel::LookupActivity( const char *szActivity )
{
int i;
CStudioHdr *pStudioHdr = GetStudioHdr();
if ( !pStudioHdr )
return -1;
for (i = 0; i < pStudioHdr->GetNumSeq(); i++)
{
if (!stricmp( szActivity, pStudioHdr->pSeqdesc( i ).pszActivityName() ))
{
return i;
}
}
return -1;
}
示例14: LookupSequence
int StudioModel::LookupSequence( const char *szSequence )
{
int i;
CStudioHdr *pStudioHdr = GetStudioHdr();
if ( !pStudioHdr )
return -1;
for (i = 0; i < pStudioHdr->GetNumSeq(); i++)
{
if (!stricmp( szSequence, pStudioHdr->pSeqdesc( i ).pszLabel() ))
{
return i;
}
}
return -1;
}
示例15: SetSequence
int StudioModel::SetSequence( int iSequence )
{
CStudioHdr *pStudioHdr = GetStudioHdr();
if ( !pStudioHdr )
return 0;
if (iSequence < 0)
return 0;
if (iSequence > pStudioHdr->GetNumSeq())
return m_sequence;
m_prevsequence = m_sequence;
m_sequence = iSequence;
m_cycle = 0;
m_sequencetime = 0.0;
return m_sequence;
}