本文整理汇总了C++中FitIniFile::create方法的典型用法代码示例。如果您正苦于以下问题:C++ FitIniFile::create方法的具体用法?C++ FitIniFile::create怎么用?C++ FitIniFile::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FitIniFile
的用法示例。
在下文中一共展示了FitIniFile::create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Save
bool CCampaignData::Save(CString pathName)
{
FitIniFile fitFile;
int32_t result = fitFile.create(pathName.GetBuffer(0));
if(result != NO_ERROR)
{
return false;
}
fitFile.writeBlock("Campaign");
fitFile.writeIdBoolean("NameUseResourceString", m_NameUseResourceString);
if(!m_NameUseResourceString)
{
fitFile.writeIdString("CampaignName", m_Name.GetBuffer(0));
}
else
{
fitFile.writeIdLong("NameID", m_NameResourceStringID);
}
fitFile.writeIdLong("CBills", m_CBills);
fitFile.writeIdString("FinalVideo", m_FinalVideo.GetBuffer(0));
fitFile.writeIdLong("GroupCount", m_GroupList.Count());
CGroupList::EIterator it;
int32_t index;
for(it = m_GroupList.Begin(), index = 0; !it.IsDone(); it++, index += 1)
{
ECharString blockName;
blockName.Format("Group%d", index);
fitFile.writeBlock(blockName.Data());
(*it).Save(fitFile, blockName.Data());
}
fitFile.close();
return true;
}
示例2: end
void MissionResults::end()
{
//Need to save the game here so salvage and pilot promotion get saved as well!
// Pity we never call ::end!
const char* pMissionName = LogisticsData::instance->getLastMission();
if ( pMissionName && !LogisticsData::instance->isSingleMission() && !LogisticsData::instance->campaignOver() && !MPlayer )
{
FitIniFile file;
char name[256];
cLoadString( IDS_AUTOSAVE_NAME, name, 255 );
char fullName[256];
sprintf( fullName, name, pMissionName );
FullPathFileName path;
path.init( savePath, fullName, ".fit" );
if ( NO_ERR == file.create( path ) )
LogisticsData::instance->save( file );
}
}
示例3: start
//----------------------------------------------------------------------------------
void Logistics::start (long startMode)
{
bMissionLoaded = 0;
userInput->setMouseCursor( mState_LOGISTICS );
// userInput->mouseOn();
DWORD localRenderer = prefs.renderer;
if (prefs.renderer != 0 && prefs.renderer != 3)
localRenderer = 0;
bool localFullScreen = prefs.fullScreen;
bool localWindow = !prefs.fullScreen;
if (Environment.fullScreen && prefs.fullScreen)
localFullScreen = false;
switch (startMode)
{
case log_RESULTS: // pull out results later...
active = true;
//Heading back to logistics now. Change screen back to 800x600
if (prefs.renderer == 3)
gos_SetScreenMode(800,600,16,0,0,0,true,localFullScreen,0,localWindow,0,localRenderer);
else
gos_SetScreenMode(800,600,16,prefs.renderer,0,0,0,localFullScreen,0,localWindow,0,localRenderer);
lastMissionResult = scenarioResult;
if ( !missionResults )
{
LogisticsData::instance->init();
missionResults = new MissionResults;
missionResults->init();
}
if ( scenarioResult == mis_PLAYER_WIN_BIG || MPlayer )
{
LogisticsData::instance->removeMechsInForceGroup();
if ( !MPlayer )
LogisticsData::instance->setMissionCompleted( );
// if mission is over, play video then quit when done
if ( LogisticsData::instance->campaignOver() && !MPlayer && !LogisticsData::instance->isSingleMission() )
{
mission->destroy();
playFullScreenVideo( LogisticsData::instance->getFinalVideo() );
setLogisticsState(log_SPLASH);
missionBegin->beginSplash();
userInput->mouseOn();
char tmp[256];
cLoadString( IDS_FINAL_MISSION, tmp, 255 );
FullPathFileName path;
path.init( savePath, tmp, ".fit" );
FitIniFile file;
file.create( path );
LogisticsData::instance->save(file);
active = true;
}
else if ( LogisticsData::instance->isSingleMission() && !MPlayer )
{
missionBegin->beginSplash();
logisticsState = log_SPLASH;
}
else
{
missionResults->begin();
logisticsState = log_RESULTS;
}
}
else if ( !justStartMission )
{
missionResults->bDone = true;
logisticsState = log_RESULTS;
}
else // end the game
quitGame = true;
break;
case log_SPLASH:
{
if (aborted) {
if (prefs.renderer == 3)
gos_SetScreenMode(800,600,16,0,0,0,true,localFullScreen,0,localWindow,0,localRenderer);
else
gos_SetScreenMode(800,600,16,prefs.renderer,0,0,0,localFullScreen,0,localWindow,0,localRenderer);
if ( missionBegin )
missionBegin->beginSplash();
if ( MPlayer )
{
delete MPlayer;
MPlayer = NULL;
}
}
initializeLogData();
bool bTestScript = false;
//.........这里部分代码省略.........