本文整理汇总了C++中CChoreoScene::GetNumActors方法的典型用法代码示例。如果您正苦于以下问题:C++ CChoreoScene::GetNumActors方法的具体用法?C++ CChoreoScene::GetNumActors怎么用?C++ CChoreoScene::GetNumActors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChoreoScene
的用法示例。
在下文中一共展示了CChoreoScene::GetNumActors方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PopulateTagList
void CBaseEventPropertiesDialog::PopulateTagList( CEventParams *params )
{
CChoreoScene *scene = params->m_pScene;
if ( !scene )
return;
HWND control = GetControl( IDC_TAGS );
if ( control )
{
SendMessage( control, CB_RESETCONTENT, 0, 0 );
SendMessage( control, WM_SETTEXT , 0, (LPARAM)va( "\"%s\" \"%s\"", params->m_szTagName, params->m_szTagWav ) );
for ( int i = 0; i < scene->GetNumActors(); i++ )
{
CChoreoActor *a = scene->GetActor( i );
if ( !a )
continue;
for ( int j = 0; j < a->GetNumChannels(); j++ )
{
CChoreoChannel *c = a->GetChannel( j );
if ( !c )
continue;
for ( int k = 0 ; k < c->GetNumEvents(); k++ )
{
CChoreoEvent *e = c->GetEvent( k );
if ( !e )
continue;
if ( e->GetNumRelativeTags() <= 0 )
continue;
// add each tag to combo box
for ( int t = 0; t < e->GetNumRelativeTags(); t++ )
{
CEventRelativeTag *tag = e->GetRelativeTag( t );
if ( !tag )
continue;
SendMessage( control, CB_ADDSTRING, 0, (LPARAM)va( "\"%s\" \"%s\"", tag->GetName(), e->GetParameters() ) );
}
}
}
}
}
}
示例2: UnloadScene
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_SceneEntity::UnloadScene( void )
{
WipeQueuedEvents();
if ( m_pScene )
{
ClearSceneEvents( m_pScene, false );
for ( int i = 0 ; i < m_pScene->GetNumActors(); i++ )
{
C_BaseFlex *pTestActor = FindNamedActor( m_pScene->GetActor( i ) );
if ( !pTestActor )
continue;
pTestActor->RemoveChoreoScene( m_pScene );
}
}
delete m_pScene;
m_pScene = NULL;
}
示例3: ClearSceneEvents
void C_SceneEntity::ClearSceneEvents( CChoreoScene *scene, bool canceled )
{
if ( !m_pScene )
return;
Scene_Printf( "%s : %8.2f: clearing events\n", GetSceneFileName(), m_flCurrentTime );
int i;
for ( i = 0 ; i < m_pScene->GetNumActors(); i++ )
{
C_BaseFlex *pActor = FindNamedActor( m_pScene->GetActor( i ) );
if ( !pActor )
continue;
// Clear any existing expressions
pActor->ClearSceneEvents( scene, canceled );
}
WipeQueuedEvents();
}
示例4: handleEvent
virtual int handleEvent( mxEvent *event )
{
int iret = 0;
switch ( event->event )
{
default:
break;
case mxEvent::Action:
{
iret = 1;
switch ( event->action )
{
default:
iret = 0;
break;
case IDC_MODELTAB_SHOWALL:
case IDC_MODELTAB_HIDEALL:
{
bool show = ( event->action == IDC_MODELTAB_SHOWALL ) ? true : false;
int c = models->Count();
for ( int i = 0; i < c ; i++ )
{
models->ShowModelIn3DView( i, show );
}
}
break;
case IDC_MODELTAB_LOAD:
{
const char *ptr = mxGetOpenFileName(
this,
FacePoser_MakeWindowsSlashes( va( "%s/models/", GetGameDirectory() ) ),
"*.mdl" );
if (ptr)
{
g_MDLViewer->LoadModelFile( ptr );
}
}
break;
case IDC_MODELTAB_CLOSE:
{
int idx = getSelectedIndex();
if ( idx >= 0 )
{
models->FreeModel( idx );
}
}
break;
case IDC_MODELTAB_CLOSEALL:
{
models->CloseAllModels();
}
break;
case IDC_MODELTAB_CENTERONFACE:
{
g_pControlPanel->CenterOnFace();
}
break;
case IDC_MODELTAB_TOGGLE3DVIEW:
{
int idx = getSelectedIndex();
if ( idx >= 0 )
{
bool visible = models->IsModelShownIn3DView( idx );
models->ShowModelIn3DView( idx, !visible );
}
}
break;
case IDC_MODELTAB_ASSOCIATEACTOR:
{
int idx = getSelectedIndex();
if ( idx >= 0 )
{
char const *modelname = models->GetModelFileName( idx );
CChoreoScene *scene = g_pChoreoView->GetScene();
if ( scene )
{
CChoiceParams params;
strcpy( params.m_szDialogTitle, "Associate Actor" );
params.m_bPositionDialog = false;
params.m_nLeft = 0;
params.m_nTop = 0;
strcpy( params.m_szPrompt, "Choose actor:" );
params.m_Choices.RemoveAll();
params.m_nSelected = -1;
int oldsel = -1;
int c = scene->GetNumActors();
ChoiceText text;
for ( int i = 0; i < c; i++ )
{
CChoreoActor *a = scene->GetActor( i );
Assert( a );
strcpy( text.choice, a->GetName() );
//.........这里部分代码省略.........
示例5: ShowRightClickMenu
virtual void ShowRightClickMenu( int mx, int my )
{
mxPopupMenu *pop = new mxPopupMenu();
Assert( pop );
char const *current = "";
char const *filename = "";
int idx = getSelectedIndex();
if ( idx >= 0 )
{
current = models->GetModelName( idx );
filename = models->GetModelFileName( idx );
}
if ( models->Count() < MAX_FP_MODELS )
{
pop->add( "Load Model...", IDC_MODELTAB_LOAD );
}
if ( idx >= 0 )
{
pop->add( va( "Close '%s'", current ), IDC_MODELTAB_CLOSE );
}
if ( models->Count() > 0 )
{
pop->add( "Close All", IDC_MODELTAB_CLOSEALL );
}
if ( idx >= 0 )
{
pop->addSeparator();
pop->add( va( "Center %s's face", current ), IDC_MODELTAB_CENTERONFACE );
CChoreoScene *scene = g_pChoreoView->GetScene();
if ( scene )
{
// See if there is already an actor with this model associated
int c = scene->GetNumActors();
bool hasassoc = false;
for ( int i = 0; i < c; i++ )
{
CChoreoActor *a = scene->GetActor( i );
Assert( a );
if ( stricmp( a->GetFacePoserModelName(), filename ) )
continue;
hasassoc = true;
break;
}
if ( hasassoc )
{
pop->add( va( "Change associated actor for %s", current ), IDC_MODELTAB_ASSOCIATEACTOR );
}
else
{
pop->add( va( "Associate actor to %s", current ), IDC_MODELTAB_ASSOCIATEACTOR );
}
}
pop->addSeparator();
bool visible = models->IsModelShownIn3DView( idx );
if ( visible )
{
pop->add( va( "Remove %s from 3D View", current ), IDC_MODELTAB_TOGGLE3DVIEW );
}
else
{
pop->add( va( "Show %s in 3D View", current ), IDC_MODELTAB_TOGGLE3DVIEW );
}
}
if ( models->Count() > 0 )
{
pop->addSeparator();
pop->add( "Show All", IDC_MODELTAB_SHOWALL );
pop->add( "Hide All", IDC_MODELTAB_HIDEALL );
}
// Convert click position
POINT pt;
pt.x = mx;
pt.y = my;
// Convert coordinate space
pop->popup( this, pt.x, pt.y );
}