Rework Serialization functions
add name and handle more types
This commit is contained in:
@@ -217,16 +217,10 @@ namespace Nz
|
||||
template<typename T>
|
||||
bool Serialize(SerializationContext& context, const OrientedBox<T>& obb, TypeTag<OrientedBox<T>>)
|
||||
{
|
||||
if (!Serialize(context, obb.localBox))
|
||||
if (!Serialize(context, "localBox", obb.localBox))
|
||||
return false;
|
||||
|
||||
for (auto&& corner : obb.m_corners)
|
||||
{
|
||||
if (!Serialize(context, corner))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return Serialize(context, "corners", obb.m_corners);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -239,16 +233,10 @@ namespace Nz
|
||||
template<typename T>
|
||||
bool Unserialize(SerializationContext& context, OrientedBox<T>* obb, TypeTag<OrientedBox<T>>)
|
||||
{
|
||||
if (!Unserialize(context, &obb->localBox))
|
||||
if (!Unserialize(context, "localBox", &obb->localBox))
|
||||
return false;
|
||||
|
||||
for (auto&& corner : obb->m_corners)
|
||||
{
|
||||
if (!Unserialize(context, &corner))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return Unserialize(context, "corners", &obb->m_corners);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user