Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 21, 2009, 1:18:36 PM (15 years ago)
Author:
rgrieder
Message:

Found some non empty new lines.

Location:
code/branches/presentation2/src
Files:
130 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/external/ceguilua/CMakeLists.txt

    r5929 r6387  
    4545      BREAK() # _version > CEGUI_VERSION
    4646    ENDIF()
    47  
     47
    4848    ADD_SUBDIRECTORY(ceguilua-${_version}) # Sets parent scope variable _package_files
    4949    FOREACH(_file ${_package_files})
  • code/branches/presentation2/src/external/ceguilua/ceguilua-0.5.0/CMakeLists.txt

    r5781 r6387  
    2020  elements/TabButton.pkg elements/TabControl.pkg elements/Thumb.pkg
    2121  elements/Titlebar.pkg elements/Tooltip.pkg
    22  
     22
    2323  falagard/Dimension.pkg falagard/Enums.pkg falagard/FalagardComponentBase.pkg
    2424  falagard/FrameComponent.pkg falagard/ImageryComponent.pkg
  • code/branches/presentation2/src/libraries/core/BaseObject.cc

    r5929 r6387  
    119119        XMLPortObjectTemplate(BaseObject, Template, "templates", addTemplate, getTemplate, xmlelement, mode, Template*);
    120120        XMLPortObject(BaseObject, BaseObject, "eventlisteners", addEventListener, getEventListener, xmlelement, mode);
    121        
     121
    122122        Element* events = 0;
    123123        if (mode == XMLPort::LoadObject || mode == XMLPort::ExpandObject)
     
    139139        XMLPortEventState(BaseObject, BaseObject, "visibility", setVisible, xmlelement, mode);
    140140        XMLPortEventState(BaseObject, BaseObject, "mainstate", setMainState, xmlelement, mode);
    141        
     141
    142142        this->bRegisteredEventStates_ = true;
    143143    }
     
    236236            if (it->second != state)
    237237                continue;
    238            
     238
    239239            if (i == index)
    240240                return it->first;
     
    252252        listener->addEventSource(this, "mainstate");
    253253    }
    254    
     254
    255255    /**
    256256        @brief Returns an event listener with a given index.
     
    344344    {
    345345        this->registerEventStates();
    346        
     346
    347347        std::map<std::string, EventState*>::const_iterator it = this->eventStates_.find(event.statename_);
    348348        if (it != this->eventStates_.end())
     
    356356    /**
    357357        @brief Sets the main state of the object to a given boolean value.
    358        
     358
    359359        Note: The main state of an object can be set with the @ref setMainStateName function.
    360360        It's part of the eventsystem and used for event forwarding (when the target object can't specify a specific state,
     
    389389        {
    390390            this->registerEventStates();
    391            
     391
    392392            std::map<std::string, EventState*>::const_iterator it = this->eventStates_.find(this->mainStateName_);
    393393            if (it != this->eventStates_.end() && it->second->getFunctor())
     
    402402        }
    403403    }
    404    
     404
    405405    /**
    406406        @brief Calls XMLEventPort with an empty XML-element to register the event states if necessary.
     
    414414        }
    415415    }
    416    
     416
    417417    /**
    418418        @brief Manually loads all event states, even if the class doesn't officially support them. This is needed by some classes like @ref EventDispatcher or @ref EventTarget.
  • code/branches/presentation2/src/libraries/core/BaseObject.h

    r5929 r6387  
    157157            void removeEventSource(BaseObject* source);
    158158            BaseObject* getEventSource(unsigned int index, const std::string& state) const;
    159            
     159
    160160            void addEventListener(BaseObject* listener);
    161161            BaseObject* getEventListener(unsigned int index) const;
     
    172172            /** @brief Returns the indentation of the debug output in the Loader. @return The indentation */
    173173            inline const std::string& getLoaderIndentation() const { return this->loaderIndentation_; }
    174            
     174
    175175            static void loadAllEventStates(Element& xmlelement, XMLPort::Mode mode, BaseObject* object, Identifier* identifier);
    176176
     
    210210            Gametype*              oldGametype_;
    211211            std::set<Template*>    templates_;
    212            
     212
    213213            std::map<BaseObject*, std::string>  eventSources_;           //!< List of objects which send events to this object, mapped to the state which they affect
    214214            std::set<BaseObject*>               eventListeners_;         //!< List of objects which listen to the events of this object
  • code/branches/presentation2/src/libraries/core/ConfigFileManager.cc

    r6197 r6387  
    5757        return false;
    5858    }
    59    
     59
    6060    std::string getConfig(const std::string& classname, const std::string& varname)
    6161    {
  • code/branches/presentation2/src/libraries/core/Event.cc

    r5929 r6387  
    4545    /**
    4646        @brief Processes an event (calls the set-function if the necessary conditions are met).
    47        
     47
    4848        @param event     The fired event
    4949        @param object    The object whose state is affected by the event (only needed for debug output)
  • code/branches/presentation2/src/libraries/core/Event.h

    r5929 r6387  
    5050    /**
    5151        @brief The EventState contains information about an event state.
    52        
     52
    5353        An event state is a state of an object, which can be changed by events.
    5454        Event states are changed through functions. Possible functions headers for set event states are:
     
    5656         - boolean state:    function(bool state)
    5757         - individual state: function(bool state, SomeClass originator)
    58          
     58
    5959        Note that SomeClass may be any class deriving from BaseObject. You will not receive events from originators of other classes.
    6060        The actual class for SomeClass must be specified as the second argument of the XMLPortEventState macro.
    61        
     61
    6262        The this pointer of the affected object is hidden in the functors, because the events are processed in the BaseObject, but some
    6363        statefunctions may be from child-classes.
     
    7070
    7171            void process(const Event& event, BaseObject* object);
    72            
     72
    7373            Functor* getFunctor() const
    7474                { return this->statefunction_; }
  • code/branches/presentation2/src/libraries/core/EventIncludes.h

    r5929 r6387  
    3636/**
    3737    @brief Defines a new event state (a state of the object which can be changed by events).
    38    
     38
    3939    @param classname    The name of this class
    4040    @param subclassname Usually BaseObject - if different, only instances of this class can send events to this object
     
    6969    static orxonox::ExecutorMember<classname>* xmlgetfunctor##name = (orxonox::ExecutorMember<classname>*)&orxonox::createExecutor(orxonox::createFunctor(&classname::getEventSource), std::string( #classname ) + "::" + "getEventSource" + "(" + statename + ")")->setDefaultValue(1, statename); \
    7070    XMLPortObjectGeneric(xmlport##name, classname, orxonox::BaseObject, statename, xmlsetfunctor##name, xmlgetfunctor##name, xmlelement, mode, false, true)
    71    
     71
    7272
    7373/**
    7474    @brief Defines a new event name for a class. Named events can only have names which were defined with this macro.
    75    
     75
    7676    @param classname The name of the class
    7777    @param name      The name of the event
     
    8585#define FireEventName(classname, name) \
    8686    eventname##classname##name
    87  
     87
    8888#endif /* _EventIncludes_H__ */
  • code/branches/presentation2/src/libraries/core/GUIManager.cc

    r6367 r6387  
    6666        { GUIManager::getInstance().keyESC(); }
    6767    SetConsoleCommandShortcutExternAlias(key_esc, "keyESC");
    68    
     68
    6969    class CEGUILogger : public CEGUI::DefaultLogger
    7070    {
     
    246246        this->executeCode("keyESC()");
    247247    }
    248    
     248
    249249    void GUIManager::setBackground(const std::string& name)
    250250    {
  • code/branches/presentation2/src/libraries/core/OrxonoxClass.h

    r6348 r6387  
    149149                    this->destroy();
    150150            }
    151                
     151
    152152            /** @brief Register a weak pointer which points to this object. */
    153153            template <class T>
  • code/branches/presentation2/src/libraries/core/SmartPtr.h

    r5929 r6387  
    8484                    this->base_->decrementReferenceCount();
    8585            }
    86            
     86
    8787            inline const SmartPtr& operator=(int)
    8888            {
  • code/branches/presentation2/src/libraries/core/Thread.cc

    r5738 r6387  
    4141{
    4242    boost::posix_time::millisec THREAD_WAIT_BEFORE_DETACH(1000);
    43    
    44    
     43
     44
    4545    Thread::Thread():
    4646        executor_(0),
     
    5353        this->workerThread_ = new boost::thread( boost::bind(&Thread::threadLoop, this) );
    5454    }
    55    
     55
    5656    Thread::~Thread()
    5757    {
     
    6666        delete this->isWorkingMutex_;
    6767    }
    68    
     68
    6969    bool Thread::isWorking()
    7070    {
     
    7474      return isWorking;
    7575    }
    76    
     76
    7777    bool Thread::evaluateExecutor( Executor* executor )
    7878    {
     
    8585        return true;
    8686    }
    87    
     87
    8888    void Thread::threadLoop()
    8989    {
     
    114114        }
    115115    }
    116    
     116
    117117    void Thread::waitUntilFinished()
    118118    {
  • code/branches/presentation2/src/libraries/core/Thread.h

    r5738 r6387  
    5050    private:
    5151        void            threadLoop();
    52        
     52
    5353        Executor*       executor_;
    5454        bool            isWorking_;
  • code/branches/presentation2/src/libraries/core/ThreadPool.cc

    r5738 r6387  
    3737    {
    3838    }
    39    
     39
    4040    ThreadPool::~ThreadPool()
    4141    {
     
    4343        assert(a == 0);
    4444    }
    45    
     45
    4646    void ThreadPool::addThreads( unsigned int nr )
    4747    {
     
    8080        }
    8181    }
    82    
     82
    8383    bool ThreadPool::passFunction( Executor* executor, bool addThread )
    8484    {
     
    103103            return false;
    104104    }
    105    
     105
    106106    void ThreadPool::synchronise()
    107107    {
  • code/branches/presentation2/src/libraries/core/ThreadPool.h

    r5738 r6387  
    4141        ThreadPool();
    4242        virtual ~ThreadPool();
    43        
     43
    4444        void addThreads( unsigned int nr );
    4545        unsigned int removeThreads( unsigned int nr );
    4646        unsigned int setNrOfThreads( unsigned int nr );
    47        
     47
    4848        bool passFunction( Executor* executor, bool addThread=false );
    4949        void synchronise();
    50        
     50
    5151    private:
    5252        std::vector<Thread*> threadPool_;
    53        
     53
    5454    };
    5555}
  • code/branches/presentation2/src/libraries/core/WeakPtr.h

    r5929 r6387  
    4444    {
    4545        friend class OrxonoxClass;
    46        
     46
    4747        public:
    4848            inline WeakPtr() : pointer_(0), base_(0), callback_(0)
     
    7979                if (this->callback_)
    8080                    delete this->callback_;
    81                    
    82             }
    83            
     81
     82            }
     83
    8484            inline const WeakPtr& operator=(int)
    8585            {
     
    145145                if (other.base_)
    146146                    other.base_->unregisterWeakPtr(&other);
    147                
     147
    148148                {
    149149                    T* temp = this->pointer_;
     
    167167                WeakPtr().swap(*this);
    168168            }
    169            
     169
    170170            inline void setCallback(Functor* callback)
    171171            {
    172172                this->callback_ = callback;
    173173            }
    174            
     174
    175175            inline Functor* getFunctor() const
    176176            {
     
    186186                    (*this->callback_)();
    187187            }
    188        
     188
    189189            T* pointer_;
    190190            OrxonoxClass* base_;
  • code/branches/presentation2/src/libraries/core/input/InputManager.h

    r6278 r6387  
    8383        @brief
    8484            Loads the devices and initialises the KeyDetector and the Calibrator.
    85            
     85
    8686            If either the OIS input system and/or the keyboard could not be created,
    8787            the constructor fails with an std::exception.
     
    170170        OIS::InputManager* getOISInputManager() { return this->oisInputManager_; }
    171171        std::pair<int, int> getMousePosition() const;
    172        
     172
    173173        static InputManager& getInstance() { return Singleton<InputManager>::getInstance(); } // tolua_export
    174174
  • code/branches/presentation2/src/libraries/core/input/InputPrereqs.h

    r5781 r6387  
    202202            MediaSelect   = OIS::KC_MEDIASELECT      // Media Select
    203203        };
    204        
     204
    205205        //! Key codes as strings
    206206        const char* const ByString[] =
  • code/branches/presentation2/src/libraries/core/input/InputState.cc

    r5929 r6387  
    102102        if (enterFunctor_)
    103103            (*enterFunctor_)();
    104            
     104
    105105    }
    106106
  • code/branches/presentation2/src/libraries/core/input/KeyBinder.cc

    r6360 r6387  
    283283        }
    284284    }
    285    
     285
    286286     void KeyBinder::addButtonToCommand(std::string command, Button* button)
    287287     { 
    288288        std::ostringstream stream;
    289289        stream << button->groupName_  << "." << button->name_;
    290        
     290
    291291        std::vector<std::string>& oldKeynames = this->allCommands_[button->bindingString_];
    292292        std::vector<std::string>::iterator it = std::find(oldKeynames.begin(), oldKeynames.end(), stream.str());
     
    295295            oldKeynames.erase(it);
    296296        }
    297        
     297
    298298        if(command != "")
    299299        {
     
    305305        }
    306306     }
    307    
     307
    308308    /**
    309309    @brief
     
    317317            return keynames.front();
    318318        }
    319        
     319
    320320        return "";
    321321    }
    322    
     322
    323323    /**
    324324    @brief
     
    338338                return keynames[index];
    339339            }
    340                
     340
    341341            return "";
    342342        }
    343        
     343
    344344        return "";
    345345    }
    346    
     346
    347347    /**
    348348    @brief
     
    358358            return keynames.size();
    359359        }
    360        
     360
    361361        return 0;
    362362    }
  • code/branches/presentation2/src/libraries/core/input/KeyBinder.h

    r6311 r6387  
    6969        std::string getBinding(std::string commandName, unsigned int index); //tolua_export
    7070        unsigned int getNumberOfBindings(std::string commandName); //tolua_export
    71        
     71
    7272        const std::string& getBindingsFilename()
    7373            { return this->filename_; }
     
    161161    private:
    162162        void addButtonToCommand(std::string command, Button* button);
    163        
     163
    164164        //##### ConfigValues #####
    165165        //! Whether to filter small value analog input
  • code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc

    r6367 r6387  
    9292            this->bDefaultFileLoaded_ = false;
    9393    }
    94    
     94
    9595    inline void KeyBinderManager::unbind(const std::string& binding)
    9696    {
    9797        this->currentBinder_->setBinding("", binding, false);
    9898    }
    99            
     99
    100100    inline void KeyBinderManager::tunbind(const std::string& binding)
    101101    {
  • code/branches/presentation2/src/libraries/network/Client.cc

    r6134 r6387  
    113113    return true;
    114114  }
    115  
     115
    116116  void Client::printRTT(){
    117117    COUT(0) << "Round trip time to server is " << ClientConnection::getRTT() << " ms" << endl;
     
    155155    }
    156156    sendPackets(); // flush the enet queue
    157    
     157
    158158    Connection::processQueue();
    159159    if(gamestate.processGamestates())
     
    167167    return;
    168168  }
    169  
     169
    170170  void Client::connectionClosed()
    171171  {
  • code/branches/presentation2/src/libraries/network/ClientConnection.cc

    r5965 r6387  
    6969  {
    7070    ENetEvent event;
    71    
     71
    7272    this->host_ = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, 0, 0);
    7373    if ( this->host_ == NULL )
     
    9999  bool ClientConnection::closeConnection() {
    100100    ENetEvent event;
    101    
     101
    102102    if ( !this->established_ )
    103103      return true;
     
    146146    this->connectionClosed();
    147147  }
    148  
     148
    149149  uint32_t ClientConnection::getRTT()
    150150  {
  • code/branches/presentation2/src/libraries/network/ClientConnection.h

    r5961 r6387  
    2626 *
    2727 */
    28  
     28
    2929#ifndef _ClientConnection_H__
    3030#define _ClientConnection_H__
     
    4040    ClientConnection();
    4141    virtual ~ClientConnection();
    42    
     42
    4343    void setServerAddress( const std::string& serverAddress );
    4444    void setPort( unsigned int port );
    45    
     45
    4646    ENetEvent *getEvent();
    4747    // check wheter the packet queue is empty
     
    5959    virtual void addPeer(ENetEvent* event);
    6060    virtual void removePeer(ENetEvent* event);
    61    
     61
    6262    bool disconnectConnection();
    6363    // enet stuff
  • code/branches/presentation2/src/libraries/network/ClientConnectionListener.cc

    r5929 r6387  
    4545            it->clientConnected(clientID);
    4646    }
    47    
     47
    4848    void ClientConnectionListener::broadcastClientDisconnected(unsigned int clientID)
    4949    {
  • code/branches/presentation2/src/libraries/network/ClientConnectionListener.h

    r5929 r6387  
    4040            ClientConnectionListener();
    4141            virtual ~ClientConnectionListener() {}
    42            
     42
    4343            static void broadcastClientConnected(unsigned int clientID);
    4444            static void broadcastClientDisconnected(unsigned int clientID);
  • code/branches/presentation2/src/libraries/network/ClientInformation.cc

    r5961 r6387  
    4646namespace orxonox
    4747{
    48  
     48
    4949
    5050  ClientInformation *ClientInformation::head_=0;
  • code/branches/presentation2/src/libraries/network/Connection.cc

    r5929 r6387  
    7575  void Connection::processQueue() {
    7676    ENetEvent event;
    77    
     77
    7878    assert(this->host_);
    7979
  • code/branches/presentation2/src/libraries/network/Connection.h

    r5929 r6387  
    5454  public:
    5555    virtual ~Connection();
    56    
     56
    5757    static bool addPacket(ENetPacket *packet, ENetPeer *peer);
    5858    bool sendPackets();
     
    6262    Connection();
    6363    static Connection* getInstance(){ return Connection::instance_; }
    64    
     64
    6565    int service(ENetEvent* event);
    6666    virtual void disconnectPeer(ENetPeer *peer);
    67    
     67
    6868    void processQueue();
    6969    virtual void addPeer(ENetEvent* event)=0;
    7070    virtual void removePeer(ENetEvent* event)=0;
    7171    virtual bool processPacket(ENetEvent* event);
    72    
     72
    7373    ENetHost *host_;
    7474  private:
  • code/branches/presentation2/src/libraries/network/FunctionCallManager.cc

    r6073 r6387  
    3131
    3232namespace orxonox {
    33    
     33
    3434std::map<uint32_t, packet::FunctionCalls*> FunctionCallManager::clientMap_;
    3535
  • code/branches/presentation2/src/libraries/network/FunctionCallManager.h

    r6073 r6387  
    4949  static void addCallStatic(uint32_t functionID, uint32_t clientID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4);
    5050  static void addCallStatic(uint32_t functionID, uint32_t clientID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5);
    51  
     51
    5252  static void addCallMember(uint32_t functionID, uint32_t objectID, uint32_t clientID);
    5353  static void addCallMember(uint32_t functionID, uint32_t objectID, uint32_t clientID, const MultiType& mt1);
     
    5656  static void addCallMember(uint32_t functionID, uint32_t objectID, uint32_t clientID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4);
    5757  static void addCallMember(uint32_t functionID, uint32_t objectID, uint32_t clientID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5);
    58  
     58
    5959  static void sendCalls();
    60  
     60
    6161  static std::map<uint32_t, packet::FunctionCalls*> clientMap_;
    6262protected:
  • code/branches/presentation2/src/libraries/network/GamestateClient.cc

    r5929 r6387  
    8181    packet::Gamestate *processed = processGamestate(tempGamestate_);
    8282    assert(processed);
    83    
     83
    8484    //now call the queued callbacks
    8585    NetworkCallbackManager::callCallbacks();
    86    
     86
    8787    if (!processed){
    8888      sendAck(0);
  • code/branches/presentation2/src/libraries/network/GamestateHandler.cc

    r5781 r6387  
    3333
    3434GamestateHandler *GamestateHandler::instance_=0;
    35  
     35
    3636GamestateHandler::GamestateHandler()
    3737{
  • code/branches/presentation2/src/libraries/network/GamestateManager.cc

    r5929 r6387  
    126126    return true;
    127127  }
    128  
     128
    129129  void GamestateManager::sendGamestates()
    130130  {
     
    142142      COUT(5) << "Server: doing gamestate gamestate preparation" << std::endl;
    143143      int cid = temp->getID(); //get client id
    144      
     144
    145145      unsigned int gID = temp->getGamestateID();
    146146      if(!reference)
    147147        return;
    148      
     148
    149149      packet::Gamestate *client=0;
    150150      if(gID != GAMESTATEID_INITIAL){
     
    156156        }
    157157      }
    158      
     158
    159159      clientGamestates.push(0);
    160160      finishGamestate( cid, &clientGamestates.back(), client, reference );
     
    165165//       this->threadPool_->passFunction( executor, true );
    166166//       (*functor)( cid, &(clientGamestates.back()), client, reference );
    167      
     167
    168168      temp = temp->next();
    169169    }
    170    
     170
    171171//     threadPool_->synchronise();
    172    
     172
    173173    while( !clientGamestates.empty() )
    174174    {
     
    185185    // save the (undiffed) gamestate in the clients gamestate map
    186186    //chose wheather the next gamestate is the first or not
    187    
     187
    188188    packet::Gamestate *gs = gamestate->doSelection(clientID, 20000);
    189189//     packet::Gamestate *gs = new packet::Gamestate(*gamestate);
     
    193193    gamestateMap_[clientID][gamestate->getID()]=gs;
    194194//     this->threadMutex_->unlock();
    195    
     195
    196196    if(base)
    197197    {
    198        
     198
    199199//       COUT(3) << "diffing" << std::endl;
    200200//       packet::Gamestate* gs1  = gs;
     
    210210      gs = new packet::Gamestate(*gs);
    211211    }
    212    
    213    
     212
     213
    214214    bool b = gs->compressData();
    215215    assert(b);
  • code/branches/presentation2/src/libraries/network/NetworkFunction.cc

    r6160 r6387  
    3333{
    3434  std::map<uint32_t, bool> NetworkFunctionBase::isStaticMap_;
    35      
     35
    3636  std::map<NetworkFunctionPointer, NetworkMemberFunctionBase*> NetworkMemberFunctionBase::functorMap_;
    3737  std::map<uint32_t, NetworkMemberFunctionBase*> NetworkMemberFunctionBase::idMap_;
     
    4040  {
    4141    RegisterRootObject(NetworkFunctionBase);
    42    
     42
    4343    static uint32_t networkID = 0;
    4444    this->networkID_ = networkID++;
    45    
     45
    4646    this->name_ = name;
    4747    NetworkFunctionBase::getNameMap()[name] = this;
     
    5050  {
    5151  }
    52  
    53  
     52
     53
    5454  void NetworkFunctionBase::destroyAllNetworkFunctions()
    5555  {
     
    5959      it->second->destroy();
    6060  }
    61  
    62  
     61
     62
    6363  /*static*/ std::map<std::string, NetworkFunctionBase*>& NetworkFunctionBase::getNameMap()
    6464  {
     
    6666    return nameMap_;
    6767  }
    68  
    69  
     68
     69
    7070  NetworkFunctionStatic::NetworkFunctionStatic(FunctorStatic* functor, const std::string& name, const NetworkFunctionPointer& p):
    7171    NetworkFunctionBase(name)
    7272  {
    7373    RegisterObject(NetworkFunctionStatic);
    74    
     74
    7575    this->functor_ = functor;
    7676    NetworkFunctionStatic::getFunctorMap()[p] = this;
    7777    NetworkFunctionStatic::getIdMap()[ this->getNetworkID() ] = this;
    7878  }
    79  
     79
    8080  NetworkFunctionStatic::~NetworkFunctionStatic()
    8181  {
    8282    delete this->functor_;
    8383  }
    84  
     84
    8585  /*static*/ std::map<NetworkFunctionPointer, NetworkFunctionStatic*>& NetworkFunctionStatic::getFunctorMap()
    8686  {
     
    8888    return functorMap_;
    8989  }
    90  
     90
    9191  /*static*/ std::map<uint32_t, NetworkFunctionStatic*>& NetworkFunctionStatic::getIdMap()
    9292  {
     
    9494    return idMap_;
    9595  }
    96  
    97  
     96
     97
    9898  NetworkMemberFunctionBase::NetworkMemberFunctionBase(const std::string& name, const NetworkFunctionPointer& p):
    9999    NetworkFunctionBase(name)
    100100  {
    101101    RegisterObject(NetworkMemberFunctionBase);
    102    
     102
    103103    this->functorMap_[p] = this;
    104104    this->idMap_[ this->getNetworkID() ] = this;
    105105  }
    106  
     106
    107107  NetworkMemberFunctionBase::~NetworkMemberFunctionBase()
    108108  {
    109109  }
    110  
     110
    111111
    112112}
  • code/branches/presentation2/src/libraries/network/NetworkFunction.h

    r6160 r6387  
    7474    NetworkFunctionBase(const std::string& name);
    7575    ~NetworkFunctionBase();
    76    
     76
    7777    virtual void        setNetworkID(uint32_t id)       { this->networkID_ = id; }
    7878    inline uint32_t     getNetworkID() const            { return this->networkID_; }
    7979    inline const std::string& getName() const           { return name_; }
    8080    static inline bool  isStatic( uint32_t networkID )  { return isStaticMap_[networkID]; }
    81    
     81
    8282    static inline void setNetworkID(const std::string& name, uint32_t id)
    8383    {
     
    8686        map[name]->setNetworkID(id);
    8787    }
    88    
     88
    8989    static void destroyAllNetworkFunctions();
    90    
     90
    9191  protected:
    9292    static std::map<uint32_t, bool> isStaticMap_;
    93    
     93
    9494  private:
    9595    static std::map<std::string, NetworkFunctionBase*>& getNameMap();
    9696    uint32_t networkID_;
    9797    std::string name_;
    98      
     98
    9999};
    100100
     
    104104    NetworkFunctionStatic(FunctorStatic* functor, const std::string& name, const NetworkFunctionPointer& p);
    105105    ~NetworkFunctionStatic();
    106    
     106
    107107    inline void call(){ (*this->functor_)(); }
    108108    inline void call(const MultiType& mt1){ (*this->functor_)(mt1); }
     
    111111    inline void call(const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4){ (*this->functor_)(mt1, mt2, mt3, mt4); }
    112112    inline void call(const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5){ (*this->functor_)(mt1, mt2, mt3, mt4, mt5); }
    113    
     113
    114114    virtual void setNetworkID( uint32_t id )
    115115        { NetworkFunctionBase::setNetworkID( id ); NetworkFunctionStatic::getIdMap()[id] = this; }
     
    120120    static NetworkFunctionStatic* getFunction( const NetworkFunctionPointer& p )
    121121        { assert( NetworkFunctionStatic::getFunctorMap().find(p) != NetworkFunctionStatic::getFunctorMap().end() ); return NetworkFunctionStatic::getFunctorMap()[p]; }
    122        
     122
    123123  private:
    124124    static std::map<NetworkFunctionPointer, NetworkFunctionStatic*>& getFunctorMap();
    125125    static std::map<uint32_t, NetworkFunctionStatic*>& getIdMap();
    126126    FunctorStatic* functor_;
    127    
     127
    128128};
    129129
     
    133133    NetworkMemberFunctionBase(const std::string& name, const NetworkFunctionPointer& p);
    134134    ~NetworkMemberFunctionBase();
    135    
     135
    136136    virtual void setNetworkID( uint32_t id ){ NetworkFunctionBase::setNetworkID( id ); idMap_[id] = this; }
    137137    static inline NetworkMemberFunctionBase* getNetworkFunction( uint32_t id){ assert( idMap_.find(id)!=idMap_.end() ); return idMap_[id]; }
    138138    static NetworkMemberFunctionBase* getFunction( uint32_t id ){ assert( idMap_.find(id) != idMap_.end() ); return idMap_[id]; }
    139139    static NetworkMemberFunctionBase* getFunction( const NetworkFunctionPointer& p ){ assert( functorMap_.find(p) != functorMap_.end() ); return functorMap_[p]; }
    140    
     140
    141141    //
    142142    virtual void call(uint32_t objectID)=0;
     
    146146    virtual void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4)=0;
    147147    virtual void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5)=0;
    148    
     148
    149149  private:
    150150    static std::map<NetworkFunctionPointer, NetworkMemberFunctionBase*> functorMap_;
     
    157157    NetworkMemberFunction(FunctorMember<T>* functor, const std::string& name, const NetworkFunctionPointer& p);
    158158    ~NetworkMemberFunction();
    159    
     159
    160160    inline void call(uint32_t objectID)
    161161    {
     
    188188        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4, mt5);
    189189    }
    190    
     190
    191191  private:
    192192    FunctorMember<T>* functor_;
  • code/branches/presentation2/src/libraries/network/Server.cc

    r5961 r6387  
    137137    // receive incoming packets
    138138    Connection::processQueue();
    139    
     139
    140140    if ( ClientInformation::hasClients() )
    141141    {
    142142      // process incoming gamestates
    143143      GamestateManager::processGamestates();
    144      
     144
    145145      // send function calls to clients
    146146      FunctionCallManager::sendCalls();
    147      
     147
    148148      //this steers our network frequency
    149149      timeSinceLastUpdate_+=time.getDeltaTime();
     
    160160    return ServerConnection::addPacket(packet, clientID);
    161161  }
    162  
     162
    163163  /**
    164164   * @brief: returns ping time to client in milliseconds
     
    168168    return ClientInformation::findClient(clientID)->getRTT();
    169169  }
    170  
     170
    171171  void Server::printRTT()
    172172  {
     
    317317    }
    318318    COUT(5) << "Con.Man: creating client id: " << temp->getID() << std::endl;
    319    
     319
    320320    // synchronise class ids
    321321    syncClassid(temp->getID());
    322    
     322
    323323    // now synchronise functionIDs
    324324    packet::FunctionIDs *fIDs = new packet::FunctionIDs();
     
    326326    bool b = fIDs->send();
    327327    assert(b);
    328    
     328
    329329    temp->setSynched(true);
    330330    COUT(4) << "sending welcome" << std::endl;
     
    344344    return true;
    345345  }
    346  
     346
    347347  void Server::disconnectClient( ClientInformation *client ){
    348348    ServerConnection::disconnectClient( client );
  • code/branches/presentation2/src/libraries/network/Server.h

    r5961 r6387  
    6666    unsigned int shipID(){return 0;}
    6767    unsigned int playerID(){return 0;}
    68    
     68
    6969    void addPeer(ENetEvent *event);
    7070    void removePeer(ENetEvent *event);
    71    
     71
    7272    bool createClient(int clientID);
    7373    void disconnectClient( ClientInformation *client);
  • code/branches/presentation2/src/libraries/network/ServerConnection.cc

    r5929 r6387  
    9999    return true;
    100100  }
    101  
     101
    102102  void ServerConnection::disconnectClient(ClientInformation *client)
    103103  {
    104104    Connection::disconnectPeer( client->getPeer() );
    105105  }
    106  
     106
    107107  void ServerConnection::disconnectClient(int clientID){
    108108    ClientInformation *client = ClientInformation::findClient(clientID);
  • code/branches/presentation2/src/libraries/network/ServerConnection.h

    r5929 r6387  
    5050  public:
    5151    ~ServerConnection();
    52    
     52
    5353    void setBindAddress( const std::string& bindAddress );
    5454    void setPort( unsigned int port );
    55    
     55
    5656    bool openListener();
    5757    bool closeListener();
  • code/branches/presentation2/src/libraries/network/TrafficControl.cc

    r6073 r6387  
    145145    assert(clientListPerm_.find(clientID) != clientListPerm_.end() );
    146146    assert( clientListTemp_[clientID].find(gamestateID) != clientListTemp_[clientID].end() );
    147    
     147
    148148    // shortcut for maps
    149149    std::map<unsigned int, objInfo >& objectListPerm = clientListPerm_[clientID];
     
    236236      //if listToProcess contains new Objects, add them to clientListPerm
    237237      std::list<obj>::iterator itvec;
    238    
     238
    239239      std::map<unsigned int, objInfo >& objectListPerm = clientListPerm_[clientID];
    240    
     240
    241241      for( itvec=list.begin(); itvec != list.end(); itvec++)
    242242      {
     
    256256      }
    257257    //end compare listToProcess vs clientListPerm
    258      
     258
    259259      //sort copied list according to priorities
    260260      // use boost bind here because we need to pass a memberfunction to stl sort
    261261//       sort( list.begin(), list.end(), boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
    262262      list.sort( boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
    263      
     263
    264264//       list.sort(boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
    265265
     
    277277//       sort(list.begin(), list.end(), boost::bind(&TrafficControl::dataSort, this, _1, _2) );
    278278      list.sort( boost::bind(&TrafficControl::dataSort, this, _1, _2) );
    279      
     279
    280280      //diese Funktion updateClientList muss noch gemacht werden
    281281      updateClientListTemp(list);
  • code/branches/presentation2/src/libraries/network/TrafficControl.h

    r6073 r6387  
    6969      obj( uint32_t ID, uint32_t creatorID, uint32_t size, uint32_t offset );
    7070  };
    71  
     71
    7272
    7373
     
    9797    unsigned int targetSize;
    9898    bool         bActive_;
    99    
     99
    100100    void insertinClientListPerm(unsigned int clientID, obj objinf);
    101    
     101
    102102    void cut(std::list<obj>& list, unsigned int targetsize);
    103103    void updateClientListTemp(std::list<obj>& list);//done
     
    107107    void evaluateList(unsigned int clientID, std::list<obj>& list);//done   
    108108    void ack(unsigned int clientID, unsigned int gamestateID);  // this function gets called when the server receives an ack from the client
    109    
     109
    110110    //ClientConnectionListener functions
    111111    virtual void clientConnected(unsigned int clientID){};
    112112    virtual void clientDisconnected(unsigned int clientID);
    113113
    114  
     114
    115115  protected:
    116116    static TrafficControl *instance_;
     
    131131    { return instance_->ack(clientID, gamestateID); }
    132132    void deleteObject(unsigned int objectID);               // this function gets called when an object has been deleted (in order to clean up lists and maps)
    133    
     133
    134134    bool prioritySort(uint32_t clientID, obj i, obj j);
    135135    bool dataSort(obj i, obj j);
  • code/branches/presentation2/src/libraries/network/packet/Acknowledgement.cc

    r5781 r6387  
    3838#define _PACKETID           0
    3939#define _ACKID              _PACKETID + sizeof(packet::Type::Value)
    40  
     40
    4141Acknowledgement::Acknowledgement( unsigned int id, unsigned int clientID )
    4242 : Packet()
  • code/branches/presentation2/src/libraries/network/packet/Chat.cc

    r5781 r6387  
    3535namespace orxonox {
    3636namespace packet {
    37  
     37
    3838#define   PACKET_FLAGS_CHAT PacketFlag::Reliable
    3939#define   _PACKETID         0
  • code/branches/presentation2/src/libraries/network/packet/ClassID.h

    r6073 r6387  
    3636namespace packet {
    3737
    38  
     38
    3939/**
    4040    @author
  • code/branches/presentation2/src/libraries/network/packet/DeleteObjects.cc

    r6192 r6387  
    4141#define _QUANTITY           _PACKETID + sizeof(Type::Value)
    4242#define _OBJECTIDS          _QUANTITY + sizeof(uint32_t)
    43  
     43
    4444DeleteObjects::DeleteObjects()
    4545 : Packet()
  • code/branches/presentation2/src/libraries/network/packet/FunctionCalls.cc

    r5781 r6387  
    3636namespace orxonox {
    3737namespace packet {
    38  
     38
    3939#define   PACKET_FLAGS_FUNCTIONCALLS PacketFlag::Reliable
    4040#define   _PACKETID         0
    4141const unsigned int FUNCTIONCALLS_MEM_ALLOCATION = 1000;
    42    
     42
    4343FunctionCalls::FunctionCalls()
    4444 : Packet()
     
    171171void FunctionCalls::addCallStatic( uint32_t networkID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5){
    172172  assert(!isDataENetAllocated());
    173  
     173
    174174  // first determine the size that has to be reserved for this call
    175175  uint32_t callsize = 2*sizeof(uint32_t)+sizeof(uint8_t); //size for network-function-id and nrOfArguments and for bool isStatic
     
    200200    }
    201201  }
    202  
     202
    203203  // now allocated mem if neccessary
    204204  if( currentSize_ + callsize > currentMemBlocks_*FUNCTIONCALLS_MEM_ALLOCATION )
     
    210210    data_ = temp;
    211211  }
    212  
     212
    213213  // now serialise the mt values and copy the function id and isStatic
    214214  uint8_t* temp = data_+currentSize_;
     
    240240  //currentSize_ += callsize;
    241241  currentSize_ = temp-data_;
    242  
     242
    243243}
    244244
    245245void FunctionCalls::addCallMember( uint32_t networkID, uint32_t objectID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5){
    246246  assert(!isDataENetAllocated());
    247  
     247
    248248  // first determine the size that has to be reserved for this call
    249249  uint32_t callsize = 3*sizeof(uint32_t)+sizeof(uint8_t); //size for network-function-id and nrOfArguments and the objectID
     
    274274    }
    275275  }
    276  
     276
    277277  // now allocated mem if neccessary
    278278  if( currentSize_ + callsize > currentMemBlocks_*FUNCTIONCALLS_MEM_ALLOCATION )
     
    284284    data_ = temp;
    285285  }
    286  
     286
    287287  // now serialise the mt values and copy the function id
    288288  uint8_t* temp = data_+currentSize_;
     
    314314  }
    315315  currentSize_ += callsize;
    316  
     316
    317317}
    318318
  • code/branches/presentation2/src/libraries/network/packet/FunctionIDs.cc

    r5781 r6387  
    5353  flags_ = flags_ | PACKET_FLAGS_FUNCTIONIDS;
    5454  std::queue<std::pair<uint32_t, std::string> > tempQueue;
    55  
     55
    5656  //calculate total needed size (for all strings and integers)
    5757  ObjectList<NetworkFunctionBase>::iterator it;
     
    6464    packetSize += (functionname.size()+1)+sizeof(uint32_t)+sizeof(uint32_t); // reserver size for the functionname string, the functionname length and the networkID
    6565  }
    66  
     66
    6767  this->data_=new uint8_t[ packetSize ];
    6868  //set the appropriate packet id
    6969  assert(this->data_);
    7070  *(Type::Value *)(this->data_ + _PACKETID ) = Type::FunctionIDs;
    71  
     71
    7272  uint8_t *temp=data_+sizeof(uint32_t);
    7373  // save the number of all classes
    7474  *(uint32_t*)temp = nrOfFunctions;
    7575  temp += sizeof(uint32_t);
    76  
     76
    7777  // now save all classids and classnames
    7878  std::pair<uint32_t, std::string> tempPair;
     
    8585    temp+=2*sizeof(uint32_t)+tempPair.second.size()+1;
    8686  }
    87  
     87
    8888  COUT(5) << "FunctionIDs packetSize is " << packetSize << endl;
    89  
     89
    9090}
    9191
     
    106106  temp += sizeof(uint32_t);
    107107  totalsize += sizeof(uint32_t); // storage size for nr of all classes
    108  
     108
    109109  for(unsigned int i=0; i<nrOfFunctions; i++){
    110110    totalsize += 2*sizeof(uint32_t) + *(uint32_t*)(temp + sizeof(uint32_t)); // for each network function add size for id, sizeof(string) and length of string itself to totalsize
     
    121121  uint32_t stringsize;
    122122  unsigned char *functionname;
    123  
     123
    124124  COUT(4) << "=== processing functionids: " << endl;
    125125  std::pair<uint32_t, std::string> tempPair;
     
    127127  nrOfFunctions = *(uint32_t*)temp;
    128128  temp += sizeof(uint32_t);
    129  
     129
    130130  for( int i=0; i<nrOfFunctions; i++){
    131131    networkID = *(uint32_t*)temp;
  • code/branches/presentation2/src/libraries/network/packet/FunctionIDs.h

    r6073 r6387  
    3636namespace packet {
    3737
    38  
     38
    3939/**
    4040    @author
  • code/branches/presentation2/src/libraries/network/packet/Gamestate.cc

    r5929 r6387  
    9595    return false;
    9696  }
    97  
     97
    9898  // create the header object
    9999  assert( header_ == 0 );
     
    105105  ObjectList<Synchronisable>::iterator it;
    106106  for(it = ObjectList<Synchronisable>::begin(); it; ++it){
    107    
     107
    108108//     tempsize=it->getSize(id, mode);
    109109
     
    111111    if ( tempsize != 0 )
    112112      dataVector_.push_back( obj(it->getObjectID(), it->getCreatorID(), tempsize, mem-data_) );
    113    
     113
    114114#ifndef NDEBUG
    115115    if(currentsize+tempsize > size){
     
    362362  assert(!header_->isCompressed() && !base->header_->isCompressed());
    363363  assert(!header_->isDiffed());
    364  
     364
    365365  uint8_t *basep = GAMESTATE_START(base->data_);
    366366  uint8_t *gs = GAMESTATE_START(this->data_);
    367367  uint32_t dest_length = header_->getDataSize();
    368  
     368
    369369  if(dest_length==0)
    370370    return NULL;
    371  
     371
    372372  uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()];
    373373  uint8_t *dest = GAMESTATE_START(ndata);
    374  
     374
    375375  rawDiff( dest, gs, basep, header_->getDataSize(), base->header_->getDataSize() );
    376376#ifndef NDEBUG
     
    398398  assert(!header_->isCompressed() && !base->header_->isCompressed());
    399399  assert(header_->isDiffed());
    400  
     400
    401401  uint8_t *basep = GAMESTATE_START(base->data_);
    402402  uint8_t *gs = GAMESTATE_START(this->data_);
    403403  uint32_t dest_length = header_->getDataSize();
    404  
     404
    405405  if(dest_length==0)
    406406    return NULL;
    407  
     407
    408408  uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()];
    409409  uint8_t *dest = ndata + GamestateHeader::getSize();
    410  
     410
    411411  rawDiff( dest, gs, basep, header_->getDataSize(), base->header_->getDataSize() );
    412  
     412
    413413  Gamestate *g = new Gamestate(ndata, getClientID());
    414414  assert(g->header_);
     
    481481  uint64_t* bd = (uint64_t*)basedata;
    482482  uint64_t* nd = (uint64_t*)newdata;
    483  
     483
    484484  unsigned int i;
    485485  for( i=0; i<datalength/8; i++ )
  • code/branches/presentation2/src/libraries/network/packet/Packet.cc

    r6105 r6387  
    101101@brief
    102102    Destroys a packet completely.
    103    
     103
    104104    That also means destroying the ENetPacket if one exists. There
    105105*/
  • code/branches/presentation2/src/libraries/network/synchronisable/NetworkCallback.h

    r6192 r6387  
    3636
    3737namespace orxonox{
    38  
     38
    3939  struct EmptyType{};
    40  
     40
    4141  class _NetworkExport NetworkCallbackBase
    4242  {
     
    6060      void (T::*function_) (void);
    6161  };
    62  
     62
    6363  template <class T, class U>
    6464  class NetworkCallbackNotify: public NetworkCallbackBase
  • code/branches/presentation2/src/libraries/network/synchronisable/NetworkCallbackManager.cc

    r5781 r6387  
    2626 *
    2727 */
    28  
     28
    2929#include "NetworkCallbackManager.h"
    3030#include "NetworkCallback.h"
    3131
    3232namespace orxonox{
    33  
     33
    3434  std::set<NetworkCallbackBase*> NetworkCallbackManager::callbackSet_;
    3535  std::queue<NetworkCallbackBase*> NetworkCallbackManager::triggeredCallbacks_;
    36  
     36
    3737  void NetworkCallbackManager::registerCallback(NetworkCallbackBase *cb)
    3838  {
     
    4848    }
    4949  }
    50  
     50
    5151  void NetworkCallbackManager::triggerCallback(NetworkCallbackBase *cb)
    5252  {
  • code/branches/presentation2/src/libraries/network/synchronisable/NetworkCallbackManager.h

    r5781 r6387  
    3737
    3838namespace orxonox{
    39  
     39
    4040  class _NetworkExport NetworkCallbackManager{
    4141    public:
     
    4848      static std::queue<NetworkCallbackBase*> triggeredCallbacks_;
    4949  };
    50  
     50
    5151
    5252}
  • code/branches/presentation2/src/libraries/network/synchronisable/Synchronisable.cc

    r6192 r6387  
    6262    }
    6363    classID_ = static_cast<uint32_t>(-1);
    64    
     64
    6565    // set dataSize to 0
    6666    this->dataSize_ = 0;
     
    277277      //tempsize += (*i)->getSize( mode );
    278278    }
    279    
     279
    280280    tempsize += SynchronisableHeader::getSize();
    281281    header.setObjectID( this->objectID_ );
     
    284284    header.setDataAvailable( true );
    285285    header.setDataSize( tempsize );
    286    
     286
    287287#ifndef NDEBUG
    288288    uint32_t size;
  • code/branches/presentation2/src/libraries/network/synchronisable/Synchronisable.h

    r6193 r6387  
    132132    inline unsigned int getPriority() const { return this->objectFrequency_;}
    133133    inline uint8_t getSyncMode() const { return this->objectMode_; }
    134    
     134
    135135    void setSyncMode(uint8_t mode);
    136136
     
    138138    Synchronisable(BaseObject* creator);
    139139    template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false);
    140    
     140
    141141    void setPriority(unsigned int freq){ objectFrequency_ = freq; }
    142142
     
    148148    bool isMyData(uint8_t* mem);
    149149    bool doSync(int32_t id, uint8_t mode=0x0);
    150    
     150
    151151    inline void setObjectID(uint32_t id){ this->objectID_ = id; objectMap_[this->objectID_] = this; }
    152152    inline void setClassID(uint32_t id){ this->classID_ = id; }
     
    181181    }
    182182  }
    183  
     183
    184184  template <> _NetworkExport void Synchronisable::registerVariable( std::string& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional);
    185185
    186  
     186
    187187}
    188188
  • code/branches/presentation2/src/libraries/network/synchronisable/SynchronisableVariable.h

    r6192 r6387  
    4141
    4242namespace orxonox{
    43  
     43
    4444  namespace VariableDirection{
    4545    enum Value{
     
    5454    };
    5555  }
    56  
     56
    5757  class _NetworkExport SynchronisableVariableBase
    5858  {
     
    8585      NetworkCallbackBase      *callback_;
    8686  };
    87  
     87
    8888  template <class T>
    8989  class SynchronisableVariableBidirectional: public SynchronisableVariable<T>
     
    9292      SynchronisableVariableBidirectional(T& variable, uint8_t master=Bidirectionality::ServerMaster, NetworkCallbackBase *cb=0);
    9393      virtual ~SynchronisableVariableBidirectional();
    94      
     94
    9595      virtual inline uint8_t getMode(){ return 0x3; } //this basically is a hack ^^
    9696      virtual inline uint32_t getData(uint8_t*& mem, uint8_t mode);
     
    112112    }
    113113  }
    114  
     114
    115115  template <class T> SynchronisableVariable<T>::~SynchronisableVariable()
    116116  {
     
    253253      return returnSize( this->variable_ ) + sizeof(varReference_);
    254254    }
    255  
     255
    256256
    257257}
  • code/branches/presentation2/src/libraries/tools/Timer.cc

    r5929 r6387  
    112112        this->deleteExecutor();
    113113    }
    114    
     114
    115115    /**
    116116        @brief Initializes the Timer
  • code/branches/presentation2/src/libraries/tools/Timer.h

    r5929 r6387  
    140140        private:
    141141            void init();
    142        
     142
    143143            Executor* executor_;  //!< The executor of the function that should be called when the time expires
    144144
  • code/branches/presentation2/src/libraries/tools/interfaces/TimeFactorListener.h

    r6160 r6387  
    4040            TimeFactorListener();
    4141            virtual ~TimeFactorListener() {}
    42            
     42
    4343            static void setTimeFactor( float factor );
    4444            static void setTimeFactorInternal( float factor );
  • code/branches/presentation2/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc

    r6160 r6387  
    4646    //----------------------------
    4747    registerStaticNetworkFunction( &TimeFactorListener::setTimeFactorInternal );
    48    
     48
    4949    float TimeFactorListener::timefactor_s = 1.0f;
    5050
     
    6060        TimeFactorListener::setTimeFactorInternal(factor);
    6161    }
    62    
     62
    6363    /*static*/ void TimeFactorListener::setTimeFactorInternal( float factor )
    6464    {
  • code/branches/presentation2/src/libraries/util/Clock.cc

    r6319 r6387  
    4444        delete timer_;
    4545    }
    46    
     46
    4747    /**
    4848    @remarks
  • code/branches/presentation2/src/libraries/util/Math.cc

    r6137 r6387  
    138138                return orxonox::Vector2(0, 1);
    139139        }
    140        
     140
    141141        float cos_value = clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1);
    142142        float sin_value = sqrt( 1 - cos_value*cos_value );
    143        
     143
    144144        if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0)
    145145            return orxonox::Vector2( sin_value, cos_value );
     
    179179        }
    180180        //float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1));
    181        
     181
    182182        float cos_value = clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1);
    183183        float sin_value = sqrt( 1 - cos_value*cos_value );
  • code/branches/presentation2/src/libraries/util/MultiType.h

    r5738 r6387  
    232232
    233233            virtual void toString(std::ostream& outstream) const = 0;
    234            
     234
    235235            virtual void importData( uint8_t*& mem )=0;
    236236            virtual void exportData( uint8_t*& mem ) const=0;
     
    339339            template <typename T> inline bool isType()                    const { return false; } // Only works for specialized values - see below
    340340            std::string                       getTypename()               const;
    341            
     341
    342342            /** @brief Saves the value of the MT to a bytestream (pointed at by mem) and increases mem pointer by size of MT */
    343343            inline void                       exportData(uint8_t*& mem) const { assert(sizeof(MT_Type::Value)<=8); *static_cast<uint8_t*>(mem) = this->getType(); mem+=sizeof(uint8_t); this->value_->exportData(mem); }
  • code/branches/presentation2/src/libraries/util/MultiTypeValue.h

    r5738 r6387  
    150150        /** @brief Puts the current value on the stream */
    151151        inline void toString(std::ostream& outstream) const { outstream << this->value_; }
    152        
     152
    153153        /** @brief loads data from the bytestream (mem) into the MT and increases the bytestream pointer by the size of the data */
    154154        inline void importData( uint8_t*& mem )         { loadAndIncrease( /*(const T&)*/this->value_, mem ); }
     
    160160        T value_; //!< The stored value
    161161    };
    162    
     162
    163163    // Import / Export specialisation
    164164    // ColourValue
  • code/branches/presentation2/src/libraries/util/Serialise.h

    r6320 r6387  
    4040
    4141namespace orxonox{
    42    
     42
    4343    /** @brief returns the size of the variable in a datastream */
    4444    template <class T> inline uint32_t returnSize( const T& variable );
     
    202202        return sizeof(uint32_t);
    203203    }
    204    
     204
    205205    template <> inline void loadAndIncrease( const unsigned int& variable, uint8_t*& mem )
    206206    {
     
    470470        return variable==Degree(*r);
    471471    }
    472    
     472
    473473    // =========== Vector2
    474474
     
    494494        return checkEquality(variable.x, mem) && checkEquality(variable.y, mem+returnSize(variable.x));
    495495    }
    496    
     496
    497497    // =========== Vector3
    498498
     
    521521            checkEquality(variable.z, mem+returnSize(variable.x)+returnSize(variable.y));
    522522    }
    523    
     523
    524524    // =========== Vector4
    525525
     
    551551            checkEquality(variable.z, mem+returnSize(variable.w)+returnSize(variable.x)+returnSize(variable.y));
    552552    }
    553    
     553
    554554    // =========== Quaternion
    555555
     
    581581            checkEquality(variable.z, mem+returnSize(variable.w)+returnSize(variable.x)+returnSize(variable.y));
    582582    }
    583    
     583
    584584    // =========== ColourValue
    585585
     
    611611            checkEquality(variable.a, mem+returnSize(variable.r)+returnSize(variable.g)+returnSize(variable.b));
    612612    }
    613    
     613
    614614    // =========== mbool
    615615
  • code/branches/presentation2/src/libraries/util/mbool.h

    r5738 r6387  
    6767            inline bool operator!() const
    6868                { return (!this->value_.bool_); }
    69            
     69
    7070            inline unsigned char& getMemory(){ return value_.memory_; }
    7171
  • code/branches/presentation2/src/modules/objects/eventsystem/EventTarget.cc

    r5929 r6387  
    4545    {
    4646    }
    47    
     47
    4848    void EventTarget::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    4949    {
     
    7272    {
    7373        this->target_ = name;
    74        
     74
    7575        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    7676            if (it->getName() == this->target_)
  • code/branches/presentation2/src/modules/objects/eventsystem/EventTarget.h

    r5929 r6387  
    4242            EventTarget(BaseObject* creator);
    4343            virtual ~EventTarget();
    44            
     44
    4545            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    46            
     46
    4747            virtual void processEvent(Event& event);
    4848
     
    5454            virtual void loadedNewXMLName(BaseObject* object);
    5555            void addEventTarget(BaseObject* object);
    56            
     56
    5757            std::string target_;
    5858            bool bActive_;
  • code/branches/presentation2/src/modules/overlays/GUIOverlay.cc

    r6150 r6387  
    6262    {
    6363        SUPER(GUIOverlay, changedVisibility);
    64        
     64
    6565        //Setting player now.
    6666        if( this->getOwner() )
  • code/branches/presentation2/src/modules/overlays/hud/UnderAttackHealthBar.cc

    r6054 r6387  
    9494        }
    9595    }
    96    
     96
    9797    void UnderAttackHealthBar::changedOverlayGroup()
    9898    {
    9999        SUPER(UnderAttackHealthBar, changedOverlayGroup);
    100        
     100
    101101        this->getOverlayGroup()->addElement(this->text_.get());
    102102    }
  • code/branches/presentation2/src/modules/overlays/stats/CreateLines.cc

    r5980 r6387  
    9494        this->background_->changedVisibility();
    9595    }
    96    
     96
    9797    void CreateLines::setOverlayGroup( OverlayGroup* group )
    9898    {
  • code/branches/presentation2/src/modules/pong/Pong.cc

    r5929 r6387  
    4242    CreateEventName(PongCenterpoint, right);
    4343    CreateEventName(PongCenterpoint, left);
    44    
     44
    4545    CreateUnloadableFactory(Pong);
    4646
     
    164164            else if (player == this->getLeftPlayer())
    165165                this->center_->fireEvent(FireEventName(PongCenterpoint, left));
    166            
     166
    167167            if (player)
    168168                this->gtinfo_->sendAnnounceMessage(player->getName() + " scored");
  • code/branches/presentation2/src/modules/pong/PongAI.cc

    r5929 r6387  
    131131                this->bOscillationAvoidanceActive_ = false;
    132132            }
    133            
     133
    134134            // If the ball is close enough, calculate another random offset to accelerate the ball
    135135            if (!this->bChangedRandomOffset_)
     
    206206            // calculate the time until the ball reaches the other side
    207207            float totaltime = (-position.x + dimension.x / 2 * sgn(velocity.x)) / velocity.x;
    208            
     208
    209209            // calculate wall bounce position (four possible solutions of the equation: pos.z + vel.z*t + acc.z/2*t^2 = +/- dim.z/2)
    210210            float bouncetime = totaltime;
    211211            bool bUpperWall = false;
    212            
     212
    213213            if (acceleration.z == 0)
    214214            {
     
    270270                // ball bounces after <bouncetime> seconds, update the position and continue
    271271                velocity.z = velocity.z + acceleration.z * bouncetime;
    272                
     272
    273273                if (bUpperWall)
    274274                {
     
    281281                    velocity.z = fabs(velocity.z) - fabs(randomErrorZ);
    282282                }
    283                    
     283
    284284                position.x = position.x + velocity.x * bouncetime + randomErrorX;
    285285                this->ballEndPosition_ = position.z;
  • code/branches/presentation2/src/modules/pong/PongBall.cc

    r5929 r6387  
    105105                        velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
    106106                        acceleration = this->bat_[1]->getVelocity() * this->accelerationFactor_ * -1;
    107                        
     107
    108108                        this->fireEvent();
    109109                    }
  • code/branches/presentation2/src/modules/questsystem/AddQuestHint.cc

    r5781 r6387  
    7171
    7272        XMLPortParam(AddQuestHint, "hintId", setHintId, getHintId, xmlelement, mode);
    73        
     73
    7474        COUT(3) << "New AddQuestHint, with target QuestHint {" << this->getHintId() << "}, created." << std::endl;
    7575    }
     
    9090            return false;
    9191        }
    92        
     92
    9393        this->hintId_ = id;
    9494        return true;
  • code/branches/presentation2/src/modules/questsystem/AddReward.cc

    r5781 r6387  
    6767
    6868        XMLPortObject(AddReward, Rewardable, "", addRewardable, getRewardables, xmlelement, mode);
    69        
     69
    7070        COUT(3) << "New AddReward, with " << this->rewards_.size() << " Rewardables created." << std::endl;
    7171    }
     
    104104    {
    105105        COUT(3) << "AddReward on player: " << player << " ." << std::endl;
    106        
     106
    107107        bool check = true;
    108108        for ( std::list<Rewardable*>::iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward )
     
    110110            check = check && (*reward)->reward(player);
    111111        }
    112        
     112
    113113        COUT(3) << "Rewardable successfully added to player." << player << " ." << std::endl;
    114114
  • code/branches/presentation2/src/modules/questsystem/ChangeQuestStatus.cc

    r5781 r6387  
    8383            return false;
    8484        }
    85        
     85
    8686        this->questId_ = id;
    8787        return true;
  • code/branches/presentation2/src/modules/questsystem/CompleteQuest.cc

    r5781 r6387  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    6767    {
    6868        SUPER(CompleteQuest, XMLPort, xmlelement, mode);
    69        
     69
    7070        COUT(3) << "New CompleteQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
    7171    }
  • code/branches/presentation2/src/modules/questsystem/FailQuest.cc

    r5781 r6387  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    6767    {
    6868        SUPER(FailQuest, XMLPort, xmlelement, mode);
    69        
     69
    7070        COUT(3) << "New FailQUest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
    7171    }
     
    103103            return false;
    104104        }
    105        
     105
    106106        COUT(3) << "Quest {" << quest->getId() << "} failed by player: " << player << " ." << std::endl;
    107107        return true;
  • code/branches/presentation2/src/modules/questsystem/GlobalQuest.cc

    r5781 r6387  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    5959
    6060    }
    61    
     61
    6262    /**
    6363    @brief
     
    6767    {
    6868        SUPER(GlobalQuest, XMLPort, xmlelement, mode);
    69        
     69
    7070        XMLPortObject(GlobalQuest, QuestEffect, "reward-effects", addRewardEffect, getRewardEffects, xmlelement, mode);
    7171
    7272        COUT(3) << "New GlobalQuest {" << this->getId() << "} created." << std::endl;
    7373    }
    74    
     74
    7575    /**
    7676    @brief
     
    8989            return false;
    9090        }
    91        
     91
    9292        Quest::fail(player);
    93    
     93
    9494    //! Iterate through all players possessing this Quest.
    9595    for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
     
    118118            return false;
    119119        }
    120        
     120
    121121        //! Iterate through all players possessing the Quest.
    122122        for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
     
    124124            QuestEffect::invokeEffects(*it, this->getCompleteEffectList());
    125125        }
    126    
     126
    127127        Quest::complete(player);
    128    
     128
    129129        QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest.
    130130        return true;
     
    230230            this->players_.insert(player); //!< Add the player to the set.
    231231        }
    232        
     232
    233233        this->status_ = status; //!< Set the status, which is global, remember...?
    234234        return true;
    235235    }
    236    
     236
    237237    /**
    238238    @brief
     
    256256        return true;
    257257    }
    258    
     258
    259259    /**
    260260    @brief
  • code/branches/presentation2/src/modules/questsystem/LocalQuest.cc

    r5781 r6387  
    8787            return false;
    8888        }
    89        
     89
    9090        Quest::fail(player);
    91        
     91
    9292        QuestEffect::invokeEffects(player, this->getFailEffectList()); //!< Invoke the failEffects.
    9393        return true;
     
    110110            return false;
    111111        }
    112        
     112
    113113        Quest::complete(player);
    114        
     114
    115115        QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects.
    116116        return true;
     
    188188            return it->second;
    189189        }
    190        
     190
    191191        return QuestStatus::Inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'.
    192192    }
     
    209209            return false;
    210210        }
    211        
     211
    212212        this->playerStatus_[player] = status;
    213213        return true;
  • code/branches/presentation2/src/modules/questsystem/Quest.cc

    r5781 r6387  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    204204    {
    205205        int i = index;
    206        
     206
    207207        //! Iterate through all subquests.
    208208        for (std::list<Quest*>::const_iterator subQuest = this->subQuests_.begin(); subQuest != this->subQuests_.end(); ++subQuest)
     
    214214            i--;
    215215        }
    216        
     216
    217217        return NULL; //!< If the index is greater than the number of elements in the list.
    218218    }
     
    229229    {
    230230        int i = index;
    231        
     231
    232232        //! Iterate through all QuestHints.
    233233        for (std::list<QuestHint*>::const_iterator hint = this->hints_.begin(); hint != this->hints_.end(); ++hint)
     
    253253    {
    254254        int i = index;
    255        
     255
    256256        //! Iterate through all fail QuestEffects.
    257257        for (std::list<QuestEffect*>::const_iterator effect = this->failEffects_.begin(); effect != this->failEffects_.end(); ++effect)
     
    277277    {
    278278        int i = index;
    279        
     279
    280280        //! Iterate through all complete QuestEffects.
    281281        for (std::list<QuestEffect*>::const_iterator effect = this->completeEffects_.begin(); effect != this->completeEffects_.end(); ++effect)
     
    350350        return this->getStatus(player) == QuestStatus::Completed;
    351351    }
    352    
     352
    353353    /**
    354354    @brief
     
    363363        QuestListener::advertiseStatusChange(this->listeners_, "fail"); //!< Tells the QuestListeners, that the status has changed to failed.
    364364        this->setStatus(player, QuestStatus::Failed);
    365        
     365
    366366        COUT(4) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." <<std::endl;
    367        
     367
    368368        this->getDescription()->sendFailQuestNotification();
    369369        return true;
    370370    }
    371    
     371
    372372    /**
    373373    @brief
     
    382382        QuestListener::advertiseStatusChange(this->listeners_, "complete"); //!< Tells the QuestListeners, that the status has changed to completed.
    383383        this->setStatus(player, QuestStatus::Completed);
    384        
     384
    385385        COUT(4) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." <<std::endl;
    386        
     386
    387387        this->getDescription()->sendCompleteQuestNotification();
    388388        return true;
     
    404404            return false;
    405405        }
    406        
     406
    407407        COUT(4) << "Quest {" << this->getId() << "} is started for player: " << player << " ." <<std::endl;
    408        
     408
    409409        QuestListener::advertiseStatusChange(this->listeners_, "start"); //!< Tells the QuestListeners, that the status has changed to active.
    410        
     410
    411411        this->setStatus(player, QuestStatus::Active);
    412        
     412
    413413        this->getDescription()->sendAddQuestNotification();
    414414        return true;
    415415    }
    416    
     416
    417417    /**
    418418    @brief
     
    430430            return false;
    431431        }
    432        
     432
    433433        this->listeners_.push_back(listener);
    434434        return true;
  • code/branches/presentation2/src/modules/questsystem/QuestDescription.cc

    r5781 r6387  
    5050    {
    5151        RegisterObject(QuestDescription);
    52        
     52
    5353        this->title_ = "";
    5454        this->description_ = "";
     
    7979        COUT(3) << "New QuestDescription with title '" << this->getTitle() << "' created." << std::endl;
    8080    }
    81    
     81
    8282    /**
    8383    @brief
     
    124124            return false;
    125125        }
    126        
     126
    127127        QuestNotification* notification = new QuestNotification(message);
    128128        notification->send();
  • code/branches/presentation2/src/modules/questsystem/QuestEffect.cc

    r5781 r6387  
    6969    {
    7070        bool check = true;
    71        
     71
    7272        COUT(4) << "Invoking QuestEffects on player: " << player << " ."  << std::endl;
    7373
  • code/branches/presentation2/src/modules/questsystem/QuestGUI.cc

    r5929 r6387  
    7777        }
    7878        this->windows_.clear();
    79        
     79
    8080        if(this->root_ != NULL)
    8181            this->root_->destroy();
     
    104104
    105105        this->clear(); //!< Clear the GUI.
    106        
     106
    107107        int depth = 0;
    108108        int index = 0;
     
    235235
    236236        this->nodes_.insert(std::pair<CEGUI::Window*, QuestGUINode*>(node->getWindow(),node)); //!< Insert the node and its window in the nodes_ map.
    237        
     237
    238238        index++;
    239239
  • code/branches/presentation2/src/modules/questsystem/QuestGUI.h

    r5781 r6387  
    5656
    5757        public:
    58        
     58
    5959            QuestGUI(PlayerInfo* player);
    6060            virtual ~QuestGUI();
     
    8686            inline PlayerInfo* getPlayer(void)
    8787                { return this->player_; }
    88    
     88
    8989        private:
    90            
     90
    9191            int createNode(QuestGUINode* parent, QuestItem* item, int depth, int index); //!< Recursive method to create Nodes for all Quests an Hints the given Quest is a parent to.
    9292
  • code/branches/presentation2/src/modules/questsystem/QuestGUINode.cc

    r5781 r6387  
    119119    void QuestGUINode::toggleVisibility(void)
    120120    {
    121        
     121
    122122    }
    123123
     
    209209                offset += height;
    210210            }
    211            
     211
    212212            //! Create title pane for the description.
    213213            stream.str("");
     
    282282    {
    283283        COUT(3) << "Open QuestItem..." << std::endl;
    284        
     284
    285285        //CEGUI::Window* window = this->gui_->getRootWindow();
    286286        CEGUI::Window* window = this->gui_->getWindowManager()->getWindow("orxonox/QuestGUI/Background");
     
    344344        //! Set the height to the window.
    345345        window->setHeight(CEGUI::UDim(0, height));
    346        
     346
    347347        //Debug
    348348        const CEGUI::Rect newArea = getStaticTextArea(window);
     
    368368    {
    369369        Quest* quest = dynamic_cast<Quest*>(this->item_);
    370        
     370
    371371        this->window_ = this->gui_->getWindow();
    372372        std::ostringstream stream;
     
    377377        }
    378378        stream << this->index_;
    379        
     379
    380380        this->window_->rename(stream.str());
    381381        this->window_->setText(this->item_->getDescription()->getTitle());
  • code/branches/presentation2/src/modules/questsystem/QuestGUINode.h

    r5781 r6387  
    4444
    4545        public:
    46    
     46
    4747            QuestGUINode(void);
    4848            QuestGUINode(QuestGUI* gui, QuestGUINode* parent, QuestItem* item, int depth, int index);
    4949            virtual ~QuestGUINode(void);
    50    
     50
    5151            void toggleVisibility(void);
    5252
  • code/branches/presentation2/src/modules/questsystem/QuestHint.cc

    r5781 r6387  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    7171
    7272        QuestManager::getInstance().registerHint(this); //!< Registers the QuestHint with the QuestManager.
    73        
     73
    7474        COUT(3) << "New QuestHint {" << this->getId() << "} created." << std::endl;
    7575    }
     
    100100            return it->second;
    101101        }
    102        
     102
    103103        return QuestStatus::Inactive;
    104104    }
     
    119119            {
    120120                this->playerStatus_[player] = QuestHintStatus::Active;
    121                
     121
    122122                this->getDescription()->sendAddHintNotification();
    123123                return true;
     
    129129            }
    130130        }
    131        
     131
    132132        COUT(2) << "A hint of a non-active quest was trying to get activated." << std::endl;
    133133        return false;
  • code/branches/presentation2/src/modules/questsystem/QuestItem.cc

    r5781 r6387  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    8686            return;
    8787        }
    88        
     88
    8989        this->id_ = id;
    9090    }
  • code/branches/presentation2/src/modules/questsystem/QuestListener.cc

    r5781 r6387  
    5050    {
    5151        RegisterObject(QuestListener);
    52        
     52
    5353        this->mode_ = QuestListenerMode::All;
    5454        this->quest_ = NULL;
    5555    }
    56    
     56
    5757    /**
    5858    @brief
     
    6262    {
    6363    }
    64    
     64
    6565    /**
    6666    @brief
     
    7575
    7676        this->quest_->addListener(this); //!< Adds the QuestListener to the Quests list of listeners.
    77        
     77
    7878        COUT(3) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->getMode() << "'." << std::endl;
    7979    }
    80    
     80
    8181    /**
    8282    @brief
     
    9898        }
    9999    }
    100    
     100
    101101    /**
    102102    @brief
     
    110110    {
    111111        this->quest_ = QuestManager::getInstance().findQuest(id); //!< Find the Quest corresponding to the given questId.
    112        
     112
    113113        if(this->quest_ == NULL) //!< If there is no such Quest.
    114114        {
     
    116116            return false;
    117117        }
    118        
     118
    119119        return true;
    120120    }
    121    
     121
    122122    /**
    123123    @brief
     
    152152        return false;
    153153        }
    154        
     154
    155155        return true;
    156156    }
    157    
     157
    158158    /**
    159159    @brief
  • code/branches/presentation2/src/modules/questsystem/QuestNotification.cc

    r5781 r6387  
    3838        this->initialize();
    3939    }
    40    
     40
    4141    QuestNotification::QuestNotification(const std::string & message) : Notification(message)
    4242    {
    4343        this->initialize();
    4444    }
    45    
     45
    4646    QuestNotification::~QuestNotification()
    4747    {
    48        
     48
    4949    }
    5050
  • code/branches/presentation2/src/modules/questsystem/notifications/Notification.cc

    r5781 r6387  
    4949        this->initialize();
    5050    }
    51    
     51
    5252    /**
    5353    @brief
     
    6060        this->message_ = message;
    6161    }
    62    
     62
    6363    /**
    6464    @brief
     
    6868    {
    6969    }
    70    
     70
    7171    /**
    7272    @brief
     
    7979        this->sent_ = false;
    8080    }
    81    
     81
    8282    /**
    8383    @brief
     
    9090        return this->send(NotificationManager::NONE);
    9191    }
    92    
     92
    9393    /**
    9494    @brief
     
    106106            return false;
    107107        this->sent_ = true;
    108        
     108
    109109        COUT(3) << "Notification \"" << this->getMessage() << "\" sent." << std::endl;
    110        
     110
    111111        return true;
    112112    }
    113    
     113
    114114    /**
    115115    @brief
  • code/branches/presentation2/src/modules/weapons/projectiles/LightningGunProjectile.cc

    r5929 r6387  
    4343        this->maxTextureIndex_ = 8;
    4444        this->textureTimer_.setTimer(0.01f, true, createExecutor(createFunctor(&LightningGunProjectile::changeTexture, this)));
    45        
     45
    4646        registerVariables();
    4747    }
    48    
     48
    4949    void LightningGunProjectile::registerVariables()
    5050    {
    5151        registerVariable(this->materialBase_);
    5252    }
    53    
     53
    5454    void LightningGunProjectile::setMaterial(const std::string& material)
    5555    {
    5656        this->materialBase_ = material;   
    57    
     57
    5858        BillboardProjectile::setMaterial(material + multi_cast<std::string>(this->textureIndex_));
    5959    }
     
    6464        if (this->textureIndex_ > this->maxTextureIndex_)
    6565            this->textureIndex_ = 1;
    66        
     66
    6767        this->setMaterial(this->materialBase_);
    6868    }
  • code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc

    r6383 r6387  
    5858        this->bDestroy_ = false;
    5959        this->lifetime_ = 100;
    60        
     60
    6161        if (GameMode::isMaster())
    6262        {
    6363            this->setCollisionType(WorldEntity::Kinematic);
    6464            this->setVelocity(0,0,-100);
    65        
     65
    6666            Model* model = new Model(this);
    6767            model->setMeshSource("rocket.mesh");
     
    7272            fire->setOrientation(this->getOrientation());
    7373            fire->setSource("Orxonox/rocketfire");
    74        
     74
    7575            this->enableCollisionCallback();
    7676            this->setCollisionResponse(false);
     
    8383
    8484            this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&Rocket::destroyObject, this)));
    85            
     85
    8686            this->defSndWpnEngine_ = new WorldSound(this);
    8787            this->defSndWpnEngine_->setLooping(true);
     
    9999            this->defSndWpnLaunch_ = 0;
    100100        }
    101        
     101
    102102        CameraPosition* camPosition = new CameraPosition(this);
    103103        camPosition->setPosition(0,4,15);
     
    134134        SUPER(Rocket, XMLPort, xmlelement, mode);
    135135    }
    136    
     136
    137137    void Rocket::setOwner(Pawn* owner)
    138138    {
     
    158158    {
    159159        SUPER(Rocket, tick, dt);
    160        
     160
    161161        if( this->hasLocalController() )
    162162        {
     
    164164            this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->getVelocity().length() );
    165165            this->localAngularVelocity_ = 0;
    166            
     166
    167167            if( this->bDestroy_ )
    168168                this->destroy();
    169169        }
    170170    }
    171    
     171
    172172    bool Rocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
    173173    {
     
    176176            if (otherObject == this->owner_)
    177177                return false;
    178            
     178
    179179            this->bDestroy_ = true;
    180180
     
    211211        return false;
    212212    }
    213    
     213
    214214    void Rocket::destroyObject()
    215215    {
     
    223223        }
    224224    }
    225    
     225
    226226    void Rocket::fired(unsigned int firemode)
    227227    {
     
    258258    {
    259259        ControllableEntity::rotateYaw(value);
    260        
     260
    261261        if( !this->isInMouseLook() )
    262262            this->localAngularVelocity_.y += value.x;
     
    272272    {
    273273        ControllableEntity::rotatePitch(value);
    274        
     274
    275275        if( !this->isInMouseLook() )
    276276            this->localAngularVelocity_.x += value.x;
     
    286286    {
    287287        ControllableEntity::rotateRoll(value);
    288        
     288
    289289        if( !this->isInMouseLook() )
    290290            this->localAngularVelocity_.z += value.x;
    291291    }
    292    
     292
    293293}
  • code/branches/presentation2/src/modules/weapons/projectiles/Rocket.h

    r6378 r6387  
    5454            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Rocket through XML.
    5555            virtual void tick(float dt); //!< Defines which actions the Rocket has to take in each tick.
    56            
     56
    5757            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
    5858            void destroyObject();
    59            
     59
    6060            virtual void moveFrontBack(const Vector2& value){}
    6161            virtual void moveRightLeft(const Vector2& value){}
     
    6565            virtual void rotatePitch(const Vector2& value);
    6666            virtual void rotateRoll(const Vector2& value);
    67            
     67
    6868            /**
    6969            @brief Moves the Rocket in the Front/Back-direction by the specifed amount.
     
    8484            inline void moveUpDown(float value)
    8585            { this->moveUpDown(Vector2(value, 0)); }
    86            
     86
    8787            /**
    8888            @brief Rotates the Rocket around the y-axis by the specifed amount.
     
    103103            inline void rotateRoll(float value)
    104104            { this->rotateRoll(Vector2(value, 0)); }
    105            
     105
    106106            void setOwner(Pawn* owner);
    107107            inline Pawn* getOwner() const
    108108                { return this->owner_; }
    109                
     109
    110110            inline void setDamage(float damage)
    111111                { this->damage_ = damage; }
     
    113113                { return this->damage_; }
    114114            virtual void fired(unsigned int firemode);
    115            
     115
    116116        private:
    117117            WeakPtr<Pawn> owner_;
     
    120120            bool bDestroy_;
    121121            ControllableEntity* originalControllableEntity_;
    122            
     122
    123123            WeakPtr<PlayerInfo> player_;
    124124            Timer destroyTimer_;
  • code/branches/presentation2/src/orxonox/MoodManager.cc

    r6370 r6387  
    6464        ModifyConfigValue(mood_, set, mood);
    6565    }
    66    
     66
    6767    //! Gets the current mood
    6868    const std::string& MoodManager::getMood()
  • code/branches/presentation2/src/orxonox/PlayerManager.cc

    r6182 r6387  
    9090        }
    9191    }
    92    
     92
    9393    void PlayerManager::disconnectAllClients()
    9494    {
  • code/branches/presentation2/src/orxonox/Scene.h

    r6372 r6387  
    7878            inline Radar* getRadar()
    7979                { return this->radar_; }
    80            
     80
    8181            inline virtual uint32_t getSceneID() const { return this->getObjectID(); }
    8282
  • code/branches/presentation2/src/orxonox/Test.h

    r6123 r6387  
    7575      void checkS3();
    7676      void checkS4();
    77      
     77
    7878      void printPointer();
    7979
     
    9595      TYPE s3;
    9696      TYPE s4;
    97      
     97
    9898      Test* pointer_;
    9999
  • code/branches/presentation2/src/orxonox/controllers/ArtificialController.cc

    r6164 r6387  
    4646        this->bHasTargetPosition_ = false;
    4747        this->targetPosition_ = Vector3::ZERO;
    48        
     48
    4949        this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this));
    5050    }
     
    143143        this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getPosition(), hardcoded_projectile_speed, this->target_->getPosition(), this->target_->getVelocity());
    144144        this->bHasTargetPosition_ = (this->targetPosition_ != Vector3::ZERO);
    145        
     145
    146146        Pawn* pawn = dynamic_cast<Pawn*>(this->getControllableEntity());
    147147        if (pawn)
  • code/branches/presentation2/src/orxonox/controllers/ArtificialController.h

    r5929 r6387  
    4242            ArtificialController(BaseObject* creator);
    4343            virtual ~ArtificialController();
    44            
     44
    4545            void abandonTarget(Pawn* target);
    4646
  • code/branches/presentation2/src/orxonox/controllers/Controller.h

    r6356 r6387  
    5151
    5252            virtual inline void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) {};
    53            
     53
    5454            void setGodMode( bool mode ){ this->bGodMode_ = mode; }
    5555            bool getGodMode(){ return this->bGodMode_; }
  • code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc

    r6377 r6387  
    140140                arrowsOverlay1_->setPosition(Vector2(0.5, 0.5));
    141141                arrowsOverlay1_->hide();
    142    
     142
    143143                arrowsOverlay2_ = new OrxonoxOverlay(this);
    144144                arrowsOverlay2_->setBackgroundMaterial("Orxonox/DirectionArrows2");
     
    147147                arrowsOverlay2_->setPosition(Vector2(0.5, 0.5));
    148148                arrowsOverlay2_->hide();
    149    
     149
    150150                arrowsOverlay3_ = new OrxonoxOverlay(this);
    151151                arrowsOverlay3_->setBackgroundMaterial("Orxonox/DirectionArrows3");
     
    154154                arrowsOverlay3_->setPosition(Vector2(0.5, 0.5));
    155155                arrowsOverlay3_->hide();
    156    
     156
    157157                arrowsOverlay4_ = new OrxonoxOverlay(this);
    158158                arrowsOverlay4_->setBackgroundMaterial("Orxonox/DirectionArrows4");
     
    502502        {
    503503            hideArrows();
    504    
     504
    505505            float distance = sqrt(pow(static_cast<float>(this->currentYaw_)/2*-1,2) + pow(static_cast<float>(this->currentPitch_)/2*-1,2));
    506    
     506
    507507            if (distance > 0.04 && distance <= 0.59 * arrowsSize_ / 2.0 )
    508508            {
  • code/branches/presentation2/src/orxonox/gamestates/GSGraphics.cc

    r6150 r6387  
    6464    void GSGraphics::activate()
    6565    {
    66        
     66
    6767    }
    6868
  • code/branches/presentation2/src/orxonox/gamestates/GSLevel.cc

    r6150 r6387  
    9090            // level is loaded: we can start capturing the input
    9191            InputManager::getInstance().enterState("game");
    92            
     92
    9393            // connect the HumanPlayer to the game
    9494            PlayerManager::getInstance().clientConnected(0);
     
    105105            InputManager::getInstance().leaveState("game");
    106106        }
    107        
     107
    108108        // disconnect all HumanPlayers
    109109        PlayerManager::getInstance().disconnectAllClients();
     
    135135        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    136136            this->staticObjects_.insert(*it);
    137        
     137
    138138        // call the loader
    139139        COUT(0) << "Loading level..." << std::endl;
  • code/branches/presentation2/src/orxonox/gamestates/GSMainMenu.cc

    r6378 r6387  
    9696        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startDedicated), "startDedicated"));
    9797        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu), "startMainMenu"));
    98        
     98
    9999        // create command to change sound path
    100100        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::setMainMenuSoundPath, this), "setMMSoundPath"));
  • code/branches/presentation2/src/orxonox/gamestates/GSRoot.cc

    r6378 r6387  
    5555        NetworkFunctionBase::destroyAllNetworkFunctions();
    5656    }
    57    
     57
    5858    void GSRoot::printObjects()
    5959    {
  • code/branches/presentation2/src/orxonox/gametypes/Gametype.cc

    r5929 r6387  
    5151    {
    5252        RegisterObject(Gametype);
    53        
     53
    5454        this->gtinfo_ = new GametypeInfo(creator);
    5555
     
    7979        else
    8080            this->scoreboard_ = 0;
    81        
     81
    8282        /* HACK HACK HACK */
    8383        this->hackAddBots_ = createConsoleCommand( createFunctor(&Gametype::addBots, this), "hackAddBots");
     
    8787        /* HACK HACK HACK */
    8888    }
    89    
     89
    9090    Gametype::~Gametype()
    9191    {
  • code/branches/presentation2/src/orxonox/gametypes/Gametype.h

    r5929 r6387  
    184184            // Config Values
    185185            std::string scoreboardTemplate_;
    186            
     186
    187187            /* HACK HACK HACK */
    188188            ConsoleCommand* hackAddBots_;
  • code/branches/presentation2/src/orxonox/infos/PlayerInfo.cc

    r6192 r6387  
    171171        this->changedControllableEntity();
    172172    }
    173    
     173
    174174    void PlayerInfo::startTemporaryControl(ControllableEntity* entity)
    175175    {
    176176        if (!entity)
    177177            return;
    178        
     178
    179179//         assert( this->temporaryControllableEntity_==0 );
    180180
     
    195195        if ( this->oldControllableEntity_ )
    196196            this->stopTemporaryControl();
    197        
     197
    198198        ControllableEntity* entity = this->controllableEntity_;
    199199
     
    213213        this->changedControllableEntity();
    214214    }
    215    
     215
    216216    void PlayerInfo::stopTemporaryControl()
    217217    {
     
    231231        if ( GameMode::isMaster() )
    232232            entity->removePlayer();
    233        
    234         this->changedControllableEntity();
    235     }
    236    
     233
     234        this->changedControllableEntity();
     235    }
     236
    237237    void PlayerInfo::networkcallback_changedcontrollableentityID()
    238238    {
  • code/branches/presentation2/src/orxonox/interfaces/Rewardable.h

    r5781 r6387  
    4343    @brief
    4444        Rewardable is an Interface, that can be implemented by any object to enable it to be given as reward to a player through QuestEffects. (With the AddReward effect.)
    45        
     45
    4646        It just needs to inherit form Rewardable, and implement the reward() method.
    4747    @author
  • code/branches/presentation2/src/orxonox/items/MultiStateEngine.h

    r6329 r6387  
    6464            void addEffectContainer(EffectContainer* effect);
    6565            EffectContainer* getEffectContainer(unsigned int index) const;
    66            
     66
    6767            void setDefEngSndNormal(const std::string& engineSound);
    6868            const std::string& getDefEngSndNormal();
  • code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.cc

    r6310 r6387  
    171171    {
    172172        SUPER( OrxonoxOverlay, changedVisibility );
    173        
     173
    174174        if (!this->overlay_)
    175175            return;
  • code/branches/presentation2/src/orxonox/overlays/OverlayGroup.cc

    r6054 r6387  
    144144    {
    145145        SUPER( OverlayGroup, changedVisibility );
    146        
     146
    147147        for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    148148            (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
  • code/branches/presentation2/src/orxonox/pickup/ModifierPickup.h

    r5929 r6387  
    129129
    130130        void timerCallback(Pawn* pawn);     //!< Method called when the timer runs out.
    131        
     131
    132132    private:
    133133        float getAdditiveModifier(ModifierType::Value type) const;               //!< Get the additive modifier for a given ModifierType.
  • code/branches/presentation2/src/orxonox/pickup/UsableItem.cc

    r5781 r6387  
    2626 *
    2727 */
    28        
     28
    2929/**
    3030    @file
  • code/branches/presentation2/src/orxonox/sound/AmbientSound.cc

    r6382 r6387  
    6161        }
    6262    }
    63    
     63
    6464    void AmbientSound::registerVariables()
    6565    {
     
    101101            SoundManager::getInstance().pauseAmbientSound(this);
    102102    }
    103    
     103
    104104    float AmbientSound::getRealVolume()
    105105    {
  • code/branches/presentation2/src/orxonox/sound/BaseSound.cc

    r6383 r6387  
    150150        this->updateVolume();
    151151    }
    152    
     152
    153153    void BaseSound::updateVolume()
    154154    {
     
    252252        }
    253253    }
    254    
     254
    255255    void BaseSound::stateChanged()
    256256    {
  • code/branches/presentation2/src/orxonox/sound/SoundManager.cc

    r6383 r6387  
    134134        else
    135135            COUT(2) << "Sound Warning: MIME Type retrieval failed: " << alutGetErrorString(alutGetError()) << std::endl;
    136        
     136
    137137        this->mute_[SoundType::All]     = 1.0f;
    138138        this->mute_[SoundType::Music]   = 1.0f;
     
    431431    void SoundManager::processCrossFading(float dt)
    432432    {
    433        
     433
    434434        // Hacky solution to the fade delay while loading a level.
    435435        if(dt > 0.2)
     
    437437            return;
    438438        }
    439        
     439
    440440        // FADE IN
    441441        for (std::list<SmartPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )
  • code/branches/presentation2/src/orxonox/sound/SoundManager.h

    r6383 r6387  
    7575        void preUpdate(const Clock& time);
    7676        void setConfigValues();
    77        
     77
    7878        // tolua_begin
    7979        static SoundManager& getInstance() { return Singleton<SoundManager>::getInstance(); }
  • code/branches/presentation2/src/orxonox/sound/WorldSound.cc

    r6382 r6387  
    5151        this->registerVariables();
    5252    }
    53    
     53
    5454    void WorldSound::registerVariables()
    5555    {
  • code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc

    r6381 r6387  
    6767
    6868        this->damage_ = 0;
    69        
     69
    7070        this->muzzleOffset_ = Vector3::ZERO;
    7171        this->muzzlePosition_ = Vector3::ZERO;
     
    141141                this->defSndWpnFire_->play();
    142142            }
    143            
     143
    144144            this->fire();
    145145
  • code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc

    r6325 r6387  
    238238            this->cameraPositionRootNode_->roll(Radian(value.y * this->mouseLookSpeed_), Ogre::Node::TS_LOCAL);
    239239    }
    240    
     240
    241241    void ControllableEntity::fire(unsigned int firemode)
    242242    {
     
    250250        }
    251251    }
    252    
     252
    253253    void ControllableEntity::setTarget( WorldEntity* target )
    254254    {
     
    266266        }
    267267    }
    268    
     268
    269269    void ControllableEntity::setTargetInternal( uint32_t targetID )
    270270    {
  • code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h

    r6325 r6387  
    145145            inline void setController(Controller* val)
    146146                { this->controller_ = val; }
    147            
     147
    148148            virtual void setTarget( WorldEntity* target );
    149149            virtual WorldEntity* getTarget()
  • code/branches/presentation2/src/orxonox/worldentities/StaticEntity.cc

    r5781 r6387  
    4242    {
    4343        RegisterObject(StaticEntity);
    44        
     44
    4545        this->setPriority(Priority::VeryLow);
    4646
  • code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.cc

    r6356 r6387  
    6868
    6969        this->spawnparticleduration_ = 3.0f;
    70        
     70
    7171        this->aimPosition_ = Vector3::ZERO;
    7272
  • code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.h

    r6295 r6387  
    116116
    117117            virtual void startLocalHumanControl();
    118            
     118
    119119            void setAimPosition( Vector3 position )
    120120                { this->aimPosition_ = position; }
     
    153153            inline void setWeaponSystem(WeaponSystem* weaponsystem)
    154154                { this->weaponSystem_ = weaponsystem; }
    155            
     155
    156156            Vector3 aimPosition_;
    157157    };
Note: See TracChangeset for help on using the changeset viewer.