Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 27, 2008, 4:08:51 AM (16 years ago)
Author:
landauf
Message:

many changes, most important: BaseObject takes now a pointer to it's creator which is needed to build a level hierarchy (with different scenes)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/core/Template.cc

    r2013 r2019  
    3838    CreateFactory(Template);
    3939
    40     Template::Template() : xmlelement_("")
     40    Template::Template(BaseObject* creator) : BaseObject(creator), xmlelement_("")
    4141    {
    4242        RegisterObject(Template);
     
    5959        XMLPortParam(Template, "baseclass", setBaseclass, getBaseclass, xmlelement, mode);
    6060
    61         this->setXMLElement(*dynamic_cast<TiXmlElement*>(xmlelement.FirstChildElement(false)->GetTiXmlPointer()));
     61        Element* element = xmlelement.FirstChildElement(false);
     62        if (element)
     63        {
     64            TiXmlElement* tixmlelement = dynamic_cast<TiXmlElement*>(element->GetTiXmlPointer());
     65            if (tixmlelement)
     66                this->setXMLElement(*tixmlelement);
     67        }
    6268    }
    6369
Note: See TracChangeset for help on using the changeset viewer.