本文整理汇总了C++中CIniFile::Create方法的典型用法代码示例。如果您正苦于以下问题:C++ CIniFile::Create方法的具体用法?C++ CIniFile::Create怎么用?C++ CIniFile::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIniFile
的用法示例。
在下文中一共展示了CIniFile::Create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExportFrameKey
bool CEditModel::ExportFrameKey( const string& szFileName )
{
CAnimationGroup* pAniGroup = m_pAnimationGroup;
if( pAniGroup == NULL )
return false;
CIniFile IniFile;
IniFile.Create(gbk_to_utf16(szFileName).c_str());
int n = pAniGroup->GetAnimateNum();
string aniname = "";
string keyName = "";
WORD nKeyFrame = 0;
WORD nAttack01KeyFrame = 0;
bool attackFlag[4] = {false};
bool bIniWrited = false;
// 循环处理所有动画,特殊处理attack动画
for( int i = 0; i < n; ++i )
{
aniname = (*pAniGroup)[i]->GetName();
const GMap<WORD,sqr::IDNAME>& Keys = *(*pAniGroup)[i]->GetFrameString();
size_t m = Keys.size();
if (aniname.find("attack") != -1)
{
// 处理e字段之外的字段
if (m != 0)
{
for(GMap<WORD,sqr::IDNAME>::const_iterator it = Keys.begin(); it != Keys.end(); it++)
{
nKeyFrame = it->first;
keyName = it->second;
if (keyName != "e")
{
IniFile.SetValue(aniname, keyName, nKeyFrame);
bIniWrited = true;
}
}
}
// 为attack01 - attack04增加动画长度字段e
keyName = "e";
nKeyFrame = (*pAniGroup)[i]->GetFrameNum();
if (aniname == "attack01")
{
attackFlag[0] = true;
nAttack01KeyFrame = nKeyFrame;
}
else if (aniname == "attack02")
{
attackFlag[1] = true;
}
else if (aniname == "attack03")
{
attackFlag[2] = true;
}
else if (aniname == "attack04")
{
attackFlag[3] = true;
}
IniFile.SetValue(aniname, keyName, nKeyFrame);
bIniWrited = true;
}
else if(IsFindKeyAniName(aniname))
{
if (m != 0)
{
for(GMap<WORD,sqr::IDNAME>::const_iterator it = Keys.begin(); it != Keys.end(); it++)
{
nKeyFrame = it->first;
keyName = it->second;
if (keyName != "e")
{
IniFile.SetValue(aniname, keyName, nKeyFrame);
bIniWrited = true;
}
}
}
//为sf01-sf06 cast01-cast05增加动画长度
keyName = "e";
nKeyFrame = (*pAniGroup)[i]->GetFrameNum();
IniFile.SetValue(aniname, keyName, nKeyFrame);
bIniWrited = true;
}
else
{
if (m != 0)
{
for(GMap<WORD,sqr::IDNAME>::const_iterator it = Keys.begin(); it != Keys.end(); it++)
{
nKeyFrame = it->first;
keyName = it->second;
IniFile.SetValue(aniname, keyName, nKeyFrame);
bIniWrited = true;
}
}
//为其他没有key的动作加上动作全帧长度
keyName = "e";
nKeyFrame = (*pAniGroup)[i]->GetFrameNum();
//.........这里部分代码省略.........