本文整理汇总了C++中common::SaveFileManager::popErrorDesc方法的典型用法代码示例。如果您正苦于以下问题:C++ SaveFileManager::popErrorDesc方法的具体用法?C++ SaveFileManager::popErrorDesc怎么用?C++ SaveFileManager::popErrorDesc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::SaveFileManager
的用法示例。
在下文中一共展示了SaveFileManager::popErrorDesc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeSaveState
void SkyMetaEngine::removeSaveState(const char *target, int slot) const {
if (slot == 0) // do not delete the auto save
return;
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
char fName[20];
sprintf(fName,"SKY-VM.%03d", slot - 1);
saveFileMan->removeSavefile(fName);
// Load current save game descriptions
Common::StringArray savenames;
savenames.resize(MAX_SAVE_GAMES+1);
Common::InSaveFile *inf;
inf = saveFileMan->openForLoading("SKY-VM.SAV");
if (inf != NULL) {
char *tmpBuf = new char[MAX_SAVE_GAMES * MAX_TEXT_LEN];
char *tmpPtr = tmpBuf;
inf->read(tmpBuf, MAX_SAVE_GAMES * MAX_TEXT_LEN);
for (int i = 0; i < MAX_SAVE_GAMES; ++i) {
savenames[i] = tmpPtr;
tmpPtr += savenames[i].size() + 1;
}
delete inf;
delete[] tmpBuf;
}
// Update the save game description at the given slot
savenames[slot - 1] = "";
// Save the updated descriptions
Common::OutSaveFile *outf;
outf = saveFileMan->openForSaving("SKY-VM.SAV");
bool ioFailed = true;
if (outf) {
for (uint16 cnt = 0; cnt < MAX_SAVE_GAMES; cnt++) {
outf->write(savenames[cnt].c_str(), savenames[cnt].size() + 1);
}
outf->finalize();
if (!outf->err())
ioFailed = false;
delete outf;
}
if (ioFailed)
warning("Unable to store Savegame names to file SKY-VM.SAV. (%s)", saveFileMan->popErrorDesc().c_str());
}