Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 977 for code


Ignore:
Timestamp:
Apr 3, 2008, 2:12:10 PM (17 years ago)
Author:
scheusso
Message:

more adjustments for synchronisation

Location:
code/branches/network
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/TODO

    r974 r977  
    22
    33network:
    4         -handle variables of Spaceship (registerAllVariables)
    5         -make NPC class synchronisable
    6         -make Ambient class synchronisable
     4        -handle variables of Spaceship (registerAllVariables) ------ wait for spaceship to be cleaned up
     5        -make NPC class synchronisable ----- hopefully done
     6        -make Ambient class synchronisable ----- hopefully done
    77        -make Skybox class synchronisable ----- mostly done
  • code/branches/network/src/orxonox/objects/Ambient.cc

    r871 r977  
    5151    {
    5252        RegisterObject(Ambient);
     53        registerAllVariables();
    5354    }
    5455
     
    5758    }
    5859
     60    bool Ambient::create(){
     61      Orxonox::getSingleton()->getSceneManager()->setAmbientLight(ambientLight_);
     62      return true;
     63    }
     64   
     65    void Ambient::registerAllVariables(){
     66      registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
     67     
     68    }
     69   
    5970    void Ambient::loadParams(TiXmlElement* xmlElem)
    6071    {
     
    7687   void Ambient::setAmbientLight(const ColourValue& colour)
    7788   {
    78         Orxonox::getSingleton()->getSceneManager()->setAmbientLight(colour);
     89      ambientLight_=colour;     
    7990   }
    8091
     
    90101
    91102        XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, loading);
     103        create();
    92104    }
    93105}
  • code/branches/network/src/orxonox/objects/Ambient.h

    r871 r977  
    55
    66#include "core/BaseObject.h"
     7#include "network/Synchronisable.h"
    78
    89namespace orxonox
    910{
    10     class _OrxonoxExport Ambient : public BaseObject
     11    class _OrxonoxExport Ambient : public BaseObject, network::Synchronisable
    1112    {
    1213        public:
     
    1718            virtual void XMLPort(Element& xmlelement, bool loading);
    1819            void setAmbientLight(const ColourValue& colour);
     20            bool create();
     21            void registerAllVariables();
    1922
    2023        private:
    21 
     24            ColourValue ambientLight_;
    2225
    2326    };
  • code/branches/network/src/orxonox/objects/NPC.cc

    r919 r977  
    3939    RegisterObject(NPC);
    4040    movable_ = true;
     41    registerAllVariables();
    4142  }
    4243
     
    5859    this->translate(location);
    5960    movable_ = movable;
     61  }
     62 
     63  void NPC::registerAllVariables(){
     64    Model::registerAllVariables();
     65    registerVar(&movable_, sizeof(movable_), network::DATA);
     66  }
     67 
     68  bool NPC::create(){
     69    Model::create();
     70    return true;
    6071  }
    6172
  • code/branches/network/src/orxonox/objects/NPC.h

    r871 r977  
    2626      void update();
    2727      void setValues(Vector3 location, Vector3 speed, Vector3 acceleration, bool movable);
     28      void registerAllVariables();
     29      bool create();
    2830
    2931    private:
  • code/branches/network/src/orxonox/objects/Skybox.cc

    r974 r977  
    7272   }
    7373
     74   void Skybox::setSkyboxSrc(std::string src){
     75     skyboxSrc_ = src;
     76   }
     77   
    7478    /**
    7579        @brief XML loading and saving.
     
    8286        BaseObject::XMLPort(xmlelement, loading);
    8387
    84         XMLPortParamLoadOnly(Skybox, "src", setSkybox, xmlelement, loading);
     88        XMLPortParamLoadOnly(Skybox, "src", setSkyboxSrc, xmlelement, loading);
     89        create();
    8590    }
    8691   
  • code/branches/network/src/orxonox/objects/Skybox.h

    r974 r977  
    2323            bool create();
    2424            void registerAllVariables();
     25            void setSkyboxSrc(std::string src);
    2526
    2627        private:
  • code/branches/network/src/orxonox/objects/WorldEntity.cc

    r974 r977  
    190190
    191191        XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, loading);
     192       
     193        //create();
    192194    }
    193195
Note: See TracChangeset for help on using the changeset viewer.