Index: code/trunk/src/libraries/util/Serialise.h
===================================================================
--- code/trunk/src/libraries/util/Serialise.h	(revision 11071)
+++ code/trunk/src/libraries/util/Serialise.h	(revision 11083)
@@ -48,5 +48,5 @@
     template <class T> inline uint32_t returnSize( const T& variable );
     /** @brief loads the value of a variable out of the bytestream and increases the mem pointer */
-    template <class T> inline void loadAndIncrease( const T& variable, uint8_t*& mem );
+    template <class T> inline void loadAndIncrease( T& variable, uint8_t*& mem );
     /** @brief saves the value of a variable into the bytestream and increases the mem pointer */
     template <class T> inline void saveAndIncrease( const T& variable, uint8_t*& mem );
@@ -57,13 +57,14 @@
   // =========== char*
 
-  inline uint32_t returnSize( char*& variable )
+  inline uint32_t returnSize(const char*& variable )
   {
     return strlen(variable)+1;
   }
 
-  inline void saveAndIncrease( char*& variable, uint8_t*& mem )
+  inline void saveAndIncrease(const char*& variable, uint8_t*& mem )
   {
-    strcpy((char*)mem, variable);
-    mem += returnSize(variable);
+    uint32_t len = returnSize(variable);
+    std::memcpy(mem, variable, len);
+    mem += len;
   }
 
@@ -72,7 +73,7 @@
     if( variable )
       delete variable;
-    uint32_t len = strlen((char*)mem)+1;
+    uint32_t len = returnSize((const char*&)mem);
     variable = new char[len];
-    strcpy((char*)variable, (char*)mem);
+    std::memcpy(variable, mem, len);
     mem += len;
   }
@@ -92,5 +93,5 @@
     }
 
-    template <> inline void loadAndIncrease( const bool& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( bool& variable, uint8_t*& mem )
     {
         *(uint8_t*)( &variable ) = *static_cast<uint8_t*>(mem);
@@ -116,5 +117,5 @@
     }
 
-    template <> inline void loadAndIncrease( const char& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( char& variable, uint8_t*& mem )
     {
         *(uint8_t*)( &variable ) = *static_cast<uint8_t*>(mem);
@@ -140,5 +141,5 @@
     }
 
-    template <> inline void loadAndIncrease( const unsigned char& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( unsigned char& variable, uint8_t*& mem )
     {
         *(uint8_t*)( &variable ) = *static_cast<uint8_t*>(mem);
@@ -164,5 +165,5 @@
     }
 
-    template <> inline void loadAndIncrease( const short& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( short& variable, uint8_t*& mem )
     {
         *(short*)( &variable ) = *(int16_t*)(mem);
@@ -188,5 +189,5 @@
     }
 
-    template <> inline void loadAndIncrease( const unsigned short& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( unsigned short& variable, uint8_t*& mem )
     {
         *(unsigned short*)( &variable ) = *(uint16_t*)(mem);
@@ -212,5 +213,5 @@
     }
 
-    template <> inline void loadAndIncrease( const int& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( int& variable, uint8_t*& mem )
     {
         *(int *)( &variable ) = *(int32_t*)(mem);
@@ -236,5 +237,5 @@
     }
 
-    template <> inline void loadAndIncrease( const unsigned int& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( unsigned int& variable, uint8_t*& mem )
     {
         *(unsigned int*)( &variable ) = *(uint32_t*)(mem);
@@ -260,5 +261,5 @@
     }
 
-    template <> inline void loadAndIncrease( const long& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( long& variable, uint8_t*& mem )
     {
         *(long*)( &variable ) = *(int32_t*)(mem);
@@ -284,5 +285,5 @@
     }
 
-    template <> inline void loadAndIncrease( const unsigned long& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( unsigned long& variable, uint8_t*& mem )
     {
         *(unsigned long*)( &variable ) = *(uint32_t*)(mem);
@@ -308,5 +309,5 @@
     }
 
-    template <> inline void loadAndIncrease( const long long& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( long long& variable, uint8_t*& mem )
     {
         *(long long*)( &variable ) = *(int64_t*)(mem);
@@ -332,5 +333,5 @@
     }
 
-    template <> inline void loadAndIncrease( const unsigned long long& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( unsigned long long& variable, uint8_t*& mem )
     {
         *(unsigned long long*)( &variable ) = *(uint64_t*)(mem);
@@ -356,5 +357,5 @@
     }
 
-    template <> inline void loadAndIncrease( const float& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( float& variable, uint8_t*& mem )
     {
         *(uint32_t*)( &variable ) = *(uint32_t*)(mem);
@@ -380,5 +381,5 @@
     }
 
-    template <> inline void loadAndIncrease( const double& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( double& variable, uint8_t*& mem )
     {
         *(uint64_t*)( &variable ) = *(uint64_t*)(mem);
@@ -404,5 +405,5 @@
     }
 
-    template <> inline void loadAndIncrease( const long double& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( long double& variable, uint8_t*& mem )
     {
         double temp;
@@ -438,5 +439,5 @@
     }
 
-    template <> inline void loadAndIncrease( const std::string& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( std::string& variable, uint8_t*& mem )
     {
         *(std::string*)( &variable ) = (const char *)mem;
@@ -464,5 +465,5 @@
     }
 
-    template <> inline void loadAndIncrease( const Degree& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( Degree& variable, uint8_t*& mem )
     {
         Ogre::Real* r = (Ogre::Real*)mem;
@@ -491,5 +492,5 @@
     }
 
-    template <> inline void loadAndIncrease( const Radian& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( Radian& variable, uint8_t*& mem )
     {
         Ogre::Real* r = (Ogre::Real*)mem;
@@ -517,5 +518,5 @@
     }
 
-    template <> inline void loadAndIncrease( const Vector2& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( Vector2& variable, uint8_t*& mem )
     {
         loadAndIncrease( variable.x, mem );
@@ -542,5 +543,5 @@
     }
 
-    template <> inline void loadAndIncrease( const Vector3& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( Vector3& variable, uint8_t*& mem )
     {
         loadAndIncrease( variable.x, mem );
@@ -570,5 +571,5 @@
     }
 
-    template <> inline void loadAndIncrease( const Vector4& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( Vector4& variable, uint8_t*& mem )
     {
         loadAndIncrease( variable.w, mem );
@@ -600,5 +601,5 @@
     }
 
-    template <> inline void loadAndIncrease( const Quaternion& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( Quaternion& variable, uint8_t*& mem )
     {
         loadAndIncrease( variable.w, mem );
@@ -630,5 +631,5 @@
     }
 
-    template <> inline void loadAndIncrease( const ColourValue& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( ColourValue& variable, uint8_t*& mem )
     {
         loadAndIncrease( variable.r, mem );
@@ -657,5 +658,5 @@
     }
 
-    template <> inline void loadAndIncrease( const mbool& variable, uint8_t*& mem )
+    template <> inline void loadAndIncrease( mbool& variable, uint8_t*& mem )
     {
         loadAndIncrease( (unsigned char&)((mbool&)variable).getMemory(), mem );
