Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 16, 2008, 6:01:13 PM (16 years ago)
Author:
landauf
Message:

Merged objecthierarchy2 into presentation branch

Couln't merge 2 lines in Gamestate.cc and a whole block of code in GSDedicated.cc (it seems like oli implemented in both branches something like a network-tick-limiter but with different approaches)

Not yet tested in network mode and with bots
The SpaceShips movement is also not yet fully adopted to the new physics (see Engine class)

Location:
code/branches/presentation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/core/XMLPort.h

    r2459 r2485  
    4343#include "CorePrereqs.h"
    4444
     45#include <cassert>
    4546#include "util/Debug.h"
    4647#include "util/Exception.h"
     
    369370            }
    370371
     372            ~XMLPortClassParamContainer()
     373            {
     374                assert(this->loadexecutor_);
     375                delete this->loadexecutor_;
     376                if (this->saveexecutor_)
     377                    delete this->saveexecutor_;
     378            }
     379
    371380            XMLPortParamContainer& port(BaseObject* owner, T* object, Element& xmlelement, XMLPort::Mode mode)
    372381            {
     
    376385                this->parseParams_.mode = mode;
    377386
    378                 if (mode == XMLPort::LoadObject)
     387                if ((mode == XMLPort::LoadObject) || (mode == XMLPort::ExpandObject))
    379388                {
    380389                    try
    381390                    {
    382391                        std::string attribute = xmlelement.GetAttribute(this->paramname_);
    383                         if ((attribute.size() > 0) || (this->loadexecutor_->allDefaultValuesSet()))
     392                        if ((attribute.size() > 0) || ((mode != XMLPort::ExpandObject) && this->loadexecutor_->allDefaultValuesSet()))
    384393                        {
    385394                            COUT(5) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << std::endl << this->owner_->getLoaderIndentation();
    386                             if (this->loadexecutor_->parse(object, attribute, ","))
     395                            if (this->loadexecutor_->parse(object, attribute, ",") || (mode  == XMLPort::ExpandObject))
    387396                                this->parseResult_ = PR_finished;
    388397                            else
    389398                                this->parseResult_ = PR_waiting_for_default_values;
    390399                        }
     400                        else if (mode == XMLPort::ExpandObject)
     401                            this->parseResult_ = PR_finished;
    391402                        else
    392403                            this->parseResult_ = PR_waiting_for_default_values;
     
    511522            }
    512523
     524            ~XMLPortClassObjectContainer()
     525            {
     526                assert(this->loadexecutor_);
     527                delete this->loadexecutor_;
     528                if (this->saveexecutor_)
     529                    delete this->saveexecutor_;
     530            }
     531
    513532            XMLPortObjectContainer& port(T* object, Element& xmlelement, XMLPort::Mode mode)
    514533            {
    515                 if (mode == XMLPort::LoadObject)
     534                if ((mode == XMLPort::LoadObject) || (mode == XMLPort::ExpandObject))
    516535                {
    517536                    try
Note: See TracChangeset for help on using the changeset viewer.