Переглянути джерело

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

setaylor 13 роки тому
батько
коміт
eaea78f5f0

+ 3 - 3
gameplay-newproject.sh

@@ -159,7 +159,7 @@ gpPathAbs=`pwd`
 common_path=$projPath
 back=
 while [ "${gpPathAbs#$common_path}" = "${gpPathAbs}" ]; do
-	common_path=$(dirname $common_path)
+	common_path=$(dirname "$common_path")
 	if [ -z "$back" ]; then
 		back=".."
 	else
@@ -280,9 +280,9 @@ aliassedinplace "s*TEMPLATE_TITLE*$title*g" "$projPath/game.config"
 
 # Open the new project folder, use xdg-open on Linux
 if [[ "$unamestr" == "Linux" ]]; then
-	xdg-open $projPath
+	xdg-open "$projPath"
 else
-	open $projPath
+	open "$projPath"
 fi
 
 exit 0

+ 4 - 56
gameplay/gameplay.xcodeproj/project.pbxproj

@@ -82,8 +82,6 @@
 		42789FDF15B0E83700866F5B /* AIStateMachine.h in Headers */ = {isa = PBXBuildFile; fileRef = 42789FCB15B0E83700866F5B /* AIStateMachine.h */; };
 		428390991489D6E800E2B2F5 /* SceneLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 428390971489D6E800E2B2F5 /* SceneLoader.cpp */; };
 		4283909A1489D6E800E2B2F5 /* SceneLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 428390981489D6E800E2B2F5 /* SceneLoader.h */; };
-		42B701F715B08177002BB8C3 /* liblua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42B701F615B08177002BB8C3 /* liblua.a */; };
-		42B701F915B081B7002BB8C3 /* liblua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42B701F815B081B6002BB8C3 /* liblua.a */; };
 		42B7FAE315B08049002BB8C3 /* ScreenDisplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42B7FADD15B08049002BB8C3 /* ScreenDisplayer.cpp */; };
 		42B7FAE415B08049002BB8C3 /* ScreenDisplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42B7FADD15B08049002BB8C3 /* ScreenDisplayer.cpp */; };
 		42B7FAE515B08049002BB8C3 /* ScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42B7FADE15B08049002BB8C3 /* ScriptController.cpp */; };
@@ -716,12 +714,6 @@
 		42BCD6CD15EFD0F300C0E076 /* lua_VerticalLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42BCD45715EFD0F300C0E076 /* lua_VerticalLayout.cpp */; };
 		42BCD6CE15EFD0F300C0E076 /* lua_VerticalLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 42BCD45815EFD0F300C0E076 /* lua_VerticalLayout.h */; };
 		42BCD6CF15EFD0F300C0E076 /* lua_VerticalLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 42BCD45815EFD0F300C0E076 /* lua_VerticalLayout.h */; };
-		42CCD556146EC1EB00353661 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CCD555146EC1EB00353661 /* libpng.a */; };
-		42CD0DAB147D8EA80000361E /* libbullet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CD0DA6147D8EA80000361E /* libbullet.a */; };
-		42CD0DAC147D8EA80000361E /* libogg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CD0DA7147D8EA80000361E /* libogg.a */; };
-		42CD0DAD147D8EA80000361E /* libvorbis.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CD0DA8147D8EA80000361E /* libvorbis.a */; };
-		42CD0DAE147D8EA80000361E /* libvorbisenc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CD0DA9147D8EA80000361E /* libvorbisenc.a */; };
-		42CD0DAF147D8EA80000361E /* libvorbisfile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CD0DAA147D8EA80000361E /* libvorbisfile.a */; };
 		42CD0E46147D8FF60000361E /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CD0DB1147D8FF50000361E /* Animation.cpp */; };
 		42CD0E47147D8FF60000361E /* Animation.h in Headers */ = {isa = PBXBuildFile; fileRef = 42CD0DB2147D8FF50000361E /* Animation.h */; };
 		42CD0E48147D8FF60000361E /* AnimationClip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42CD0DB3147D8FF50000361E /* AnimationClip.cpp */; };
@@ -910,12 +902,6 @@
 		5B04C57114BFCFE100EB0071 /* SceneLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 428390971489D6E800E2B2F5 /* SceneLoader.cpp */; };
 		5B04C57214BFCFE100EB0071 /* Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4208DEE614A4079F00D3C511 /* Image.cpp */; };
 		5B04C57314BFCFE100EB0071 /* MeshBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4201818D14A41B18008C3F56 /* MeshBatch.cpp */; };
-		5B04C57514BFCFE100EB0071 /* libbullet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CD0DA6147D8EA80000361E /* libbullet.a */; };
-		5B04C57614BFCFE100EB0071 /* libogg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CD0DA7147D8EA80000361E /* libogg.a */; };
-		5B04C57714BFCFE100EB0071 /* libvorbis.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CD0DA8147D8EA80000361E /* libvorbis.a */; };
-		5B04C57814BFCFE100EB0071 /* libvorbisenc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CD0DA9147D8EA80000361E /* libvorbisenc.a */; };
-		5B04C57914BFCFE100EB0071 /* libvorbisfile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CD0DAA147D8EA80000361E /* libvorbisfile.a */; };
-		5B04C57A14BFCFE100EB0071 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CCD555146EC1EB00353661 /* libpng.a */; };
 		5B04C58114BFCFE100EB0071 /* Animation.h in Headers */ = {isa = PBXBuildFile; fileRef = 42CD0DB2147D8FF50000361E /* Animation.h */; };
 		5B04C58214BFCFE100EB0071 /* AnimationClip.h in Headers */ = {isa = PBXBuildFile; fileRef = 42CD0DB4147D8FF50000361E /* AnimationClip.h */; };
 		5B04C58314BFCFE100EB0071 /* AnimationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 42CD0DB6147D8FF50000361E /* AnimationController.h */; };
@@ -1734,14 +1720,7 @@
 				5B2BC7621512514D00D176CD /* QuartzCore.framework in Frameworks */,
 				5B2BC75F1512514500D176CD /* OpenAL.framework in Frameworks */,
 				5B2BC7601512514500D176CD /* OpenGL.framework in Frameworks */,
-				42CD0DAB147D8EA80000361E /* libbullet.a in Frameworks */,
-				42CD0DAC147D8EA80000361E /* libogg.a in Frameworks */,
-				42CD0DAD147D8EA80000361E /* libvorbis.a in Frameworks */,
-				42CD0DAE147D8EA80000361E /* libvorbisenc.a in Frameworks */,
-				42CD0DAF147D8EA80000361E /* libvorbisfile.a in Frameworks */,
-				42CCD556146EC1EB00353661 /* libpng.a in Frameworks */,
 				4234D99E14686C52003031B3 /* Cocoa.framework in Frameworks */,
-				42B701F715B08177002BB8C3 /* liblua.a in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1756,13 +1735,6 @@
 				5BAF202B152F2AF0003E2AC3 /* OpenGLES.framework in Frameworks */,
 				5BAF202C152F2AF0003E2AC3 /* QuartzCore.framework in Frameworks */,
 				5BAF202D152F2AF0003E2AC3 /* UIKit.framework in Frameworks */,
-				5B04C57514BFCFE100EB0071 /* libbullet.a in Frameworks */,
-				5B04C57614BFCFE100EB0071 /* libogg.a in Frameworks */,
-				5B04C57714BFCFE100EB0071 /* libvorbis.a in Frameworks */,
-				5B04C57814BFCFE100EB0071 /* libvorbisenc.a in Frameworks */,
-				5B04C57914BFCFE100EB0071 /* libvorbisfile.a in Frameworks */,
-				5B04C57A14BFCFE100EB0071 /* libpng.a in Frameworks */,
-				42B701F915B081B7002BB8C3 /* liblua.a in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3684,13 +3656,7 @@
 					"../external-deps/oggvorbis/include",
 					./gameplay,
 				);
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SRCROOT)/../external-deps/libpng/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/bullet/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/oggvorbis/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/lua/lib/macosx\"",
-				);
+				LIBRARY_SEARCH_PATHS = "$(inherited)";
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				ONLY_ACTIVE_ARCH = YES;
 				PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
@@ -3729,13 +3695,7 @@
 					"../external-deps/oggvorbis/include",
 					./gameplay,
 				);
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SRCROOT)/../external-deps/libpng/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/bullet/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/oggvorbis/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/lua/lib/macosx\"",
-				);
+				LIBRARY_SEARCH_PATHS = "$(inherited)";
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
 				PRODUCT_NAME = gameplay;
@@ -3775,13 +3735,7 @@
 					"../external-deps/bullet/include",
 					"../external-deps/oggvorbis/include",
 				);
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SRCROOT)/../external-deps/libpng/lib/ios/$(CURRENT_ARCH)\"",
-					"\"$(SRCROOT)/../external-deps/bullet/lib/ios/$(CURRENT_ARCH)\"",
-					"\"$(SRCROOT)/../external-deps/oggvorbis/lib/ios/$(CURRENT_ARCH)\"",
-					"\"$(SRCROOT)/../external-deps/lua/lib/ios/$(CURRENT_ARCH)\"",
-				);
+				LIBRARY_SEARCH_PATHS = "$(inherited)";
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = "-ObjC";
@@ -3823,13 +3777,7 @@
 					"../external-deps/bullet/include",
 					"../external-deps/oggvorbis/include",
 				);
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SRCROOT)/../external-deps/libpng/lib/ios/$(CURRENT_ARCH)\"",
-					"\"$(SRCROOT)/../external-deps/bullet/lib/ios/$(CURRENT_ARCH)\"",
-					"\"$(SRCROOT)/../external-deps/oggvorbis/lib/ios/$(CURRENT_ARCH)\"",
-					"\"$(SRCROOT)/../external-deps/lua/lib/ios/armv7\"",
-				);
+				LIBRARY_SEARCH_PATHS = "$(inherited)";
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				OTHER_LDFLAGS = "-ObjC";
 				PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;

+ 3 - 0
gameplay/src/Container.cpp

@@ -462,6 +462,9 @@ void Container::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needs
         needsClear = true;
     }
 
+    if (!_visible)
+        return;
+
     spriteBatch->start();
     Control::drawBorder(spriteBatch, clip);
     spriteBatch->finish();

+ 19 - 19
gameplay/src/Control.cpp

@@ -249,13 +249,11 @@ void Control::setVisible(bool visible)
 {
     if (visible && !_visible)
     {
-        setEnabled(true);
         _visible = true;
         _dirty = true;
     }
     else if (!visible && _visible)
     {
-        setEnabled(false);
         _visible = false;
         _dirty = true;
     }
@@ -272,7 +270,7 @@ void Control::setOpacity(float opacity, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setOpacity(opacity);
     }
@@ -311,7 +309,7 @@ void Control::setBorder(float top, float bottom, float left, float right, unsign
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setBorder(top, bottom, left, right);
     }
@@ -332,7 +330,7 @@ void Control::setSkinRegion(const Rectangle& region, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setSkinRegion(region, _style->_tw, _style->_th);
     }
@@ -352,7 +350,7 @@ void Control::setSkinColor(const Vector4& color, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setSkinColor(color);
     }
@@ -401,7 +399,7 @@ void Control::setImageRegion(const char* id, const Rectangle& region, unsigned c
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setImageRegion(id, region, _style->_tw, _style->_th);
     }
@@ -422,7 +420,7 @@ void Control::setImageColor(const char* id, const Vector4& color, unsigned char
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setImageColor(id, color);
     }
@@ -450,7 +448,7 @@ void Control::setCursorRegion(const Rectangle& region, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setCursorRegion(region, _style->_tw, _style->_th);
     }
@@ -471,7 +469,7 @@ void Control::setCursorColor(const Vector4& color, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setCursorColor(color);
     }
@@ -499,7 +497,7 @@ void Control::setFont(Font* font, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setFont(font);
     }
@@ -520,7 +518,7 @@ void Control::setFontSize(unsigned int fontSize, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setFontSize(fontSize);
     }
@@ -541,7 +539,7 @@ void Control::setTextColor(const Vector4& color, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setTextColor(color);
     }
@@ -562,7 +560,7 @@ void Control::setTextAlignment(Font::Justify alignment, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setTextAlignment(alignment);
     }
@@ -583,7 +581,7 @@ void Control::setTextRightToLeft(bool rightToLeft, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setTextRightToLeft(rightToLeft);
     }
@@ -969,7 +967,9 @@ void Control::update(const Control* container, const Vector2& offset)
 
     // Cache themed attributes for performance.
     _skin = getSkin(_state);
-    _opacity = getOpacity(_state);
+
+    // Current opacity should be multiplied by that of the parent container.
+    _opacity = getOpacity(_state) * container->_opacity;
 }
 
 void Control::drawBorder(SpriteBatch* spriteBatch, const Rectangle& clip)
@@ -1338,7 +1338,7 @@ void Control::setImageList(Theme::ImageList* imageList, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setImageList(imageList);
     }
@@ -1352,7 +1352,7 @@ void Control::setCursor(Theme::ThemeImage* cursor, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setCursor(cursor);
     }
@@ -1366,7 +1366,7 @@ void Control::setSkin(Theme::Skin* skin, unsigned char states)
     Theme::Style::Overlay* overlays[Theme::Style::OVERLAY_MAX] = { 0 };
     getOverlays(states, overlays);
 
-    for (int i = 0; i < Theme::Style::OVERLAY_MAX - 1 && overlays[i]; ++i)
+    for (int i = 0; i < Theme::Style::OVERLAY_MAX && overlays[i]; ++i)
     {
         overlays[i]->setSkin(skin);
     }

+ 1 - 1
gameplay/src/Label.cpp

@@ -87,7 +87,7 @@ void Label::update(const Control* container, const Vector2& offset)
 
     _font = getFont(_state);
     _textColor = getTextColor(_state);
-    _textColor.w *= getOpacity(_state);
+    _textColor.w *= _opacity;
 }
 
 void Label::drawText(const Rectangle& clip)

+ 19 - 0
gameplay/src/PlatformiOS.mm

@@ -570,8 +570,27 @@ int getUnicode(int key);
 {
     if((evt & Gesture::GESTURE_SWIPE) == Gesture::GESTURE_SWIPE && _swipeRecognizer == NULL)
     {
+        // right swipe (default)
         _swipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeGesture:)];
         [self addGestureRecognizer:_swipeRecognizer];
+
+        // left swipe
+        UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeGesture:)];
+        swipeGesture.direction = UISwipeGestureRecognizerDirectionLeft;
+        [self addGestureRecognizer:swipeGesture];
+        [swipeGesture release];
+        
+        // up swipe
+        UISwipeGestureRecognizer *swipeGesture2 = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeGesture:)];
+        swipeGesture2.direction = UISwipeGestureRecognizerDirectionUp;
+        [self addGestureRecognizer:swipeGesture2];
+        [swipeGesture2 release];
+        
+        // down swipe
+        UISwipeGestureRecognizer *swipeGesture3 = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeGesture:)];
+        swipeGesture3.direction = UISwipeGestureRecognizerDirectionDown;
+        [self addGestureRecognizer:swipeGesture3];
+        [swipeGesture3 release];
     }
     if((evt & Gesture::GESTURE_PINCH) == Gesture::GESTURE_PINCH && _pinchRecognizer == NULL)
     {