本文整理汇总了C++中common::OutSaveFile::writeSint32BE方法的典型用法代码示例。如果您正苦于以下问题:C++ OutSaveFile::writeSint32BE方法的具体用法?C++ OutSaveFile::writeSint32BE怎么用?C++ OutSaveFile::writeSint32BE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::OutSaveFile
的用法示例。
在下文中一共展示了OutSaveFile::writeSint32BE方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeCompleteSaveFile
bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescription, int16 saveAndPlayChoice) {
Common::String savefileName = getSavefileName(saveSlot);
Common::SaveFileManager *saveFileManager = _system->getSavefileManager();
Common::OutSaveFile *file = saveFileManager->openForSaving(savefileName);
if (!file)
return false;
writeSaveGameHeader(file, saveDescription);
file->writeSint32BE(_gameVersion->_saveTargetToWrite);
file->writeSint32BE(1); // save version
file->writeSint32BE(_gameVersion->_origSaveFormatToWrite);
file->writeSint32BE(_gameVersion->_origPlatformToWrite);
// Was _gameID, useless.
file->writeSint32BE(0);
file->writeUint16BE(_dungeonId);
// write C0_SAVE_PART_GLOBAL_DATA part
file->writeSint32BE(_gameTime);
//L1348_s_GlobalData.LastRandomNumber = G0349_ul_LastRandomNumber;
file->writeUint16BE(_championMan->_partyChampionCount);
file->writeSint16BE(_dungeonMan->_partyMapX);
file->writeSint16BE(_dungeonMan->_partyMapY);
file->writeUint16BE(_dungeonMan->_partyDir);
file->writeByte(_dungeonMan->_partyMapIndex);
file->writeSint16BE(_championMan->_leaderIndex);
file->writeSint16BE(_championMan->_magicCasterChampionIndex);
file->writeUint16BE(_timeline->_eventCount);
file->writeUint16BE(_timeline->_firstUnusedEventIndex);
file->writeUint16BE(_timeline->_eventMaxCount);
file->writeUint16BE(_groupMan->_currActiveGroupCount);
file->writeSint32BE(_projexpl->_lastCreatureAttackTime);
file->writeSint32BE(_projexpl->_lastPartyMovementTime);
file->writeSint16BE(_disabledMovementTicks);
file->writeSint16BE(_projectileDisableMovementTicks);
file->writeSint16BE(_lastProjectileDisabledMovementDirection);
file->writeUint16BE(_championMan->_leaderHandObject.toUint16());
file->writeUint16BE(_groupMan->_maxActiveGroupCount);
// write C1_SAVE_PART_ACTIVE_GROUP part
_groupMan->saveActiveGroupPart(file);
// write C2_SAVE_PART_PARTY part
_championMan->savePartyPart2(file);
// write C3_SAVE_PART_EVENTS part
_timeline->saveEventsPart(file);
// write C4_SAVE_PART_TIMELINE part
_timeline->saveTimelinePart(file);
// write sentinel
file->writeUint32BE(0x6f85e3d3);
// save _g278_dungeonFileHeader
DungeonFileHeader &header = _dungeonMan->_dungeonFileHeader;
file->writeUint16BE(header._ornamentRandomSeed);
file->writeUint16BE(header._rawMapDataSize);
file->writeByte(header._mapCount);
file->writeByte(0); // to match the structure of dungeon.dat, will be discarded
file->writeUint16BE(header._textDataWordCount);
file->writeUint16BE(header._partyStartLocation);
file->writeUint16BE(header._squareFirstThingCount);
for (uint16 i = 0; i < 16; ++i)
file->writeUint16BE(header._thingCounts[i]);
// save _g277_dungeonMaps
for (uint16 i = 0; i < _dungeonMan->_dungeonFileHeader._mapCount; ++i) {
Map &map = _dungeonMan->_dungeonMaps[i];
file->writeUint16BE(map._rawDunDataOffset);
file->writeUint32BE(0); // to match the structure of dungeon.dat, will be discarded
file->writeByte(map._offsetMapX);
file->writeByte(map._offsetMapY);
uint16 tmp;
tmp = ((map._height & 0x1F) << 11) | ((map._width & 0x1F) << 6) | (map._level & 0x3F);
file->writeUint16BE(tmp);
tmp = ((map._randFloorOrnCount & 0xF) << 12) | ((map._floorOrnCount & 0xF) << 8)
| ((map._randWallOrnCount & 0xF) << 4) | (map._wallOrnCount & 0xF);
file->writeUint16BE(tmp);
tmp = ((map._difficulty & 0xF) << 12) | ((map._creatureTypeCount & 0xF) << 4) | (map._doorOrnCount & 0xF);
file->writeUint16BE(tmp);
tmp = ((map._doorSet1 & 0xF) << 12) | ((map._doorSet0 & 0xF) << 8)
| ((map._wallSet & 0xF) << 4) | (map._floorSet & 0xF);
file->writeUint16BE(tmp);
}
// save _g280_dungeonColumnsCumulativeSquareThingCount
for (uint16 i = 0; i < _dungeonMan->_dungeonColumCount; ++i)
file->writeUint16BE(_dungeonMan->_dungeonColumnsCumulativeSquareThingCount[i]);
// save _g283_squareFirstThings
for (uint16 i = 0; i < _dungeonMan->_dungeonFileHeader._squareFirstThingCount; ++i)
file->writeUint16BE(_dungeonMan->_squareFirstThings[i].toUint16());
// save _g260_dungeonTextData
for (uint16 i = 0; i < _dungeonMan->_dungeonFileHeader._textDataWordCount; ++i)
//.........这里部分代码省略.........