Rework Serialization functions
add name and handle more types
This commit is contained in:
@@ -421,13 +421,13 @@ namespace Nz
|
||||
template<typename T>
|
||||
bool Serialize(SerializationContext& context, const BoundingVolume<T>& boundingVolume, TypeTag<BoundingVolume<T>>)
|
||||
{
|
||||
if (!Serialize(context, static_cast<UInt8>(boundingVolume.extent)))
|
||||
if (!Serialize(context, "extent", static_cast<UInt8>(boundingVolume.extent)))
|
||||
return false;
|
||||
|
||||
if (!Serialize(context, boundingVolume.aabb))
|
||||
if (!Serialize(context, "aabb", boundingVolume.aabb))
|
||||
return false;
|
||||
|
||||
if (!Serialize(context, boundingVolume.obb))
|
||||
if (!Serialize(context, "obb", boundingVolume.obb))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -446,7 +446,7 @@ namespace Nz
|
||||
bool Unserialize(SerializationContext& context, BoundingVolume<T>* boundingVolume, TypeTag<BoundingVolume<T>>)
|
||||
{
|
||||
UInt8 extend;
|
||||
if (!Unserialize(context, &extend))
|
||||
if (!Unserialize(context, "extent", &extend))
|
||||
return false;
|
||||
|
||||
if (extend > UnderlyingCast(Extent::Max))
|
||||
@@ -454,10 +454,10 @@ namespace Nz
|
||||
|
||||
boundingVolume->extent = static_cast<Extent>(extend);
|
||||
|
||||
if (!Unserialize(context, &boundingVolume->aabb))
|
||||
if (!Unserialize(context, "aabb", &boundingVolume->aabb))
|
||||
return false;
|
||||
|
||||
if (!Unserialize(context, &boundingVolume->obb))
|
||||
if (!Unserialize(context, "obb", &boundingVolume->obb))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user