소스 검색

Fixing a few warnings and errors when building for QNX.

Adam Blake 14 년 전
부모
커밋
1f954182d4
7개의 변경된 파일20개의 추가작업 그리고 17개의 파일을 삭제
  1. 6 4
      gameplay/src/Base.h
  2. 3 2
      gameplay/src/Control.cpp
  3. 2 2
      gameplay/src/Control.h
  4. 3 3
      gameplay/src/Font.cpp
  5. 2 2
      gameplay/src/Slider.cpp
  6. 2 2
      gameplay/src/Slider.h
  7. 2 2
      gameplay/src/Theme.h

+ 6 - 4
gameplay/src/Base.h

@@ -151,10 +151,12 @@ extern void printError(const char* format, ...);
 #define M_1_PI                      0.31830988618379067154
 #endif
 
-inline float round(float r)
-{
-    return (r > 0.0f) ? floor(r + 0.5f) : ceil(r - 0.5f);
-}
+#ifdef WIN32
+    inline float round(float r)
+    {
+        return (r > 0.0f) ? floor(r + 0.5f) : ceil(r - 0.5f);
+    }
+#endif
 
 // NOMINMAX makes sure that windef.h doesn't add macros min and max
 #ifdef WIN32

+ 3 - 2
gameplay/src/Control.cpp

@@ -22,8 +22,9 @@ namespace gameplay
         return _id.c_str();
     }
 
-    const Rectangle& Control::getBounds(bool includePadding) const
+    const Rectangle Control::getBounds(bool includePadding) const
     {
+        // TODO
         return Rectangle();
     }
 
@@ -179,4 +180,4 @@ namespace gameplay
     {
         return _dirty;
     }
-}
+}

+ 2 - 2
gameplay/src/Control.h

@@ -33,7 +33,7 @@ public:
      * Can optionally include the Control's padding.
      * Query getPosition() and getSize() to learn the bounds without border or padding.
      */
-    const Rectangle& getBounds(bool includePadding) const;
+    const Rectangle getBounds(bool includePadding) const;
 
     /**
      * Set the position of this Control relative to its parent Container.
@@ -131,4 +131,4 @@ protected:
 
 }
 
-#endif
+#endif

+ 3 - 3
gameplay/src/Font.cpp

@@ -1245,7 +1245,7 @@ unsigned int Font::getIndexOrLocation(const char* text, const Rectangle& area, u
             return charIndex;
         }
 
-        if (destIndex == charIndex ||
+        if (destIndex == (int)charIndex ||
             (destIndex == -1 &&
              inLocation.x >= xPos && inLocation.x < floor(xPos + ((float)size*0.125f)) &&
              inLocation.y >= yPos && inLocation.y < yPos + size))
@@ -1318,7 +1318,7 @@ unsigned int Font::getIndexOrLocation(const char* text, const Rectangle& area, u
                 }
 
                 // Check against inLocation.
-                if (destIndex == charIndex ||
+                if (destIndex == (int)charIndex ||
                     (destIndex == -1 &&
                     inLocation.x >= xPos && inLocation.x < floor(xPos + g.width*scale + ((float)size*0.125f)) &&
                     inLocation.y >= yPos && inLocation.y < yPos + size))
@@ -1469,7 +1469,7 @@ int Font::handleDelimiters(const char** token, const unsigned int size, const in
         if ((stopAtPosition &&
             stopAtPosition->x >= *xPos && stopAtPosition->x < floor(*xPos + ((float)size*0.5f)) &&
             stopAtPosition->y >= *yPos && stopAtPosition->y < *yPos + size) ||
-            (currentIndex >= 0 && destIndex >= 0 && currentIndex + *lineLength == destIndex))
+            (currentIndex >= 0 && destIndex >= 0 && currentIndex + (int)*lineLength == destIndex))
         {
             // Success + stopAtPosition was reached.
             return 2;

+ 2 - 2
gameplay/src/Slider.cpp

@@ -32,7 +32,7 @@ Slider* Slider::create(Theme::Style* style, Properties* properties)
     return slider;
 }
 
-Slider* Slider::create(const char* id, float min, float max, float default, float step)
+Slider* Slider::create(const char* id, float min, float max, float defaultPosition, float step)
 {
     Slider* slider = new Slider();
 
@@ -155,4 +155,4 @@ void Slider::drawText(const Vector2& position)
 
 }
 
-}
+}

+ 2 - 2
gameplay/src/Slider.h

@@ -18,7 +18,7 @@ public:
     ~Slider();
 
     static Slider* create(Theme::Style* style, Properties* properties);
-    static Slider* create(const char* id, float min, float max, float default = 0.0f, float step = 1.0f);
+    static Slider* create(const char* id, float min, float max, float defaultPosition = 0.0f, float step = 1.0f);
     static Slider* getSlider(const char* id);
 
     void touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex);
@@ -39,4 +39,4 @@ private:
 
 }
 
-#endif
+#endif

+ 2 - 2
gameplay/src/Theme.h

@@ -331,8 +331,8 @@ public:
         Style(const Style& style);
         
         std::string _id;
-        Padding _padding;
         Margin _margin;
+        Padding _padding;
         Overlay* _overlays[MAX_OVERLAYS];
     };
 
@@ -369,4 +369,4 @@ private:
 
 }
 
-#endif
+#endif