| 21 | |
| 22 | namespace tgfx { |
| 23 | static void SerializeMatrixImpl(flexbuffers::Builder& fbb, const Matrix* matrix) { |
| 24 | float buffer[6] = {0.0f}; |
| 25 | matrix->get6(buffer); |
| 26 | std::string key = ""; |
| 27 | for (int i = 0; i < 6; i++) { |
| 28 | key = "[" + std::to_string(i) + "]"; |
| 29 | SerializeUtils::SetFlexBufferMap(fbb, key.c_str(), buffer[i]); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | std::shared_ptr<Data> MatrixSerialization::Serialize(const Matrix* matrix) { |
| 34 | DEBUG_ASSERT(matrix != nullptr) |