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


C++ NoteData::ClearRange方法代码示例

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


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

示例1: RemoveHoles

void KSFLoader::RemoveHoles( NoteData &out, const Song &song )
{
    /* Start at the second BPM segment; the first one is already aligned. */
    for( unsigned seg = 1; seg < song.m_Timing.m_BPMSegments.size(); ++seg )
    {
//		const float FromBeat = song.m_Timing.m_BPMSegments[seg].m_fStartBeat;
        const float FromBeat = song.m_Timing.m_BPMSegments[seg].m_fStartBeat * song.m_BPMSegments[seg].m_fBPM / song.m_BPMSegments[0].m_fBPM;
        const int FromRow = (int) BeatToNoteRow(FromBeat);
        const int ToRow = (int) BeatToNoteRow(song.m_Timing.m_BPMSegments[seg].m_fStartBeat);

        LOG->Trace("from %f (%i) to (%i)", FromBeat, FromRow, ToRow);
//		const int ToRow = (int) roundf(FromRow * song.m_Timing.m_BPMSegments[0].m_fBPM / song.m_BPMSegments[seg].m_fBPM);
//		const int Rows = out.GetLastRow() - FromRow + 1;
//		int LastRow;
//		if(seg+1 < song.m_Timing.m_BPMSegments().size())
//			LastRow = (int) NoteRowToBeat( song.m_Timing.m_BPMSegments[seg+1].m_fStartBeat ) - 1;
//		else
//			LastRow = out.GetLastRow();
        NoteData tmp;
        tmp.SetNumTracks(out.GetNumTracks());
        tmp.CopyRange( &out, FromRow, out.GetLastRow() );
        out.ClearRange( FromRow, out.GetLastRow() );
        out.CopyRange( &tmp, 0, tmp.GetLastRow(), ToRow );
    }

    /*
    	out.ConvertHoldNotesTo2sAnd3s();
    	for( t = 0; t < notedata.GetNumTracks(); ++t )
    	{
    		const float CurBPM = song.GetBPMAtBeat( NoteRowToBeat(row) );
    		song.m_Timing.m_BPMSegments.size()
    		for( int row = 0; row <= notedata.GetLastRow(); ++row )
    		{
    			TapNote tn = notedata.GetTapNote(t, row);
    			if( tn == TAP_EMPTY )
    				continue;

    			const int RealRow = (int) roundf(row * OrigBPM / CurBPM);
    			if( RealRow == row )
    				continue;
    			LOG->Trace("from %i to %i", row, RealRow);
    			notedata.SetTapNote( t, RealRow, tn );
    			notedata.SetTapNote( t, row, TAP_EMPTY );
    		}
    	}
    	out.Convert2sAnd3sToHoldNotes();
    */
}
开发者ID:augustg,项目名称:stepmania-3.9,代码行数:48,代码来源:NotesLoaderKSF.cpp


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