Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 31, 2010, 3:37:40 AM (14 years ago)
Author:
landauf
Message:

merged consolecommands3 branch back to trunk.

note: the console command interface has changed completely, but the documentation is not yet up to date. just copy an existing command and change it to your needs, it's pretty self-explanatory. also the include files related to console commands are now located in core/command/. in the game it should work exactly like before, except for some changes in the auto-completion.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/network/synchronisable/Serialise.h

    r7266 r7284  
    4242#include "core/CorePrereqs.h"
    4343#include "core/CoreIncludes.h"
    44 #include "core/SmartPtr.h"
     44#include "core/BaseObject.h" // remove this if circular dependencies in BaseObject/SmartPtr are fixed
     45//#include "core/SmartPtr.h"
    4546
    4647namespace orxonox{
    47    
     48
    4849    // These functions implement loading / saving / etc. for pointer types
    49    
     50
    5051    /** @brief returns the size of the objectID needed to synchronise the pointer */
    5152    template <class T> inline uint32_t returnSize( T*& variable )
     
    5354      return sizeof(uint32_t);
    5455    }
    55    
     56
    5657    /** @brief reads the objectID of a pointer out of the bytestream and increases the mem pointer */
    5758    template <class T> inline void loadAndIncrease( T*& variable, uint8_t*& mem )
     
    6061        mem += returnSize( variable );
    6162    }
    62    
     63
    6364    /** @brief saves the objectID of a pointer into the bytestream and increases the mem pointer */
    6465    template <class T> inline void saveAndIncrease( T*& variable, uint8_t*& mem )
     
    7071        mem += returnSize( variable );
    7172    }
    72    
     73
    7374    /** @brief checks whether the objectID of the variable is the same as in the bytestream */
    7475    template <class T> inline  bool checkEquality( T*& variable, uint8_t* mem )
     
    7980            return variable == variable->getSynchronisable(*(uint32_t*)(mem));
    8081    }
    81    
     82
    8283    // These functions implement loading / saving / etc. for SmartPtr<T>
    83    
     84
    8485    /** @brief returns the size of the objectID needed to synchronise the pointer */
    8586    template <class T> inline uint32_t returnSize( const SmartPtr<T>& variable )
     
    8788        return sizeof(uint32_t);
    8889    }
    89    
     90
    9091    /** @brief reads the objectID of a pointer out of the bytestream and increases the mem pointer */
    9192    template <class T> inline void loadAndIncrease( const SmartPtr<T>& variable, uint8_t*& mem )
     
    9596        mem += returnSize( variable );
    9697    }
    97    
     98
    9899    /** @brief saves the objectID of a pointer into the bytestream and increases the mem pointer */
    99100    template <class T> inline void saveAndIncrease( const SmartPtr<T>& variable, uint8_t*& mem )
     
    105106        mem += returnSize( variable );
    106107    }
    107    
     108
    108109    /** @brief checks whether the objectID of the variable is the same as in the bytestream */
    109110    template <class T> inline  bool checkEquality( const SmartPtr<T>& variable, uint8_t* mem )
     
    114115            return *(uint32_t*)(mem) == OBJECTID_UNKNOWN;
    115116    }
    116    
     117
    117118    // These functions implement loading / saving / etc. for WeakPtr<T>
    118    
     119
    119120    /** @brief returns the size of the objectID needed to synchronise the pointer */
    120121    template <class T> inline uint32_t returnSize( const WeakPtr<T>& variable )
     
    122123        return sizeof(uint32_t);
    123124    }
    124    
     125
    125126    /** @brief reads the objectID of a pointer out of the bytestream and increases the mem pointer */
    126127    template <class T> inline void loadAndIncrease( const WeakPtr<T>& variable, uint8_t*& mem )
     
    130131        mem += returnSize( variable );
    131132    }
    132    
     133
    133134    /** @brief saves the objectID of a pointer into the bytestream and increases the mem pointer */
    134135    template <class T> inline void saveAndIncrease( const WeakPtr<T>& variable, uint8_t*& mem )
     
    140141        mem += returnSize( variable );
    141142    }
    142    
     143
    143144    /** @brief checks whether the objectID of the variable is the same as in the bytestream */
    144145    template <class T> inline  bool checkEquality( const WeakPtr<T>& variable, uint8_t* mem )
Note: See TracChangeset for help on using the changeset viewer.