Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 17, 2011, 5:47:22 AM (14 years ago)
Author:
rgrieder
Message:

Stripped down trunk to form a new light sandbox.

Location:
code/forks/sandbox_light/src/libraries/util
Files:
10 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • code/forks/sandbox_light/src/libraries/util/CMakeLists.txt

    r7449 r7908  
    2121  Clock.cc
    2222  Exception.cc
    23   ExprParser.cc
    2423  Math.cc
    2524  MultiType.cc
    26   Scope.cc
    2725  StringUtils.cc
    2826COMPILATION_BEGIN StableCompilation.cc
    29   Clipboard.cc
    3027  Convert.cc
    3128  CRC32.cc
    3229  OutputHandler.cc
    33   ScopedSingletonManager.cc
    3430  SharedPtr.cc
    3531  SignalHandler.cc
     
    5450  FIND_HEADER_FILES
    5551  LINK_LIBRARIES
    56     ${CEGUI_LIBRARY}
    57     ${OGRE_LIBRARY}
     52    ogremath_orxonox
    5853  SOURCE_FILES
    5954    ${UTIL_SRC_FILES}
  • code/forks/sandbox_light/src/libraries/util/Clock.cc

    r7401 r7908  
    2828
    2929#include "Clock.h"
    30 #include <OgreTimer.h>
     30#include <ogremath/OgreTimer.h>
    3131
    3232namespace orxonox
  • code/forks/sandbox_light/src/libraries/util/Exception.cc

    r7401 r7908  
    3535#include "Exception.h"
    3636
    37 #include <CEGUIExceptions.h>
    3837#include "Debug.h"
    3938
     
    9998            return ex.what();
    10099        }
    101         catch (const CEGUI::Exception& ex)
    102         {
    103 #if CEGUI_VERSION_MAJOR == 0 && CEGUI_VERSION_MINOR < 6
    104             return GeneralException(ex.getMessage().c_str()).getDescription();
    105 #else
    106             return GeneralException(ex.getMessage().c_str(), ex.getLine(),
    107                 ex.getFileName().c_str(), ex.getName().c_str()).getDescription();
    108 #endif
    109         }
    110100        catch (...)
    111101        {
  • code/forks/sandbox_light/src/libraries/util/Math.cc

    r7401 r7908  
    3434#include "Math.h"
    3535
    36 #include <OgrePlane.h>
     36#include <ogremath/OgrePlane.h>
    3737
    3838#include "MathConvert.h"
  • code/forks/sandbox_light/src/libraries/util/Math.h

    r7427 r7908  
    4747#include <cstdlib>
    4848
    49 #include <OgreMath.h>
    50 #include <OgreVector2.h>
    51 #include <OgreVector3.h>
    52 #include <OgreVector4.h>
    53 #include <OgreQuaternion.h>
    54 #include <OgreColourValue.h>
     49#include <ogremath/OgreMath.h>
     50#include <ogremath/OgreVector2.h>
     51#include <ogremath/OgreVector3.h>
     52#include <ogremath/OgreVector4.h>
     53#include <ogremath/OgreQuaternion.h>
     54#include <ogremath/OgreColourValue.h>
    5555
    5656// Certain headers might define unwanted macros...
  • code/forks/sandbox_light/src/libraries/util/MultiType.h

    r7401 r7908  
    100100#include <cassert>
    101101#include <string>
    102 #include <OgreVector2.h>
    103 #include <OgreVector3.h>
    104 #include <OgreVector4.h>
    105 #include <OgreQuaternion.h>
    106 #include <OgreColourValue.h>
     102#include <ogremath/OgreVector2.h>
     103#include <ogremath/OgreVector3.h>
     104#include <ogremath/OgreVector4.h>
     105#include <ogremath/OgreQuaternion.h>
     106#include <ogremath/OgreColourValue.h>
    107107#include <loki/TypeTraits.h>
    108108#include "mbool.h"
     
    260260
    261261            virtual void toString(std::ostream& outstream) const = 0;
    262 
    263             virtual void importData( uint8_t*& mem )=0;
    264             virtual void exportData( uint8_t*& mem ) const=0;
    265             virtual uint8_t getSize() const=0;
    266262
    267263            MT_Type::Value type_;   ///< The type of the current value
     
    374370            std::string                       getTypename()               const;
    375371
    376             /// Saves the value of the MT to a bytestream (pointed at by mem) and increases mem pointer by size of MT
    377             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); }
    378             /// Loads the value of the MT from a bytestream (pointed at by mem) and increases mem pointer by size of MT
    379             inline void                       importData(uint8_t*& mem) { assert(sizeof(MT_Type::Value)<=8); this->setType(static_cast<MT_Type::Value>(*static_cast<uint8_t*>(mem))); mem+=sizeof(uint8_t); this->value_->importData(mem); }
    380             /// Saves the value of the MT to a bytestream and increases pointer to bytestream by size of MT
    381             inline uint8_t*&                  operator << (uint8_t*& mem) { importData(mem); return mem; }
    382             /// Loads the value of the MT to a bytestream and increases pointer to bytestream by size of MT
    383             inline void                       operator >> (uint8_t*& mem) const { exportData(mem); }
    384             inline uint32_t                   getNetworkSize() const { assert(this->value_); return this->value_->getSize() + sizeof(uint8_t); }
    385 
    386372            /// Checks whether the value is a default one (assigned after a failed conversion)
    387373            bool                              hasDefaultValue() const { return this->value_->hasDefaultValue(); }
  • code/forks/sandbox_light/src/libraries/util/MultiTypeValue.h

    r7401 r7908  
    4343#include "MathConvert.h"
    4444#include "MultiType.h"
    45 #include "Serialise.h"
    4645
    4746namespace orxonox
     
    155154        inline void toString(std::ostream& outstream) const { outstream << this->value_; }
    156155
    157         /// loads data from the bytestream (mem) into the MT and increases the bytestream pointer by the size of the data
    158         inline void importData( uint8_t*& mem )         { loadAndIncrease( /*(const T&)*/this->value_, mem ); }
    159         /// saves data from the MT into the bytestream (mem) and increases the bytestream pointer by the size of the data
    160         inline void exportData( uint8_t*& mem ) const   { saveAndIncrease( /*(const T&)*/this->value_, mem ); }
    161         /// returns the size of the data that would be saved by exportData
    162         inline uint8_t getSize() const { return returnSize( this->value_ ); }
    163 
    164156        T value_; ///< The stored value
    165157    };
    166 
    167     // Import / Export specialisation
    168     // ColourValue
    169     template <> inline void MT_Value<ColourValue>::importData( uint8_t*& mem )
    170     {
    171         loadAndIncrease( this->value_.r, mem );
    172         loadAndIncrease( this->value_.g, mem );
    173         loadAndIncrease( this->value_.b, mem );
    174         loadAndIncrease( this->value_.a, mem );
    175     }
    176     template <> inline void MT_Value<ColourValue>::exportData( uint8_t*& mem ) const
    177     {
    178         saveAndIncrease( this->value_.r, mem );
    179         saveAndIncrease( this->value_.g, mem );
    180         saveAndIncrease( this->value_.b, mem );
    181         saveAndIncrease( this->value_.a, mem );
    182     }
    183     template <> inline uint8_t MT_Value<ColourValue>::getSize() const
    184     {
    185         return 4*returnSize(this->value_.r);
    186     }
    187     // Ogre::Quaternion
    188     template <> inline void MT_Value<Ogre::Quaternion>::importData( uint8_t*& mem )
    189     {
    190         loadAndIncrease( this->value_.x, mem );
    191         loadAndIncrease( this->value_.y, mem );
    192         loadAndIncrease( this->value_.z, mem );
    193         loadAndIncrease( this->value_.w, mem );
    194     }
    195     template <> inline void MT_Value<Ogre::Quaternion>::exportData( uint8_t*& mem ) const
    196     {
    197         saveAndIncrease( this->value_.x, mem );
    198         saveAndIncrease( this->value_.y, mem );
    199         saveAndIncrease( this->value_.z, mem );
    200         saveAndIncrease( this->value_.w, mem );
    201     }
    202     template <> inline uint8_t MT_Value<Ogre::Quaternion>::getSize() const
    203     {
    204         return 4*returnSize(this->value_.x);
    205     }
    206     // Ogre::Vector2
    207     template <> inline void MT_Value<Ogre::Vector2>::importData( uint8_t*& mem )
    208     {
    209         loadAndIncrease( this->value_.x, mem );
    210         loadAndIncrease( this->value_.y, mem );
    211     }
    212     template <> inline void MT_Value<Ogre::Vector2>::exportData( uint8_t*& mem ) const
    213     {
    214         saveAndIncrease( this->value_.x, mem );
    215         saveAndIncrease( this->value_.y, mem );
    216     }
    217     template <> inline uint8_t MT_Value<Ogre::Vector2>::getSize() const
    218     {
    219         return 2*returnSize(this->value_.x);
    220     }
    221     // Ogre::Vector3
    222     template <> inline void MT_Value<Ogre::Vector3>::importData( uint8_t*& mem )
    223     {
    224         loadAndIncrease( this->value_.x, mem );
    225         loadAndIncrease( this->value_.y, mem );
    226         loadAndIncrease( this->value_.z, mem );
    227     }
    228     template <> inline void MT_Value<Ogre::Vector3>::exportData( uint8_t*& mem ) const
    229     {
    230         saveAndIncrease( this->value_.x, mem );
    231         saveAndIncrease( this->value_.y, mem );
    232         saveAndIncrease( this->value_.z, mem );
    233     }
    234     template <> inline uint8_t MT_Value<Ogre::Vector3>::getSize() const
    235     {
    236         return 3*returnSize(this->value_.x);
    237     }
    238     // Ogre::Vector4
    239     template <> inline void MT_Value<Ogre::Vector4>::importData( uint8_t*& mem )
    240     {
    241         loadAndIncrease( this->value_.x, mem );
    242         loadAndIncrease( this->value_.y, mem );
    243         loadAndIncrease( this->value_.z, mem );
    244         loadAndIncrease( this->value_.w, mem );
    245     }
    246     template <> inline void MT_Value<Ogre::Vector4>::exportData( uint8_t*& mem ) const
    247     {
    248         saveAndIncrease( this->value_.x, mem );
    249         saveAndIncrease( this->value_.y, mem );
    250         saveAndIncrease( this->value_.z, mem );
    251         saveAndIncrease( this->value_.w, mem );
    252     }
    253     template <> inline uint8_t MT_Value<Ogre::Vector4>::getSize() const
    254     {
    255         return 4*returnSize(this->value_.x);
    256     }
    257     template <> inline void MT_Value<void*>::importData( uint8_t*& mem )
    258     {
    259         assert(0);
    260     }
    261     template <> inline void MT_Value<void*>::exportData( uint8_t*& mem ) const
    262     {
    263         assert(0);
    264     }
    265     template <> inline uint8_t MT_Value<void*>::getSize() const
    266     {
    267         assert(0); return 0;
    268     }
    269158}
    270159
  • code/forks/sandbox_light/src/libraries/util/UtilPrereqs.h

    r6417 r7908  
    6464namespace orxonox
    6565{
    66     namespace ScopeID
    67     {
    68         //!A list of available scopes for the Scope template.
    69         enum Value
    70         {
    71             Root,
    72             Graphics
    73         };
    74     }
    7566}
    7667
     
    8374    class Clock;
    8475    class Exception;
    85     class ExprParser;
    8676    class IntVector2;
    8777    class IntVector3;
     
    8979    class OutputHandler;
    9080    class OutputListener;
    91     template <ScopeID::Value>
    92     class Scope;
    93     template <class, ScopeID::Value>
    94     class ScopedSingleton;
    95     class ScopeListener;
    9681    class SignalHandler;
    9782    template <class T>
Note: See TracChangeset for help on using the changeset viewer.