# HG changeset patch # User koda # Date 1264977789 0 # Node ID fb9ad15870544c59a3d08c78f89e5bff3a1d28ae # Parent 52a5a160566f0020cf9f35730d5a2afe8c64fc30 smaller improvements in mouse handling diff -r 52a5a160566f -r fb9ad1587054 cocoaTouch/GameSetup.m --- a/cocoaTouch/GameSetup.m Sun Jan 31 22:15:53 2010 +0000 +++ b/cocoaTouch/GameSetup.m Sun Jan 31 22:43:09 2010 +0000 @@ -98,7 +98,8 @@ addteam addhh is 0 for human, 1-5 for bots (5 is the most stupid) - */ + ammostore is one byte/number for each ammocount then one for each probability or so + */ // local game [self sendToEngine:@"TL"]; @@ -130,7 +131,7 @@ [self sendToEngine:@"e$template_filter 1"]; // theme info - [self sendToEngine:@"etheme Freeway"]; + [self sendToEngine:@"etheme Compost"]; // team 1 info [self sendToEngine:@"eaddteam 4421353 System Cats"]; @@ -150,7 +151,8 @@ [self sendToEngine:@"ehat NoHat"]; // team 1 ammostore - [self sendToEngine:@"eammstore 93919294221991210322351110012010000002110404000441400444645644444774776112211144"]; + [self sendToEngine:@"eammstore 20501090003040000009000000000000000000010404000441400444645644444774776112211144"]; + //[self sendToEngine:@"eammstore 93919294221991210322351110012010000002110404000441400444645644444774776112211144"]; // team 2 info [self sendToEngine:@"eaddteam 4100897 Poke-MAN"]; diff -r 52a5a160566f -r fb9ad1587054 cocoaTouch/SDLOverrides/SDL_uikitview.m --- a/cocoaTouch/SDLOverrides/SDL_uikitview.m Sun Jan 31 22:15:53 2010 +0000 +++ b/cocoaTouch/SDLOverrides/SDL_uikitview.m Sun Jan 31 22:43:09 2010 +0000 @@ -76,6 +76,7 @@ menuButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 480, 30,50)]; [menuButton setBackgroundImage:[UIImage imageNamed:@"Default.png"] forState:UIControlStateNormal]; [menuButton addTarget:[self superclass] action:@selector(attackButtonPressed) forControlEvents:UIControlEventTouchUpInside]; + [menuButton addTarget:[self superclass] action:@selector(attackButtonReleased) forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside]; [self addSubview:menuButton]; @@ -92,12 +93,14 @@ void IPH_showControls (void) { NSLog(@"Showing controls"); - /*[UIView beginAnimations:nil context:NULL]; + /* + [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; attackButton.frame = CGRectMake(30, 430, 260, 50); menuButton.frame = CGRectMake(0, 430, 30, 50); [UIView commitAnimations]; -*/} + */ +} #pragma mark - #pragma mark Superclass methods @@ -174,8 +177,8 @@ initialDistanceForPinching = 0; switch ([touch tapCount]) { case 1: - NSLog(@"x:%d y:%d",(int)gestureStartPoint.x,(int)gestureStartPoint.y); - SDL_WarpMouseInWindow([SDLUIKitDelegate sharedAppDelegate].window, (int)gestureStartPoint.y - 250, (int)gestureStartPoint.x); + SDL_WarpMouseInWindow([SDLUIKitDelegate sharedAppDelegate].window, + (int)gestureStartPoint.y, 320 - (int)gestureStartPoint.x); HW_click(); break; case 2: @@ -243,9 +246,12 @@ switch ([touches count]) { case 1: currentPosition = [touch locationInView:self]; - + // panning + SDL_WarpMouseInWindow([SDLUIKitDelegate sharedAppDelegate].window, + (int)gestureStartPoint.y, 320 - (int)gestureStartPoint.x); // remember that we have x and y inverted - CGFloat vertDiff = gestureStartPoint.x - currentPosition.x; + /* temporarily disabling hog movements for camera panning testing + CGFloat vertDiff = gestureStartPoint.x - currentPosition.x; CGFloat horizDiff = gestureStartPoint.y - currentPosition.y; CGFloat deltaX = fabsf(vertDiff); CGFloat deltaY = fabsf(horizDiff); @@ -259,6 +265,7 @@ if (vertDiff < 0) HW_aimUp(); else HW_aimDown(); } + */ break; case 2: twoTouches = [touches allObjects]; @@ -272,12 +279,10 @@ if (currentDistanceOfPinching < initialDistanceForPinching + kMinimumPinchDelta) { NSLog(@"Outward pinch detected"); HW_zoomOut(); - } - if (currentDistanceOfPinching > initialDistanceForPinching + kMinimumPinchDelta){ + } else if (currentDistanceOfPinching > initialDistanceForPinching + kMinimumPinchDelta){ NSLog(@"Inward pinch detected"); HW_zoomIn(); - } - + } currentDistanceOfPinching = initialDistanceForPinching; break; default: