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


C++ Song::CreateSteps方法代码示例

本文整理汇总了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;
}
开发者ID:jberney,项目名称:stepmania,代码行数:15,代码来源:NotesLoaderKSF.cpp

示例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;
}
开发者ID:jberney,项目名称:stepmania,代码行数:47,代码来源:NotesLoaderKSF.cpp


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