Math: Add serialization specialization for all types
Former-commit-id: 7e45c50d3b4eabfc581736f290fc208592d3d46c
This commit is contained in:
@@ -1761,6 +1761,44 @@ namespace Nz
|
||||
|
||||
return matrix;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Serializes a Matrix4
|
||||
* \return true if successfully serialized
|
||||
*
|
||||
* \param context Serialization context
|
||||
* \param matrix Input matrix
|
||||
*/
|
||||
template<typename T>
|
||||
bool Serialize(SerializationContext& context, const Matrix4<T>& matrix)
|
||||
{
|
||||
for (unsigned int i = 0; i < 16; ++i)
|
||||
{
|
||||
if (!Serialize(context, matrix[i]))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Unserializes a Matrix4
|
||||
* \return true if successfully unserialized
|
||||
*
|
||||
* \param context Serialization context
|
||||
* \param matrix Output matrix
|
||||
*/
|
||||
template<typename T>
|
||||
bool Unserialize(SerializationContext& context, Matrix4<T>* matrix)
|
||||
{
|
||||
for (unsigned int i = 0; i < 16; ++i)
|
||||
{
|
||||
if (!Unserialize(context, &matrix[i]))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user