本文整理汇总了C++中SaveStateDescriptor::getSaveDate方法的典型用法代码示例。如果您正苦于以下问题:C++ SaveStateDescriptor::getSaveDate方法的具体用法?C++ SaveStateDescriptor::getSaveDate怎么用?C++ SaveStateDescriptor::getSaveDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SaveStateDescriptor
的用法示例。
在下文中一共展示了SaveStateDescriptor::getSaveDate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readSavegameHeader
bool readSavegameHeader(Common::InSaveFile *in, FullpipeSavegameHeader &header) {
header.thumbnail = NULL;
uint oldPos = in->pos();
in->seek(-4, SEEK_END);
int headerOffset = in->readUint32LE();
// Sanity check
if (headerOffset >= in->pos() || headerOffset == 0) {
in->seek(oldPos, SEEK_SET); // Rewind the file
fillDummyHeader(header);
return false;
}
in->seek(headerOffset, SEEK_SET);
in->read(header.id, 6);
// Validate the header Id
if (strcmp(header.id, "SVMCR")) {
in->seek(oldPos, SEEK_SET); // Rewind the file
fillDummyHeader(header);
return false;
}
header.version = in->readByte();
if (header.version != FULLPIPE_SAVEGAME_VERSION) {
in->seek(oldPos, SEEK_SET); // Rewind the file
fillDummyHeader(header);
return false;
}
header.date = in->readUint32LE();
header.time = in->readUint16LE();
header.playtime = in->readUint32LE();
// Generate savename
SaveStateDescriptor desc;
parseSavegameHeader(header, desc);
header.saveName = Common::String::format("%s %s", desc.getSaveDate().c_str(), desc.getSaveTime().c_str());
// Get the thumbnail
header.thumbnail = Graphics::loadThumbnail(*in);
in->seek(oldPos, SEEK_SET); // Rewind the file
if (!header.thumbnail)
return false;
return true;
}