Files
Webcam/include/engine/core/object_nml.cpp

40 lines
1.3 KiB
C++

/* -----------------------------------------------------------------------------
GSFramework
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */
#include "core/object.h"
#include "reflection/c_refl.h"
#include "metafile/nml_object.h"
using GS::Core::Object;
using GS::Reflection::Property;
using namespace GS::NML;
//------------------------------------------------------------------------------
Property serializable[] =
{
{ Property::StringProp, "Geometry", offsetof(Object, geometry), 0 },
{ Property::BoolProp, "CacheGeometry", offsetof(Object, cache_geometry), 0 },
{ Property::InvalidProp, 0, 0, 0 }
};
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool Object::FromMetaTag(Tag &t)
{
if ((t.name != "Object") || !GenericObjectFromMetaTag(t, this, serializable))
return false;
if (Tag *c = t.GetTag("Item")) Item::FromMetaTag(*c);
return true;
}
Tag *Object::AsMetaTag() const
{
Tag *t = new Tag("Object");
t->AddChild(Item::AsMetaTag());
return GenericObjectToMetaTag(t, this, serializable);
}
//------------------------------------------------------------------------------