本文整理汇总了C++中framework::CStream::Read32_MSBF方法的典型用法代码示例。如果您正苦于以下问题:C++ CStream::Read32_MSBF方法的具体用法?C++ CStream::Read32_MSBF怎么用?C++ CStream::Read32_MSBF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类framework::CStream
的用法示例。
在下文中一共展示了CStream::Read32_MSBF方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read
void CPwibSection::Read(Framework::CStream& inputStream)
{
uint32 signature = inputStream.Read32();
assert(signature == 'BIWP');
uint32 fileSize = inputStream.Read32_MSBF();
uint32 unknown = inputStream.Read32_MSBF();
m_dataOffset = inputStream.Read32_MSBF();
auto child = CSectionLoader::ReadSection(shared_from_this(), inputStream);
}
示例2: Read
void CStreamChunk::Read(Framework::CStream& inputStream)
{
CBaseChunk::Read(inputStream);
m_numElements = inputStream.Read32_MSBF();
m_vertexCount = inputStream.Read32_MSBF();
m_bytesPerVertex = inputStream.Read32_MSBF();
m_unknown1 = inputStream.Read32_MSBF();
ReadElements(inputStream);
ReadStream(inputStream);
}
示例3: Read
void CContainerChunk::Read(Framework::CStream& inputStream)
{
CBaseChunk::Read(inputStream);
m_childrenCount = inputStream.Read32_MSBF();
m_unknown1 = inputStream.Read32_MSBF();
m_unknown2 = inputStream.Read32_MSBF();
m_unknown3 = inputStream.Read32_MSBF();
LoadChildren(inputStream);
}
示例4: ReadElements
void CStreamChunk::ReadElements(Framework::CStream& inputStream)
{
for(unsigned int i = 0; i < m_numElements; i++)
{
ELEMENT element;
element.unknown1 = inputStream.Read16_MSBF();
element.offsetInVertex = inputStream.Read16_MSBF();
element.dataFormat = static_cast<ELEMENT_DATA_FORMAT>(inputStream.Read32_MSBF());
element.numElements = inputStream.Read32_MSBF();
element.dataType = static_cast<ELEMENT_DATA_TYPE>(inputStream.Read16_MSBF());
element.unknown2 = inputStream.Read16_MSBF();
m_elements.push_back(element);
}
assert(std::is_sorted(std::begin(m_elements), std::end(m_elements), [](const ELEMENT& el1, const ELEMENT& el2) { return el1.offsetInVertex < el2.offsetInVertex; } ));
}
示例5: Read
void CBoundingBoxChunk::Read(Framework::CStream& inputStream)
{
CBaseChunk::Read(inputStream);
uint32 minXInt = inputStream.Read32_MSBF();
uint32 minYInt = inputStream.Read32_MSBF();
uint32 minZInt = inputStream.Read32_MSBF();
uint32 maxXInt = inputStream.Read32_MSBF();
uint32 maxYInt = inputStream.Read32_MSBF();
uint32 maxZInt = inputStream.Read32_MSBF();
m_minX = *reinterpret_cast<float*>(&minXInt);
m_minY = *reinterpret_cast<float*>(&minYInt);
m_minZ = *reinterpret_cast<float*>(&minZInt);
m_maxX = *reinterpret_cast<float*>(&maxXInt);
m_maxY = *reinterpret_cast<float*>(&maxYInt);
m_maxZ = *reinterpret_cast<float*>(&maxZInt);
}
示例6: ExecuteDELD
void CPatchFile::ExecuteDELD(Framework::CStream& stream)
{
uint32 pathSize = stream.Read32_MSBF();
std::vector<char> pathData(pathSize);
stream.Read(pathData.data(), pathSize);
std::string path(std::begin(pathData), std::end(pathData));
uint32 otherData[4];
stream.Read(otherData, sizeof(otherData));
auto fullDirPath = m_gameLocationPath / path;
fullDirPath.make_preferred();
if(!boost::filesystem::exists(fullDirPath))
{
m_result.messages.push_back(string_format("Warning: Directory '%s' deletion requested but directory doesn't exist.",
fullDirPath.string().c_str()
));
}
else
{
boost::filesystem::remove_all(fullDirPath);
}
}
示例7: ExecuteETRY
void CPatchFile::ExecuteETRY(Framework::CStream& inputStream)
{
uint32 pathSize = inputStream.Read32_MSBF();
std::vector<char> pathData(pathSize);
inputStream.Read(pathData.data(), pathSize);
std::string path(std::begin(pathData), std::end(pathData));
auto fullFilePath = m_gameLocationPath / path;
auto fullFileDirectory = fullFilePath;
fullFileDirectory.remove_leaf();
fullFileDirectory.make_preferred();
fullFilePath.make_preferred();
if(!boost::filesystem::exists(fullFileDirectory))
{
m_result.messages.push_back(string_format("Warning: Directory '%s' doesn't exist. Creating.",
fullFileDirectory.string().c_str()
));
boost::filesystem::create_directories(fullFileDirectory);
}
if(!boost::filesystem::exists(fullFilePath))
{
m_result.messages.push_back(string_format("Warning: File '%s' doesn't exist. Creating.", fullFilePath.string().c_str()));
}
uint32 itemCount = inputStream.Read32_MSBF();
for(unsigned int i = 0; i < itemCount; i++)
{
//0x41 = last hash, 0x44 = first hash, 0x4D = both hashes?
uint32 hashMode = inputStream.Read32();
assert(hashMode == 0x41 || hashMode == 0x44 || hashMode == 0x4D);
uint8 srcFileHash[0x14];
uint8 dstFileHash[0x14];
inputStream.Read(srcFileHash, sizeof(srcFileHash));
inputStream.Read(dstFileHash, sizeof(dstFileHash));
//4E is no compression
//5A is zlib compression
uint32 compressionMode = inputStream.Read32();
assert((compressionMode == 0x4E) || (compressionMode == 0x5A));
uint32 compressedFileSize = inputStream.Read32_MSBF();
uint32 previousFileSize = inputStream.Read32_MSBF();
uint32 newFileSize = inputStream.Read32_MSBF();
if(i != (itemCount - 1))
{
assert(compressedFileSize == 0);
}
if(compressedFileSize == 0) continue;
//Data starts here
{
//Retrying here because explorer.exe can sometimes open the ffxiv*.exe files to load
//the icons making the open operation fail if we need to patch it again.
auto outputStream = CreateOutputStdStreamWithRetry(fullFilePath.native());
if(compressionMode == 0x4E)
{
ExtractUncompressed(outputStream, inputStream, compressedFileSize);
}
else if(compressionMode == 0x5A)
{
ExtractCompressed(outputStream, inputStream, compressedFileSize);
}
else
{
throw std::runtime_error("Unknown compression type.");
}
}
}
inputStream.Seek(0x08, Framework::STREAM_SEEK_CUR);
}
示例8: ExecuteFHDR
void CPatchFile::ExecuteFHDR(Framework::CStream& stream)
{
//Version number?
uint32 unknown = stream.Read32_MSBF();
assert(unknown == 0x0200);
}