diff --git a/wolf3d/code/iphone/EAGLView.m b/wolf3d/code/iphone/EAGLView.m index 5674408..cf6eeeb 100644 --- a/wolf3d/code/iphone/EAGLView.m +++ b/wolf3d/code/iphone/EAGLView.m @@ -321,8 +321,9 @@ - (void) handleTouches:(NSSet*)touches withEvent:(UIEvent*)event { for (UITouch *myTouch in t) { CGPoint touchLocation = [myTouch locationInView:self]; - - if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft) { + + UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation]; + if (deviceOrientation == UIDeviceOrientationLandscapeLeft || deviceOrientation == UIDeviceOrientationPortrait) { points[ 2 * touchCount + 1 ] = self.bounds.size.width - (self.bounds.size.width - touchLocation.x); points[ 2 * touchCount + 0 ] = self.bounds.size.height - touchLocation.y; } else {