本文整理汇总了C++中common::InSaveFile::readSint32BE方法的典型用法代码示例。如果您正苦于以下问题:C++ InSaveFile::readSint32BE方法的具体用法?C++ InSaveFile::readSint32BE怎么用?C++ InSaveFile::readSint32BE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::InSaveFile
的用法示例。
在下文中一共展示了InSaveFile::readSint32BE方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: querySaveMetaInfos
SaveStateDescriptor ToonMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
Common::String fileName = Common::String::format("%s.%03d", target, slot);
Common::InSaveFile *file = g_system->getSavefileManager()->openForLoading(fileName);
if (file) {
int32 version = file->readSint32BE();
if (version != TOON_SAVEGAME_VERSION) {
delete file;
return SaveStateDescriptor();
}
uint32 saveNameLength = file->readUint16BE();
char saveName[256];
file->read(saveName, saveNameLength);
saveName[saveNameLength] = 0;
SaveStateDescriptor desc(slot, saveName);
Graphics::Surface *thumbnail = new Graphics::Surface();
assert(thumbnail);
if (!Graphics::loadThumbnail(*file, *thumbnail)) {
delete thumbnail;
thumbnail = 0;
}
desc.setThumbnail(thumbnail);
desc.setDeletableFlag(true);
desc.setWriteProtectedFlag(false);
uint32 saveDate = file->readUint32BE();
uint16 saveTime = file->readUint16BE();
int day = (saveDate >> 24) & 0xFF;
int month = (saveDate >> 16) & 0xFF;
int year = saveDate & 0xFFFF;
desc.setSaveDate(year, month, day);
int hour = (saveTime >> 8) & 0xFF;
int minutes = saveTime & 0xFF;
desc.setSaveTime(hour, minutes);
delete file;
return desc;
}
return SaveStateDescriptor();
}
示例2: listSaves
SaveStateList ToonMetaEngine::listSaves(const char *target) const {
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
Common::StringArray filenames;
Common::String pattern = target;
pattern += ".???";
filenames = saveFileMan->listSavefiles(pattern);
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
SaveStateList saveList;
int slotNum = 0;
for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
// Obtain the last 3 digits of the filename, since they correspond to the save slot
slotNum = atoi(filename->c_str() + filename->size() - 3);
if (slotNum >= 0 && slotNum <= 99) {
Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
if (file) {
int32 version = file->readSint32BE();
if (version != TOON_SAVEGAME_VERSION) {
delete file;
continue;
}
// read name
uint16 nameSize = file->readUint16BE();
if (nameSize >= 255) {
delete file;
continue;
}
char name[256];
file->read(name, nameSize);
name[nameSize] = 0;
saveList.push_back(SaveStateDescriptor(slotNum, name));
delete file;
}
}
}
return saveList;
}
示例3: loadgame
LoadgameResult DMEngine::loadgame(int16 slot) {
if (slot == -1 && _newGameFl == k0_modeLoadSavedGame)
return kDMLoadgameFailure;
bool fadePalette = true;
Common::String fileName;
Common::SaveFileManager *saveFileManager = nullptr;
Common::InSaveFile *file = nullptr;
struct {
SaveTarget _saveTarget;
int32 _saveVersion;
OriginalSaveFormat _saveFormat;
OriginalSavePlatform _savePlatform;
uint16 _dungeonId;
} dmSaveHeader;
if (_newGameFl) {
//L1366_B_FadePalette = !F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(C0_DO_NOT_FORCE_DIALOG_DM_CSB, true);
_restartGameAllowed = false;
_championMan->_partyChampionCount = 0;
_championMan->_leaderHandObject = Thing::_none;
} else {
fileName = getSavefileName(slot);
saveFileManager = _system->getSavefileManager();
file = saveFileManager->openForLoading(fileName);
SaveGameHeader header;
readSaveGameHeader(file, &header);
warning("MISSING CODE: missing check for matching format and platform in save in f435_loadgame");
dmSaveHeader._saveTarget = (SaveTarget)file->readSint32BE();
dmSaveHeader._saveVersion = file->readSint32BE();
dmSaveHeader._saveFormat = (OriginalSaveFormat)file->readSint32BE();
dmSaveHeader._savePlatform = (OriginalSavePlatform)file->readSint32BE();
// Skip _gameId, which was useless
file->readSint32BE();
dmSaveHeader._dungeonId = file->readUint16BE();
_gameTime = file->readSint32BE();
// G0349_ul_LastRandomNumber = L1371_s_GlobalData.LastRandomNumber;
_championMan->_partyChampionCount = file->readUint16BE();
_dungeonMan->_partyMapX = file->readSint16BE();
_dungeonMan->_partyMapY = file->readSint16BE();
_dungeonMan->_partyDir = (Direction)file->readUint16BE();
_dungeonMan->_partyMapIndex = file->readByte();
_championMan->_leaderIndex = (ChampionIndex)file->readSint16BE();
_championMan->_magicCasterChampionIndex = (ChampionIndex)file->readSint16BE();
_timeline->_eventCount = file->readUint16BE();
_timeline->_firstUnusedEventIndex = file->readUint16BE();
_timeline->_eventMaxCount = file->readUint16BE();
_groupMan->_currActiveGroupCount = file->readUint16BE();
_projexpl->_lastCreatureAttackTime = file->readSint32BE();
_projexpl->_lastPartyMovementTime = file->readSint32BE();
_disabledMovementTicks = file->readSint16BE();
_projectileDisableMovementTicks = file->readSint16BE();
_lastProjectileDisabledMovementDirection = file->readSint16BE();
_championMan->_leaderHandObject = Thing(file->readUint16BE());
_groupMan->_maxActiveGroupCount = file->readUint16BE();
if (!_restartGameRequest) {
_timeline->initTimeline();
_groupMan->initActiveGroups();
}
_groupMan->loadActiveGroupPart(file);
_championMan->loadPartyPart2(file);
_timeline->loadEventsPart(file);
_timeline->loadTimelinePart(file);
// read sentinel
uint32 sentinel = file->readUint32BE();
assert(sentinel == 0x6f85e3d3);
_dungeonId = dmSaveHeader._dungeonId;
}
_dungeonMan->loadDungeonFile(file);
delete file;
if (_newGameFl) {
_timeline->initTimeline();
_groupMan->initActiveGroups();
if (fadePalette) {
_displayMan->startEndFadeToPalette(_displayMan->_blankBuffer);
delay(1);
_displayMan->fillScreen(kDMColorBlack);
_displayMan->startEndFadeToPalette(_displayMan->_paletteTopAndBottomScreen);
}
} else {
_restartGameAllowed = true;
switch (getGameLanguage()) { // localized
case Common::DE_DEU:
_dialog->dialogDraw(nullptr, "SPIEL WIRD GELADEN . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
break;
case Common::FR_FRA:
_dialog->dialogDraw(nullptr, "CHARGEMENT DU JEU . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
//.........这里部分代码省略.........