commit x64 compilation from lulu cause the other branch dont seems to compile properly at home
This commit is contained in:
54
include/framework/geometry/rect.cpp
Normal file
54
include/framework/geometry/rect.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
GSFramework
|
||||
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#include "geometry/rect.h"
|
||||
#include "metafile/nml.h"
|
||||
|
||||
using namespace GS;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
template <class T> NML::Tag *Rect<T>::AsMetaTag(const char *id) const
|
||||
{
|
||||
NML::Tag *root = new NML::Tag(id ? id : "Rect");
|
||||
|
||||
if (root)
|
||||
{
|
||||
root->AddChild("SX", sx);
|
||||
root->AddChild("SY", sy);
|
||||
root->AddChild("EX", ex);
|
||||
root->AddChild("EY", ey);
|
||||
}
|
||||
return root;
|
||||
}
|
||||
template <class T> bool Rect<T>::FromMetaTag(NML::Tag &tag)
|
||||
{
|
||||
NML::Tag *t;
|
||||
List <NML::Tag *> ::Iterator i(tag.GetTags().GetRoot());
|
||||
|
||||
t = i.ObjectPtr();
|
||||
if (!t) return false;
|
||||
sx = t->GetReal();
|
||||
++i;
|
||||
|
||||
t = i.ObjectPtr();
|
||||
if (!t) return false;
|
||||
sy = t->GetReal();
|
||||
++i;
|
||||
|
||||
t = i.ObjectPtr();
|
||||
if (!t) return false;
|
||||
ex = t->GetReal();
|
||||
++i;
|
||||
|
||||
t = i.ObjectPtr();
|
||||
if (!t) return false;
|
||||
ey = t->GetReal();
|
||||
++i;
|
||||
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user