Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 10, 2008, 2:06:09 AM (15 years ago)
Author:
landauf
Message:
  • Added new XMLPort mode, ExpandObject, which works like LoadObject but doesn't use default values if there are missing parameters. This is used if an object is expanded by templates (like adding CameraPositions).
  • Changed default level to sample3.oxw in objecthierarchy2 branch
  • Small fix with doubly added clients in Level- and PlayerManager
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy2/src/core/XMLPort.h

    r2171 r2173  
    336336                this->parseParams_.mode = mode;
    337337
    338                 if (mode == XMLPort::LoadObject)
     338                if ((mode == XMLPort::LoadObject) || (mode == XMLPort::ExpandObject))
    339339                {
    340340                    try
    341341                    {
    342342                        std::string attribute = xmlelement.GetAttribute(this->paramname_);
    343                         if ((attribute.size() > 0) || (this->loadexecutor_->allDefaultValuesSet()))
     343                        if ((attribute.size() > 0) || ((mode != XMLPort::ExpandObject) && this->loadexecutor_->allDefaultValuesSet()))
    344344                        {
    345345                            COUT(5) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << std::endl << this->owner_->getLoaderIndentation();
    346                             if (this->loadexecutor_->parse(object, attribute, ","))
     346                            if (this->loadexecutor_->parse(object, attribute, ",") || (mode  == XMLPort::ExpandObject))
    347347                                this->parseResult_ = PR_finished;
    348348                            else
    349349                                this->parseResult_ = PR_waiting_for_default_values;
    350350                        }
     351                        else if (mode == XMLPort::ExpandObject)
     352                            this->parseResult_ = PR_finished;
    351353                        else
    352354                            this->parseResult_ = PR_waiting_for_default_values;
     
    473475            XMLPortObjectContainer& port(T* object, Element& xmlelement, XMLPort::Mode mode)
    474476            {
    475                 if (mode == XMLPort::LoadObject)
     477                if ((mode == XMLPort::LoadObject) || (mode == XMLPort::ExpandObject))
    476478                {
    477479                    try
Note: See TracChangeset for help on using the changeset viewer.