本文整理汇总了C++中CChoreoScene::SetSceneFPS方法的典型用法代码示例。如果您正苦于以下问题:C++ CChoreoScene::SetSceneFPS方法的具体用法?C++ CChoreoScene::SetSceneFPS怎么用?C++ CChoreoScene::SetSceneFPS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChoreoScene
的用法示例。
在下文中一共展示了CChoreoScene::SetSceneFPS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleEvent
virtual int handleEvent( mxEvent *event )
{
int iret = 0;
switch ( event->event )
{
default:
break;
case mxEvent::Size:
{
int leftedge = w2() * 0.45f;
m_btnFPS->setBounds( 0, 0, leftedge, h2() );
m_btnGridSnap->setBounds( leftedge, 0, w2() - leftedge, h2() );
iret = 1;
}
break;
case mxEvent::Action:
{
iret = 1;
switch ( event->action )
{
default:
iret = 0;
break;
case IDC_GRIDSETTINGS_FPS:
{
if ( g_pChoreoView )
{
CChoreoScene *scene = g_pChoreoView->GetScene();
if ( scene )
{
int currentFPS = scene->GetSceneFPS();
CInputParams params;
memset( ¶ms, 0, sizeof( params ) );
strcpy( params.m_szDialogTitle, "Change FPS" );
Q_snprintf( params.m_szInputText, sizeof( params.m_szInputText ),
"%i", currentFPS );
strcpy( params.m_szPrompt, "Current FPS:" );
if ( InputProperties( ¶ms ) )
{
int newFPS = atoi( params.m_szInputText );
if ( ( newFPS > 0 ) && ( newFPS != currentFPS ) )
{
g_pChoreoView->SetDirty( true );
g_pChoreoView->PushUndo( "Change Scene FPS" );
scene->SetSceneFPS( newFPS );
g_pChoreoView->PushRedo( "Change Scene FPS" );
Init();
Con_Printf( "FPS changed to %i\n", newFPS );
}
}
}
}
}
break;
case IDC_GRIDSETTINGS_SNAP:
{
if ( g_pChoreoView )
{
CChoreoScene *scene = g_pChoreoView->GetScene();
if ( scene )
{
g_pChoreoView->SetDirty( true );
g_pChoreoView->PushUndo( "Change Snap Frame" );
scene->SetUsingFrameSnap( !scene->IsUsingFrameSnap() );
g_pChoreoView->PushRedo( "Change Snap Frame" );
Init();
Con_Printf( "Time frame snapping: %s\n",
scene->IsUsingFrameSnap() ? "on" : "off" );
}
}
}
break;
}
}
}
return iret;
}