Просмотр исходного кода

Merge branch 'next' of https://github.com/blackberry/GamePlay into next

Steve Grenier 13 лет назад
Родитель
Сommit
ddaf8d1dbd

+ 1 - 1
gameplay-template/src/TemplateGame.h

@@ -13,7 +13,7 @@ class TemplateGame: public Game
 public:
 public:
 
 
     /**
     /**
-     * Constructror.
+     * Constructor.
      */
      */
     TemplateGame();
     TemplateGame();
 
 

+ 3 - 1
gameplay/gameplay.xcodeproj/project.pbxproj

@@ -2890,7 +2890,7 @@
 		4234D98C14686BB6003031B3 /* Project object */ = {
 		4234D98C14686BB6003031B3 /* Project object */ = {
 			isa = PBXProject;
 			isa = PBXProject;
 			attributes = {
 			attributes = {
-				LastUpgradeCheck = 0430;
+				LastUpgradeCheck = 0440;
 			};
 			};
 			buildConfigurationList = 4234D98F14686BB6003031B3 /* Build configuration list for PBXProject "gameplay" */;
 			buildConfigurationList = 4234D98F14686BB6003031B3 /* Build configuration list for PBXProject "gameplay" */;
 			compatibilityVersion = "Xcode 3.2";
 			compatibilityVersion = "Xcode 3.2";
@@ -3454,6 +3454,7 @@
 			buildSettings = {
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = NO;
 				COPY_PHASE_STRIP = NO;
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -3504,6 +3505,7 @@
 			buildSettings = {
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
 				COPY_PHASE_STRIP = YES;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";

+ 7 - 7
gameplay/src/Rectangle.cpp

@@ -80,7 +80,7 @@ float Rectangle::bottom() const
 
 
 bool Rectangle::contains(float x, float y) const
 bool Rectangle::contains(float x, float y) const
 {
 {
-    return (x >= x && x <= (x + width) && y >= y && y <= (y + height));
+    return (x >= this->x && x <= (this->x + width) && y >= this->y && y <= (this->y + height));
 }
 }
 
 
 bool Rectangle::contains(float x, float y, float width, float height) const
 bool Rectangle::contains(float x, float y, float width, float height) const
@@ -95,12 +95,12 @@ bool Rectangle::contains(const Rectangle& r) const
 
 
 bool Rectangle::intersects(float x, float y, float width, float height) const
 bool Rectangle::intersects(float x, float y, float width, float height) const
 {
 {
-    const float left   = max(this->x, x);
-    const float top    = max(this->y, y);
-    const float right  = min(x + width, x + width);
-    const float bottom = min(y + height, y + height);
-
-    return (right > left && bottom > top);
+    float t;
+    if ((t = x - this->x) > this->width || -t > width)
+        return false;
+    if ((t = y - this->y) > this->height || -t > height)
+        return false;
+    return true;
 }
 }
 
 
 bool Rectangle::intersects(const Rectangle& r) const
 bool Rectangle::intersects(const Rectangle& r) const

+ 1 - 0
gameplay/src/Rectangle.h

@@ -169,6 +169,7 @@ public:
 
 
     /**
     /**
      * Determines whether a specified rectangle intersects with this rectangle.
      * Determines whether a specified rectangle intersects with this rectangle.
+     * Rectangles intersect if there is a common point that is contained in both rectangles.
      *
      *
      * @param x The x-coordinate of the rectangle.
      * @param x The x-coordinate of the rectangle.
      * @param y The y-coordinate of the rectangle.
      * @param y The y-coordinate of the rectangle.

+ 1 - 1
gameplay/src/SpriteBatch.h

@@ -241,7 +241,7 @@ public:
      * Finishes sprite drawing.
      * Finishes sprite drawing.
      *
      *
      * This method flushes the batch and commits rendering of all sprites that were
      * This method flushes the batch and commits rendering of all sprites that were
-     * drawn since the last call to begin().
+     * drawn since the last call to start().
      */
      */
     void finish();
     void finish();