Advertisement
Guest User

Untitled

a guest
Feb 11th, 2012
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 14.51 KB | None | 0 0
  1. diff -rdu aquaria/Aquaria/Main.cpp /media/Lexar/aquaria/Aquaria/Main.cpp
  2. --- aquaria/Aquaria/Main.cpp    2012-02-11 14:17:52.000000000 +0100
  3. +++ /media/Lexar/aquaria/Aquaria/Main.cpp   2012-02-11 12:57:48.000000000 +0100
  4. @@ -80,7 +80,7 @@
  5.  
  6.  #else
  7.  
  8. -   extern "C" int main(int argc,char *argv[])
  9. +   int main(int argc,char *argv[])
  10.     {
  11.         std::string dsqParam = ""; // fileSystem
  12.  
  13. diff -rdu aquaria/Aquaria/SceneEditor.cpp /media/Lexar/aquaria/Aquaria/SceneEditor.cpp
  14. --- aquaria/Aquaria/SceneEditor.cpp 2012-02-11 14:17:52.000000000 +0100
  15. +++ /media/Lexar/aquaria/Aquaria/SceneEditor.cpp    2012-02-11 12:59:12.000000000 +0100
  16. @@ -3739,7 +3739,7 @@
  17.             case ES_SCALING:
  18.             {
  19.                 bool right=false, middle=false, down=false, uni=false;
  20. -               bool noSide = 0;
  21. +               unsigned char noSide = 0;
  22.                 if (cursorOffset.x > oldPosition.x+10)
  23.                     right = true;
  24.                 else if (cursorOffset.x < oldPosition.x-10)
  25. diff -rdu aquaria/BBGE/ActionMapper.cpp /media/Lexar/aquaria/BBGE/ActionMapper.cpp
  26. --- aquaria/BBGE/ActionMapper.cpp   2012-02-11 14:17:52.000000000 +0100
  27. +++ /media/Lexar/aquaria/BBGE/ActionMapper.cpp  2012-02-11 14:05:37.000000000 +0100
  28. @@ -75,9 +75,9 @@
  29.  
  30.  ActionData *ActionMapper::getActionDataByID(int actionID)
  31.  {
  32. -   for (ActionDataSet::iterator i = actionData.begin(); i != actionData.end(); i++)
  33. +   for (ActionDataSet::iterator i = actionData.begin(); i != actionData.end(); ++i)
  34.     {
  35. -       if ((*i).id == actionID)
  36. +       if (i->id == actionID)
  37.             return &(*i);
  38.     }
  39.     return 0;
  40. @@ -382,30 +382,30 @@
  41.     {
  42.         ButtonList::iterator j;
  43.         j = i->buttonList.begin();
  44. -       for (; j != i->buttonList.end(); j++)
  45. +       for (; j != i->buttonList.end(); ++j)
  46.         {
  47. -           int k = (*j);
  48. +           const int k = (*j);
  49.             int keyState=false;
  50.             //joystick
  51.  
  52.             keyState = getKeyState(k);
  53.  
  54.             if (keyState != oldKeyDownMap[k])
  55. -           {              
  56. +           {
  57.                 keyDownMap[k] = keyState;
  58.                 if (inputEnabled)
  59.                 {
  60. -                   ActionData *ad = &(*i);
  61. -                   if (ad->event)
  62. +                   const ActionData& ad = *i;
  63. +                   if (ad.event)
  64.                     {
  65. -                       if (ad->state==-1 || keyState == ad->state)
  66. +                       if (ad.state==-1 || keyState == ad.state)
  67.                         {
  68. -                           ad->event->act();
  69. +                           ad.event->act();
  70.                         }
  71.                     }
  72.                     else
  73.                     {
  74. -                       action(ad->id, keyState);
  75. +                       action(ad.id, keyState);
  76.                     }
  77.                     if (core->loopDone) goto out;
  78.                 }
  79. diff -rdu aquaria/BBGE/Core.cpp /media/Lexar/aquaria/BBGE/Core.cpp
  80. --- aquaria/BBGE/Core.cpp   2012-02-11 14:17:52.000000000 +0100
  81. +++ /media/Lexar/aquaria/BBGE/Core.cpp  2012-02-11 01:08:42.000000000 +0100
  82. @@ -1041,10 +1041,7 @@
  83.         hWnd = 0;
  84.     #endif
  85.  
  86. -   for (int i = 0; i < KEY_MAXARRAY; i++)
  87. -   {
  88. -       keys[i] = 0;
  89. -   }
  90. +   std::fill(keys, keys + KEY_MAXARRAY, 0);
  91.  
  92.     aspect = (aspectX/aspectY);//320.0f/240.0f;
  93.     //1.3333334f;
  94. @@ -1353,26 +1350,23 @@
  95.  
  96.  bool Core::getKeyState(int k)
  97.  {
  98. -#ifdef BBGE_BUILD_GLFW
  99. +#if defined(BBGE_BUILD_GLFW)
  100.     return glfwGetKey(k)==GLFW_PRESS;
  101. -#endif
  102. -
  103. -#ifdef BBGE_BUILD_SDL
  104. +#elif defined(BBGE_BUILD_SDL)
  105.     if (k >= KEY_MAXARRAY || k < 0)
  106.     {
  107.         return 0;
  108.     }
  109.     return keys[k];
  110. -#endif
  111. -
  112. -#ifdef BBGE_BUILD_WINDOWS
  113. +#elif defined(BBGE_BUILD_WINDOWS)
  114.     if (k >= KEY_MAXARRAY || k < 0)
  115.     {
  116.         return 0;
  117.     }
  118.     return keys[k];
  119. +#else
  120. +#error "No BBGE_BUILD type defined"
  121.  #endif
  122. -
  123.     return 0;
  124.  }
  125.  
  126. @@ -1524,7 +1518,7 @@
  127.     HRESULT hr;
  128.     BYTE    diks[256];
  129.      // Get the input's device state, and put the state in dims
  130. -    ZeroMemory( diks, sizeof(diks) );
  131. +    std::fill(diks, sizeof(diks) / sizeof(diks[0]), 0);
  132.      hr = g_pKeyboard->GetDeviceState( sizeof(diks), diks );
  133.      if( FAILED(hr) )
  134.      {
  135. diff -rdu aquaria/BBGE/Joystick.cpp /media/Lexar/aquaria/BBGE/Joystick.cpp
  136. --- aquaria/BBGE/Joystick.cpp   2012-02-11 14:17:52.000000000 +0100
  137. +++ /media/Lexar/aquaria/BBGE/Joystick.cpp  2012-02-11 14:00:16.000000000 +0100
  138. @@ -20,6 +20,10 @@
  139.  */
  140.  #include "Core.h"
  141.  
  142. +#ifdef __LINUX__
  143. +#include <unistd.h>
  144. +#endif
  145. +
  146.  #if defined(BBGE_BUILD_WINDOWS) && defined(BBGE_BUILD_XINPUT)
  147.     #include "Xinput.h"
  148.  
  149. @@ -47,9 +51,6 @@
  150.     }
  151.  */
  152.  
  153. -
  154. -
  155. -
  156.  bool tryXInput()
  157.  {
  158.     __try
  159. diff -rdu aquaria/BBGE/Texture.cpp /media/Lexar/aquaria/BBGE/Texture.cpp
  160. --- aquaria/BBGE/Texture.cpp    2012-02-11 14:17:52.000000000 +0100
  161. +++ /media/Lexar/aquaria/BBGE/Texture.cpp   2012-02-11 14:07:08.000000000 +0100
  162. @@ -327,7 +327,7 @@
  163.  
  164.     size_t pos = file.find_last_of('.');
  165.  
  166. -   if ((pos != std::string::npos) && (pos >= 0))
  167. +   if (pos != std::string::npos)
  168.     {
  169.         // make sure this didn't catch the '.' in /home/username/.Aquaria/*  --ryan.
  170.         const std::string userdata = core->getUserDataFolder();
  171. diff -rdu aquaria/BBGE/Vector.h /media/Lexar/aquaria/BBGE/Vector.h
  172. --- aquaria/BBGE/Vector.h   2012-02-11 14:17:52.000000000 +0100
  173. +++ /media/Lexar/aquaria/BBGE/Vector.h  2012-02-11 12:56:08.000000000 +0100
  174. @@ -64,25 +64,25 @@
  175.       }
  176.  
  177.       // vecector equality
  178. -     const bool operator==(const Vector &vec) const
  179. +     bool operator==(const Vector &vec) const
  180.       {
  181.            return ((x == vec.x) && (y == vec.y) && (z == vec.z));
  182.       }
  183.  
  184.       // vecector inequality
  185. -     const bool operator!=(const Vector &vec) const
  186. +     bool operator!=(const Vector &vec) const
  187.       {
  188.            return !(*this == vec);
  189.       }
  190.  
  191.       // vector add
  192. -     const Vector operator+(const Vector &vec) const
  193. +     Vector operator+(const Vector &vec) const
  194.       {
  195.            return Vector(x + vec.x, y + vec.y, z + vec.z);
  196.       }
  197.  
  198.       // vector add (opposite of negation)
  199. -     const Vector operator+() const
  200. +     Vector operator+() const
  201.       {    
  202.            return Vector(*this);
  203.       }
  204. @@ -96,13 +96,13 @@
  205.       }
  206.  
  207.       // vector subtraction
  208. -     const Vector operator-(const Vector& vec) const
  209. +     Vector operator-(const Vector& vec) const
  210.       {    
  211.            return Vector(x - vec.x, y - vec.y, z - vec.z);
  212.       }
  213.      
  214.       // vector negation
  215. -     const Vector operator-() const
  216. +     Vector operator-() const
  217.       {    
  218.            return Vector(-x, -y, -z);
  219.       }
  220. @@ -112,7 +112,7 @@
  221.      }
  222.  
  223.       // vector decrement
  224. -     const Vector &operator-=(const Vector& vec)
  225. +     Vector &operator-=(const Vector& vec)
  226.       {
  227.            x -= vec.x;
  228.            y -= vec.y;
  229. @@ -122,7 +122,7 @@
  230.       }
  231.  
  232.       // scalar self-multiply
  233. -     const Vector &operator*=(const scalar_t &s)
  234. +     Vector &operator*=(const scalar_t &s)
  235.       {
  236.            x *= s;
  237.            y *= s;
  238. @@ -132,7 +132,7 @@
  239.       }
  240.  
  241.       // scalar self-divecide
  242. -     const Vector &operator/=(const scalar_t &s)
  243. +     Vector &operator/=(const scalar_t &s)
  244.       {
  245.            const float recip = 1/s; // for speed, one divecision
  246.  
  247. @@ -144,7 +144,7 @@
  248.       }
  249.  
  250.      // vector self-divide
  251. -     const Vector &operator/=(const Vector &v)
  252. +     Vector &operator/=(const Vector &v)
  253.      {
  254.            x /= v.x;
  255.            y /= v.y;
  256. @@ -153,7 +153,7 @@
  257.            return *this;
  258.       }
  259.  
  260. -     const Vector &operator*=(const Vector &v)
  261. +     Vector &operator*=(const Vector &v)
  262.      {
  263.            x *= v.x;
  264.            y *= v.y;
  265. @@ -164,19 +164,19 @@
  266.  
  267.  
  268.       // post multiply by scalar
  269. -     const Vector operator*(const scalar_t &s) const
  270. +     Vector operator*(const scalar_t &s) const
  271.       {
  272.            return Vector(x*s, y*s, z*s);
  273.       }
  274.  
  275.      // post multiply by Vector
  276. -     const Vector operator*(const Vector &v) const
  277. +     Vector operator*(const Vector &v) const
  278.       {
  279.            return Vector(x*v.x, y*v.y, z*v.z);
  280.       }
  281.  
  282.       // pre multiply by scalar
  283. -     friend inline const Vector operator*(const scalar_t &s, const Vector &vec)
  284. +     friend inline Vector operator*(const scalar_t &s, const Vector &vec)
  285.       {
  286.            return vec*s;
  287.       }
  288. @@ -187,7 +187,7 @@
  289.       }
  290.  */
  291.     // divecide by scalar
  292. -     const Vector operator/(scalar_t s) const
  293. +     Vector operator/(scalar_t s) const
  294.       {
  295.            s = 1/s;
  296.  
  297. @@ -196,7 +196,7 @@
  298.  
  299.  
  300.       // cross product
  301. -     const Vector CrossProduct(const Vector &vec) const
  302. +     Vector CrossProduct(const Vector &vec) const
  303.       {
  304.            return Vector(y*vec.z - z*vec.y, z*vec.x - x*vec.z, x*vec.y - y*vec.x);
  305.       }
  306. @@ -212,41 +212,41 @@
  307.      }
  308.  
  309.       // cross product
  310. -     const Vector operator^(const Vector &vec) const
  311. +     Vector operator^(const Vector &vec) const
  312.       {
  313.            return Vector(y*vec.z - z*vec.y, z*vec.x - x*vec.z, x*vec.y - y*vec.x);
  314.       }
  315.  
  316.       // dot product
  317. -     const scalar_t inline dot(const Vector &vec) const
  318. +     scalar_t inline dot(const Vector &vec) const
  319.       {
  320.            return x*vec.x + y*vec.y + z*vec.z;
  321.       }
  322.  
  323. -    const scalar_t inline dot2D(const Vector &vec) const
  324. +    scalar_t inline dot2D(const Vector &vec) const
  325.      {
  326.          return x*vec.x + y*vec.y;
  327.      }
  328.  
  329.       // dot product
  330. -     const scalar_t operator%(const Vector &vec) const
  331. +     scalar_t operator%(const Vector &vec) const
  332.       {
  333.            return x*vec.x + y*vec.x + z*vec.z;
  334.       }
  335.  
  336.  
  337.       // length of vector
  338. -     const scalar_t inline getLength3D() const
  339. +     scalar_t inline getLength3D() const
  340.       {
  341.            return (scalar_t)sqrtf(x*x + y*y + z*z);
  342.       }
  343. -     const scalar_t inline getLength2D() const
  344. +     scalar_t inline getLength2D() const
  345.       {
  346.            return (scalar_t)sqrtf(x*x + y*y);
  347.       }
  348.  
  349.       // return the unit vector
  350. -    const Vector inline unitVector3D() const
  351. +    Vector inline unitVector3D() const
  352.      {
  353.         return (*this) * (1/getLength3D());
  354.      }
  355. @@ -277,7 +277,7 @@
  356.         }
  357.      }
  358.  
  359. -     const scalar_t operator!() const
  360. +     scalar_t operator!() const
  361.       {
  362.            return sqrtf(x*x + y*y + z*z);
  363.       }
  364. @@ -328,7 +328,7 @@
  365.      }
  366.  
  367.       // return angle between two vectors
  368. -     const float inline Angle(const Vector& normal) const
  369. +     float inline Angle(const Vector& normal) const
  370.       {
  371.            return acosf(*this % normal);
  372.       }
  373. @@ -345,7 +345,7 @@
  374.      const scalar_t inline getCheatLength3D() const;
  375.      */
  376.  
  377. -    const bool inline isLength2DIn(float radius) const
  378. +    bool inline isLength2DIn(float radius) const
  379.      {
  380.         return (x*x + y*y) <= (radius*radius);
  381.      }
  382. @@ -359,20 +359,20 @@
  383.       }
  384.      */
  385.  
  386. -    const void inline setZero()
  387. +    void inline setZero()
  388.      {
  389.         this->x = this->y = this->z = 0;
  390.      }
  391. -    const float inline getSquaredLength2D() const
  392. +    float inline getSquaredLength2D() const
  393.      {
  394.         return (x*x) + (y*y);
  395.      }
  396. -    const bool inline isZero() const
  397. +    bool inline isZero() const
  398.      {
  399.         return x==0 && y==0 && z==0;
  400.      }
  401.  
  402. -    const bool inline isNan() const
  403. +    bool inline isNan() const
  404.      {
  405.  #ifdef BBGE_BUILD_WINDOWS
  406.         return _isnan(x) || _isnan(y) || _isnan(z);
  407. @@ -396,7 +396,7 @@
  408.      }
  409.  
  410.  #ifdef BBGE_BUILD_DIRECTX
  411. -    const D3DCOLOR getD3DColor(float alpha)
  412. +    D3DCOLOR getD3DColor(float alpha)
  413.      {
  414.          return D3DCOLOR_RGBA(int(x*255), int(y*255), int(z*255), int(alpha*255));
  415.      }
  416. diff -rdu aquaria/CMakeLists.txt /media/Lexar/aquaria/CMakeLists.txt
  417. --- aquaria/CMakeLists.txt  2012-02-11 14:17:52.000000000 +0100
  418. +++ /media/Lexar/aquaria/CMakeLists.txt 2012-02-11 14:18:41.000000000 +0100
  419. @@ -16,6 +16,19 @@
  420.      OPTION(AQUARIA_NO_CONSOLE "No console window?" FALSE)
  421.  ENDIF(WIN32)
  422.  
  423. +SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fomit-frame-pointer")
  424. +SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer")
  425. +if (CMAKE_CXX_COMPILER_ID STREQUAL "PathScale")
  426. +   SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -OPT:Olimit=0 -march=auto")
  427. +   SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -OPT:Olimit=0 -march=auto")
  428. +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
  429. +   SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -march=native")
  430. +   SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -march=native")
  431. +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
  432. +   SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -march=native")
  433. +   SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native")
  434. +endif()
  435. +
  436.  # No Steamworks SDK for Linux at the moment. Roll our own achievements.
  437.  ADD_DEFINITIONS(-DBBGE_BUILD_ACHIEVEMENTS_INTERNAL=1)
  438.  
  439. diff -rdu aquaria/ExternalLibs/FTGL/include/FTCharToGlyphIndexMap.h /media/Lexar/aquaria/ExternalLibs/FTGL/include/FTCharToGlyphIndexMap.h
  440. --- aquaria/ExternalLibs/FTGL/include/FTCharToGlyphIndexMap.h   2012-02-11 14:17:52.000000000 +0100
  441. +++ /media/Lexar/aquaria/ExternalLibs/FTGL/include/FTCharToGlyphIndexMap.h  2012-02-11 13:02:00.000000000 +0100
  442. @@ -71,7 +71,7 @@
  443.              }
  444.          }
  445.  
  446. -        const GlyphIndex find( CharacterCode c)
  447. +        GlyphIndex find( CharacterCode c)
  448.          {
  449.              if( !this->Indices)
  450.              {
  451. diff -rdu aquaria/ExternalLibs/FTGL/include/FTGlyphContainer.h /media/Lexar/aquaria/ExternalLibs/FTGL/include/FTGlyphContainer.h
  452. --- aquaria/ExternalLibs/FTGL/include/FTGlyphContainer.h    2012-02-11 14:17:52.000000000 +0100
  453. +++ /media/Lexar/aquaria/ExternalLibs/FTGL/include/FTGlyphContainer.h   2012-02-11 13:02:56.000000000 +0100
  454. @@ -68,7 +68,7 @@
  455.           * @return              An FTGlyph or <code>null</code> is it hasn't been
  456.           * loaded.
  457.           */
  458. -        const FTGlyph* const Glyph( const unsigned int characterCode) const;
  459. +        const FTGlyph* Glyph( const unsigned int characterCode) const;
  460.  
  461.          /**
  462.           * Get the bounding box for a character.
  463. diff -rdu aquaria/ExternalLibs/FTGL/include/FTLibrary.h /media/Lexar/aquaria/ExternalLibs/FTGL/include/FTLibrary.h
  464. --- aquaria/ExternalLibs/FTGL/include/FTLibrary.h   2012-02-11 14:17:52.000000000 +0100
  465. +++ /media/Lexar/aquaria/ExternalLibs/FTGL/include/FTLibrary.h  2012-02-11 13:02:38.000000000 +0100
  466. @@ -41,7 +41,7 @@
  467.           *
  468.           * @return A handle to a FreeType library instance.
  469.           */
  470. -        const FT_Library* const GetLibrary() const { return library;}
  471. +        const FT_Library* GetLibrary() const { return library;}
  472.          
  473.          /**
  474.           * Queries the library for errors.
  475. diff -rdu aquaria/ExternalLibs/FTGL/src/FTGlyphContainer.cpp /media/Lexar/aquaria/ExternalLibs/FTGL/src/FTGlyphContainer.cpp
  476. --- aquaria/ExternalLibs/FTGL/src/FTGlyphContainer.cpp  2012-02-11 14:17:52.000000000 +0100
  477. +++ /media/Lexar/aquaria/ExternalLibs/FTGL/src/FTGlyphContainer.cpp 2012-02-11 13:04:12.000000000 +0100
  478. @@ -47,7 +47,7 @@
  479.  }
  480.  
  481.  
  482. -const FTGlyph* const FTGlyphContainer::Glyph( const unsigned int characterCode) const
  483. +const FTGlyph* FTGlyphContainer::Glyph( const unsigned int characterCode) const
  484.  {
  485.      signed int index = charMap->GlyphListIndex( characterCode);
  486.      return glyphs[index];
  487. Binary files aquaria/.hg/dirstate and /media/Lexar/aquaria/.hg/dirstate differ
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement