本文整理汇总了C++中Song::CreateSteps方法的典型用法代码示例。如果您正苦于以下问题:C++ Song::CreateSteps方法的具体用法?C++ Song::CreateSteps怎么用?C++ Song::CreateSteps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Song
的用法示例。
在下文中一共展示了Song::CreateSteps方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadNoteDataFromSimfile
bool KSFLoader::LoadNoteDataFromSimfile( const std::string & cachePath, Steps &out )
{
bool KIUCompliant = false;
Song dummy;
if (!LoadGlobalData(cachePath, dummy, KIUCompliant))
return false;
Steps *notes = dummy.CreateSteps();
if (LoadFromKSFFile(cachePath, *notes, dummy, KIUCompliant))
{
KIUCompliant = true; // yeah, reusing a variable.
out.SetNoteData(notes->GetNoteData());
}
delete notes;
return KIUCompliant;
}
示例2: LoadFromDir
bool KSFLoader::LoadFromDir( const std::string &sDir, Song &out )
{
LOG->Trace( "KSFLoader::LoadFromDir(%s)", sDir.c_str() );
vector<std::string> arrayKSFFileNames;
GetDirListing( sDir + "*.ksf", arrayKSFFileNames );
// We shouldn't have been called to begin with if there were no KSFs.
ASSERT( arrayKSFFileNames.size() != 0 );
bool bKIUCompliant = false;
/* With Split Timing, there has to be a backup Song Timing in case
* anything goes wrong. As these files are kept in alphabetical
* order (hopefully), it is best to use the LAST file for timing
* purposes, for that is the "normal", or easiest difficulty.
* Usually. */
// Nevermind, kiu compilancy is screwing things up:
// IE, I have two simfiles, oh wich each have four ksf files, the first one has
// the first ksf with directmove timing changes, and the rest are not, everything
// goes fine. In the other hand I have my second simfile with the first ksf file
// without directmove timing changes and the rest have changes, changes are not
// loaded due to kiucompilancy in the first ksf file.
// About the "normal" thing, my simfiles' ksfs uses non-standard naming so
// the last chart is usually nightmare or normal, I use easy and normal
// indistinctly for SM so it shouldn't matter, I use piu fiesta/ex naming
// for directmove though, and we're just gathering basic info anyway, and
// most of the time all the KSF files have the same info in the #TITLE:; section
unsigned files = arrayKSFFileNames.size();
std::string dir = out.GetSongDir();
if( !LoadGlobalData(dir + arrayKSFFileNames[files - 1], out, bKIUCompliant) )
return false;
out.m_sSongFileName = dir + arrayKSFFileNames[files - 1];
// load the Steps from the rest of the KSF files
for( unsigned i=0; i<files; i++ )
{
Steps* pNewNotes = out.CreateSteps();
if( !LoadFromKSFFile(dir + arrayKSFFileNames[i], *pNewNotes, out, bKIUCompliant) )
{
delete pNewNotes;
continue;
}
pNewNotes->SetFilename(dir + arrayKSFFileNames[i]);
out.AddSteps( pNewNotes );
}
return true;
}