本文整理汇总了C++中BigEndianView::eof方法的典型用法代码示例。如果您正苦于以下问题:C++ BigEndianView::eof方法的具体用法?C++ BigEndianView::eof怎么用?C++ BigEndianView::eof使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BigEndianView
的用法示例。
在下文中一共展示了BigEndianView::eof方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseGSH
bool parseGSH(BigEndianView &fh)
{
gsh::Header header;
fh.read(header.magic);
if (header.magic != gsh::Header::Magic) {
std::cout << "Unexpected gsh magic " << header.magic << std::endl;
return false;
}
fh.read(header.unk1);
fh.read(header.unk2);
fh.read(header.unk3);
fh.read(header.unk4);
fh.read(header.unk5);
fh.read(header.unk6);
fh.read(header.unk7);
while (!fh.eof()) {
gsh::Block block;
fh.read(block.magic);
if (block.magic != gsh::Block::Magic) {
std::cout << "Unexpected block magic " << header.magic << std::endl;
return false;
}
fh.read(block.unk1);
fh.read(block.unk2);
fh.read(block.unk3);
fh.read(block.type);
fh.read(block.dataLength);
fh.read(block.unk4);
fh.read(block.unk5);
block.data.resize(block.dataLength);
fh.read<uint8_t>(block.data);
if (block.type == gsh::Block::VertexShader || block.type == gsh::Block::PixelShader) {
std::string out;
latte::disassemble(out, block.data);
std::cout << "----------------------------------------------" << std::endl;
std::cout << " Disassembly " << std::endl;
std::cout << "----------------------------------------------" << std::endl;
std::cout << out << std::endl;
std::cout << std::endl;
latte::Shader shader;
latte::decode(shader, block.data);
std::cout << "----------------------------------------------" << std::endl;
std::cout << " Blocks " << std::endl;
std::cout << "----------------------------------------------" << std::endl;
latte::blockify(shader);
std::cout << std::endl;
std::string hlsl;
latte::generateHLSL(shader, hlsl);
std::cout << "----------------------------------------------" << std::endl;
std::cout << " HLSL " << std::endl;
std::cout << "----------------------------------------------" << std::endl;
std::cout << hlsl << std::endl;
std::cout << std::endl;
}
}
return true;
}