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


C++ Trail::GetDisplayBpms方法代码示例

本文整理汇总了C++中Trail::GetDisplayBpms方法的典型用法代码示例。如果您正苦于以下问题:C++ Trail::GetDisplayBpms方法的具体用法?C++ Trail::GetDisplayBpms怎么用?C++ Trail::GetDisplayBpms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Trail的用法示例。


在下文中一共展示了Trail::GetDisplayBpms方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetRowTitle

CString OptionRow::GetRowTitle() const
{
	CString sLineName = m_RowDef.name;
	CString sTitle = THEME_TITLES ? OPTION_TITLE(sLineName) : sLineName;

	// HACK: tack the BPM onto the name of the speed line
	if( sLineName.CompareNoCase("speed")==0 )
	{
		bool bShowBpmInSpeedTitle = SHOW_BPM_IN_SPEED_TITLE;

		if( GAMESTATE->m_pCurCourse )
		{
			Trail* pTrail = GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber];
			ASSERT( pTrail != NULL );
			const int iNumCourseEntries = pTrail->m_vEntries.size();
			if( iNumCourseEntries > MAX_COURSE_ENTRIES_BEFORE_VARIOUS )
				bShowBpmInSpeedTitle = false;
		}

		if( bShowBpmInSpeedTitle )
		{
			DisplayBpms bpms;
			if( GAMESTATE->m_pCurSong )
			{
				Song* pSong = GAMESTATE->m_pCurSong;
				pSong->GetDisplayBpms( bpms );
			}
			else if( GAMESTATE->m_pCurCourse )
			{
				Course *pCourse = GAMESTATE->m_pCurCourse;
				StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
				Trail* pTrail = pCourse->GetTrail( st );
				ASSERT( pTrail );
				pTrail->GetDisplayBpms( bpms );
			}

			if( bpms.IsSecret() )
				sTitle += ssprintf( " (??" "?)" ); /* split so gcc doesn't think this is a trigraph */
			else if( bpms.BpmIsConstant() )
				sTitle += ssprintf( " (%.0f)", bpms.GetMin() );
			else
				sTitle += ssprintf( " (%.0f-%.0f)", bpms.GetMin(), bpms.GetMax() );
		}
	}

	return sTitle;
}
开发者ID:BitMax,项目名称:openitg,代码行数:47,代码来源:OptionRow.cpp

示例2: SetBpmFromCourse

void BPMDisplay::SetBpmFromCourse( const Course* pCourse )
{
    ASSERT( pCourse != NULL );
    ASSERT( GAMESTATE->GetCurrentStyle(PLAYER_INVALID) != NULL );

    StepsType st = GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType;
    Trail *pTrail = pCourse->GetTrail( st );
    // GetTranslitFullTitle because "Crashinfo.txt is garbled because of the ANSI output as usual." -f
    ASSERT_M( pTrail != NULL, ssprintf("Course '%s' has no trail for StepsType '%s'", pCourse->GetTranslitFullTitle().c_str(), StringConversion::ToString(st).c_str() ) );

    m_fCycleTime = (float)COURSE_CYCLE_SPEED;

    if( (int)pTrail->m_vEntries.size() > CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS )
    {
        SetVarious();
        return;
    }

    DisplayBpms bpms;
    pTrail->GetDisplayBpms( bpms );
    SetBPMRange( bpms );
}
开发者ID:sasukeuni,项目名称:stepmania,代码行数:22,代码来源:BPMDisplay.cpp


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