From 6adffc12f018f7fbdff4a0bc8fb16ac706db66f6 Mon Sep 17 00:00:00 2001 From: "techdragon.nguyen@gmail.com" Date: Tue, 3 Jan 2012 14:05:43 +0000 Subject: [PATCH] Issue 565: This fixes the issue with the MENU not popping up ingame. The bug was caused when user canceled out of a deck selection screen to either go back to the Player Deck Selection or Main Menu. The buffer was not cleared properly. added call to reset buffer in GameStateDuel to follow pattern used in GameStateDeckViewer. --- JGE/src/iOS/EAGLView.m | 10 ++++++++++ projects/mtg/src/GameStateDuel.cpp | 5 ++++- projects/mtg/wagic.xcodeproj/project.pbxproj | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/JGE/src/iOS/EAGLView.m b/JGE/src/iOS/EAGLView.m index 4c35dcc14..ffef6f9f0 100755 --- a/JGE/src/iOS/EAGLView.m +++ b/JGE/src/iOS/EAGLView.m @@ -383,6 +383,11 @@ static NSString *_MY_AD_WHIRL_APPLICATION_KEY_IPAD = @"2e70e3f3da40408588b9a3170 return newLocation; } +-(void)resetInput +{ + g_engine->ResetInput(); +} + - (void)handlePanMotion: (UIPanGestureRecognizer *) panGesture { @@ -404,6 +409,7 @@ static NSString *_MY_AD_WHIRL_APPLICATION_KEY_IPAD = @"2e70e3f3da40408588b9a3170 { CGPoint v2 = [panGesture velocityInView: self]; BOOL isVerticalSwipe = (fabsf(v2.x) > fabsf( v2.y)) ? NO : YES; + g_engine->LeftClicked(-1, -1); if ( !isVerticalSwipe ) { @@ -419,6 +425,8 @@ static NSString *_MY_AD_WHIRL_APPLICATION_KEY_IPAD = @"2e70e3f3da40408588b9a3170 else g_engine->HoldKey_NoRepeat( JGE_BTN_DOWN ); } + [self performSelector: @selector(resetInput) withObject: nil afterDelay: 0.1]; + } } } @@ -498,12 +506,14 @@ static NSString *_MY_AD_WHIRL_APPLICATION_KEY_IPAD = @"2e70e3f3da40408588b9a3170 { g_engine->HoldKey_NoRepeat(JGE_BTN_CTRL); } + [self performSelector:@selector(resetInput) withObject: nil afterDelay: 0.1]; } - (void)displayGameMenu { g_engine->LeftClicked(-1, -1); // set the click pressed to offscreen g_engine->HoldKey_NoRepeat( JGE_BTN_MENU); + [self performSelector:@selector(resetInput) withObject: nil afterDelay: 0.1]; } - (void)handleMenuWithLongPress:(UILongPressGestureRecognizer *)recognizer { diff --git a/projects/mtg/src/GameStateDuel.cpp b/projects/mtg/src/GameStateDuel.cpp index 3f7534211..ad9ca1896 100644 --- a/projects/mtg/src/GameStateDuel.cpp +++ b/projects/mtg/src/GameStateDuel.cpp @@ -186,6 +186,8 @@ void GameStateDuel::Start() } deckmenu->Add(MENUITEM_CANCEL, "Main Menu", "Return to Main Menu"); } + + mEngine->ResetInput(); } void GameStateDuel::initRand(unsigned int seed) @@ -710,7 +712,8 @@ void GameStateDuel::Render() mFont->SetColor(ARGB(255,255,255,255)); mFont->DrawString(buffer, SCREEN_WIDTH / 2, 0, JGETEXT_CENTER); } - if (menu) menu->Render(); + if (menu) + menu->Render(); } } diff --git a/projects/mtg/wagic.xcodeproj/project.pbxproj b/projects/mtg/wagic.xcodeproj/project.pbxproj index 0b363b0ff..2fc27e955 100755 --- a/projects/mtg/wagic.xcodeproj/project.pbxproj +++ b/projects/mtg/wagic.xcodeproj/project.pbxproj @@ -2560,7 +2560,7 @@ armv6, "$(ARCHS_STANDARD_32_BIT)", ); - CODE_SIGN_IDENTITY = "iPhone Distribution: Michael Nguyen"; + CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -2590,7 +2590,7 @@ "-Wl", ); PRODUCT_NAME = wagic; - PROVISIONING_PROFILE = "6877A0A0-FD2E-42FA-823A-7CD9B1E8E864"; + PROVISIONING_PROFILE = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES;