diff --git a/src/factories/TextureFactory.cpp b/src/factories/TextureFactory.cpp index 4f21c74..6aa4f82 100644 --- a/src/factories/TextureFactory.cpp +++ b/src/factories/TextureFactory.cpp @@ -93,7 +93,8 @@ void TextureHeaderExporter::Export(std::ostream &write, std::shared_ptr raw, std::string& entryName, YAML::Node &node, std::string* replacement) { - auto data = std::static_pointer_cast(raw)->mBuffer; + auto texture = std::static_pointer_cast(raw); + auto data = texture->mBuffer; auto symbol = GetSafeNode(node, "symbol", entryName); auto format = GetSafeNode(node, "format"); @@ -107,12 +108,22 @@ void TextureCodeExporter::Export(std::ostream &write, std::shared_ptrmFormat.depth / 8)); + + SPDLOG_INFO("Byte Size: {}", byteSize); + + for (int i = 0; i < data.size(); i+=byteSize) { if (i % 16 == 0 && i != 0) { file << std::endl; } - file << "0x" << std::hex << std::setw(2) << std::setfill('0') << static_cast(data[i]) << ", "; + file << "0x"; + + for (int j = 0; j < byteSize; j++) { + file << std::hex << std::setw(2) << std::setfill('0') << static_cast(data[i + j]); + } + + file << ", "; } file << std::endl;