当前位置: 首页>>代码示例>>C++>>正文


C++ CChoreoScene::SetSceneFPS方法代码示例

本文整理汇总了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( &params, 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( &params ) )
								{
									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;
	}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:91,代码来源:mdlviewer.cpp


注:本文中的CChoreoScene::SetSceneFPS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。