Skip to content

Commit

Permalink
Update MtxFactory.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaMech authored and KiritoDv committed May 14, 2024
1 parent 8212948 commit 4a9e2b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/factories/MtxFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,18 @@ ExportResult MtxBinaryExporter::Export(std::ostream &write, std::shared_ptr<IPar
}

std::optional<std::shared_ptr<IParsedData>> MtxFactory::parse(std::vector<uint8_t>& buffer, YAML::Node& node) {
auto count = GetSafeNode<size_t>(node, "count");
//auto count = GetSafeNode<size_t>(node, "count");

auto [_, segment] = Decompressor::AutoDecode(node, buffer);
LUS::BinaryReader reader(segment.data, count * sizeof(MtxRaw));
LUS::BinaryReader reader(segment.data, 1 * sizeof(MtxRaw));

reader.SetEndianness(LUS::Endianness::Big);
std::vector<MtxRaw> matrix;

#define FIXTOF(x) ((float)((x) / 65536.0f))

// Reads the inteer portion, the fractional portion, puts each together into a fixed-point value, and finally converts to float.
for(size_t i = 0; i < count; i++) {
for(size_t i = 0; i < 1; i++) {
// Read the integer portion of the fixed-point value (ex. 4)
auto i1 = reader.ReadInt16();
auto i2 = reader.ReadInt16();
Expand Down

0 comments on commit 4a9e2b9

Please sign in to comment.