本文整理汇总了C++中Steps::GetSMNoteData方法的典型用法代码示例。如果您正苦于以下问题:C++ Steps::GetSMNoteData方法的具体用法?C++ Steps::GetSMNoteData怎么用?C++ Steps::GetSMNoteData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Steps
的用法示例。
在下文中一共展示了Steps::GetSMNoteData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteSMNotesTag
void NotesWriterSM::WriteSMNotesTag( const Steps &in, RageFile &f, bool bSavingCache )
{
f.PutLine( "" );
f.PutLine( ssprintf( "//---------------%s - %s----------------",
GameManager::StepsTypeToString(in.m_StepsType).c_str(), in.GetDescription().c_str() ) );
f.PutLine( "#NOTES:" );
f.PutLine( ssprintf( " %s:", GameManager::StepsTypeToString(in.m_StepsType).c_str() ) );
f.PutLine( ssprintf( " %s:", in.GetDescription().c_str() ) );
f.PutLine( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) );
f.PutLine( ssprintf( " %d:", in.GetMeter() ) );
int MaxRadar = bSavingCache? NUM_RADAR_CATEGORIES:5;
CStringArray asRadarValues;
for( int r=0; r < MaxRadar; r++ )
asRadarValues.push_back( ssprintf("%.3f", in.GetRadarValues()[r]) );
/* Don't append a newline here; it's added in NoteDataUtil::GetSMNoteDataString.
* If we add it here, then every time we write unmodified data we'll add an extra
* newline and they'll accumulate. */
f.Write( ssprintf( " %s:", join(",",asRadarValues).c_str() ) );
CString sNoteData;
CString sAttackData;
in.GetSMNoteData( sNoteData, sAttackData );
vector<CString> lines;
split( sNoteData, "\n", lines, false );
WriteLineList( f, lines, true, true );
if( sAttackData.empty() )
f.PutLine( ";" );
else
{
f.PutLine( ":" );
lines.clear();
split( sAttackData, "\n", lines, false );
WriteLineList( f, lines, true, true );
f.PutLine( ";" );
}
}
示例2: Decompress
void Steps::Decompress() const
{
if( m_bNoteDataIsFilled )
return; // already decompressed
if( parent )
{
// get autogen m_pNoteData
NoteData notedata;
parent->GetNoteData( notedata );
m_bNoteDataIsFilled = true;
int iNewTracks = GAMEMAN->GetStepsTypeInfo(m_StepsType).iNumTracks;
if( this->m_StepsType == StepsType_lights_cabinet )
{
NoteDataUtil::LoadTransformedLights( notedata, *m_pNoteData, iNewTracks );
}
else
{
NoteDataUtil::LoadTransformedSlidingWindow( notedata, *m_pNoteData, iNewTracks );
NoteDataUtil::RemoveStretch( *m_pNoteData, m_StepsType );
}
return;
}
if( !m_sFilename.empty() && m_sNoteDataCompressed.empty() )
{
/* We have data on disk and not in memory. Load it. */
Song s;
if( !SMLoader::LoadFromSMFile(m_sFilename, s, true) )
{
LOG->Warn( "Couldn't load \"%s\"", m_sFilename.c_str() );
return;
}
/* Find the steps. */
StepsID ID;
ID.FromSteps( this );
/* We're using a StepsID to search in a different copy of a Song than
* the one it was created with. Clear the cache before doing this,
* or search results will come from cache and point to the original
* copy. */
CachedObject<Steps>::ClearCacheAll();
Steps *pSteps = ID.ToSteps( &s, true );
if( pSteps == NULL )
{
LOG->Warn( "Couldn't find %s in \"%s\"", ID.ToString().c_str(), m_sFilename.c_str() );
return;
}
pSteps->GetSMNoteData( m_sNoteDataCompressed );
}
if( m_sNoteDataCompressed.empty() )
{
/* there is no data, do nothing */
}
else
{
// load from compressed
bool bComposite = GAMEMAN->GetStepsTypeInfo(m_StepsType).m_StepsTypeCategory == StepsTypeCategory_Routine;
m_bNoteDataIsFilled = true;
m_pNoteData->SetNumTracks( GAMEMAN->GetStepsTypeInfo(m_StepsType).iNumTracks );
NoteDataUtil::LoadFromSMNoteDataString( *m_pNoteData, m_sNoteDataCompressed, bComposite );
}
}