diff --git a/Doc/contributors.txt b/Doc/contributors.txt index 9fcefc23..0de4939b 100644 --- a/Doc/contributors.txt +++ b/Doc/contributors.txt @@ -9,6 +9,7 @@ Nikos Barkas (another_commander) Commander McLane Dermot Costello Chris Crowther (hikari) +colinh Jelmer Graafstra James Hobson (Cmdr James) Influence D diff --git a/Oolite.xcodeproj/project.pbxproj b/Oolite.xcodeproj/project.pbxproj index 09b2c87e..76efa75c 100644 --- a/Oolite.xcodeproj/project.pbxproj +++ b/Oolite.xcodeproj/project.pbxproj @@ -19,7 +19,6 @@ 1A274D2510C1EE02004CDDF5 /* PBXTargetDependency */, 1A09EFBD12BD118300BF7F48 /* PBXTargetDependency */, 1ABF219A12D691A300075821 /* PBXTargetDependency */, - 1A3C3F7412E736BC00A679FB /* PBXTargetDependency */, ); name = "Build All"; productName = "Build All"; @@ -401,7 +400,6 @@ 1A3AFF200BC4462200B5E2D9 /* OOJSVector.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3AFF1E0BC4462200B5E2D9 /* OOJSVector.m */; }; 1A3BA259106555D100C5C6F3 /* NSNumberOOExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3BA257106555D100C5C6F3 /* NSNumberOOExtensions.h */; }; 1A3BA25A106555D100C5C6F3 /* NSNumberOOExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3BA258106555D100C5C6F3 /* NSNumberOOExtensions.m */; }; - 1A3C3F7512E736C700A679FB /* Oolite Snow Leopard support.bundle in Copy Plug-ins */ = {isa = PBXBuildFile; fileRef = 1A3C3F6F12E736B100A679FB /* Oolite Snow Leopard support.bundle */; }; 1A3C67FB0F1C910E0000D45B /* OOLegacyScriptWhitelist.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3C67F40F1C90BF0000D45B /* OOLegacyScriptWhitelist.m */; }; 1A3D03151173536C005BF5E6 /* OOMultiTextureMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3D03131173536C005BF5E6 /* OOMultiTextureMaterial.h */; }; 1A3D03161173536C005BF5E6 /* OOMultiTextureMaterial.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3D03141173536C005BF5E6 /* OOMultiTextureMaterial.m */; }; @@ -761,20 +759,6 @@ remoteGlobalIDString = 8D5B49B6048680CD000E48DA; remoteInfo = DebugOXP; }; - 1A3C3F6E12E736B100A679FB /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1A3C3F6A12E736B100A679FB /* SnowLeopardFeatures.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 8D576316048677EA00EA77CD; - remoteInfo = SnowLeopardFeatures; - }; - 1A3C3F7312E736BC00A679FB /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1A3C3F6A12E736B100A679FB /* SnowLeopardFeatures.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 8D57630D048677EA00EA77CD; - remoteInfo = SnowLeopardFeatures; - }; 1A3E019511C574AC000FF226 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 1A3E018E11C574AC000FF226 /* Oolite-importer.xcodeproj */; @@ -884,7 +868,6 @@ files = ( 1ABF219B12D691B300075821 /* Oolite.docktileplugin in Copy Plug-ins */, 1A09EF5812BD0C4100BF7F48 /* Oolite Leopard support.bundle in Copy Plug-ins */, - 1A3C3F7512E736C700A679FB /* Oolite Snow Leopard support.bundle in Copy Plug-ins */, ); name = "Copy Plug-ins"; runOnlyForDeploymentPostprocessing = 0; @@ -1627,7 +1610,7 @@ 1A35256212E1FC0500244C9D /* OOBehaviour.tbl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OOBehaviour.tbl; sourceTree = ""; }; 1A35257012E1FFA900244C9D /* OOConstToJSString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOConstToJSString.h; sourceTree = ""; }; 1A35257112E1FFA900244C9D /* OOConstToJSString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOConstToJSString.m; sourceTree = ""; }; - 1A358CE10C1AB80D00E52220 /* ReadMe.rtfd */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ReadMe.rtfd; path = Doc/ReadMe.rtfd; sourceTree = SOURCE_ROOT; }; + 1A358CE10C1AB80D00E52220 /* ReadMe.rtfd */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; path = ReadMe.rtfd; sourceTree = ""; }; 1A3591690C1C375400E52220 /* oolite-nebula-1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "oolite-nebula-1.png"; sourceTree = ""; }; 1A35916A0C1C375400E52220 /* oolite-star-1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "oolite-star-1.png"; sourceTree = ""; }; 1A35916B0C1C375400E52220 /* oolite-nebula-3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "oolite-nebula-3.png"; sourceTree = ""; }; @@ -1644,7 +1627,6 @@ 1A3AFF1E0BC4462200B5E2D9 /* OOJSVector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOJSVector.m; sourceTree = ""; }; 1A3BA257106555D100C5C6F3 /* NSNumberOOExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSNumberOOExtensions.h; sourceTree = ""; }; 1A3BA258106555D100C5C6F3 /* NSNumberOOExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSNumberOOExtensions.m; sourceTree = ""; }; - 1A3C3F6A12E736B100A679FB /* SnowLeopardFeatures.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SnowLeopardFeatures.xcodeproj; path = "Mac-specific/SnowLeopardFeatures/SnowLeopardFeatures.xcodeproj"; sourceTree = ""; }; 1A3C67F30F1C90BF0000D45B /* OOLegacyScriptWhitelist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOLegacyScriptWhitelist.h; sourceTree = ""; }; 1A3C67F40F1C90BF0000D45B /* OOLegacyScriptWhitelist.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOLegacyScriptWhitelist.m; sourceTree = ""; }; 1A3D03131173536C005BF5E6 /* OOMultiTextureMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOMultiTextureMaterial.h; sourceTree = ""; }; @@ -2090,7 +2072,6 @@ 25F3E8A40994FE65002F25FD /* oolite-document.icns */, 25F3E8A50994FE65002F25FD /* oolite-expansion-document.icns */, 25F3E8A60994FE65002F25FD /* oolite-icon.icns */, - 1A358CE10C1AB80D00E52220 /* ReadMe.rtfd */, 1A2317900B9D022400EF0852 /* AIs */, 1A2316DD0B9CFAD700EF0852 /* Config */, 1A23154D0B9C778400EF0852 /* Images */, @@ -2554,14 +2535,6 @@ path = Tables; sourceTree = ""; }; - 1A3C3F6B12E736B100A679FB /* Products */ = { - isa = PBXGroup; - children = ( - 1A3C3F6F12E736B100A679FB /* Oolite Snow Leopard support.bundle */, - ); - name = Products; - sourceTree = ""; - }; 1A3E018F11C574AC000FF226 /* Products */ = { isa = PBXGroup; children = ( @@ -2597,7 +2570,6 @@ isa = PBXGroup; children = ( 1A09EF4F12BD0C1900BF7F48 /* LeopardFeatures.xcodeproj */, - 1A3C3F6A12E736B100A679FB /* SnowLeopardFeatures.xcodeproj */, 1A01BCDF11C569DF0011197F /* Oolite-docktile.xcodeproj */, 1A3E018E11C574AC000FF226 /* Oolite-importer.xcodeproj */, ); @@ -3139,6 +3111,7 @@ 1AC0E9380B974D8700C46994 /* Documentation */ = { isa = PBXGroup; children = ( + 1A358CE10C1AB80D00E52220 /* ReadMe.rtfd */, 1AC0E9480B974DC200C46994 /* ReadMe.rtfd */, 1AC0E9490B974DC200C46994 /* LICENSE.TXT */, 1AC0E9460B974DC200C46994 /* GPL.TXT */, @@ -3580,10 +3553,6 @@ ProductGroup = 1A3E018F11C574AC000FF226 /* Products */; ProjectRef = 1A3E018E11C574AC000FF226 /* Oolite-importer.xcodeproj */; }, - { - ProductGroup = 1A3C3F6B12E736B100A679FB /* Products */; - ProjectRef = 1A3C3F6A12E736B100A679FB /* SnowLeopardFeatures.xcodeproj */; - }, { ProductGroup = 1AE3455212CB77AC00FD8C62 /* Products */; ProjectRef = 1AE3455112CB77AC00FD8C62 /* Vorbis.xcodeproj */; @@ -3620,13 +3589,6 @@ remoteRef = 1A3042F310C16DA60056219D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A3C3F6F12E736B100A679FB /* Oolite Snow Leopard support.bundle */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Oolite Snow Leopard support.bundle"; - remoteRef = 1A3C3F6E12E736B100A679FB /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 1A3E019611C574AC000FF226 /* Oolite.mdimporter */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; @@ -3966,11 +3928,6 @@ name = DebugOXP; targetProxy = 1A274D2410C1EE02004CDDF5 /* PBXContainerItemProxy */; }; - 1A3C3F7412E736BC00A679FB /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = SnowLeopardFeatures; - targetProxy = 1A3C3F7312E736BC00A679FB /* PBXContainerItemProxy */; - }; 1A3E01A911C574E1000FF226 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "Oolite-importer"; diff --git a/src/Cocoa/MyOpenGLView.m b/src/Cocoa/MyOpenGLView.m index af6c1565..bc21f6b0 100644 --- a/src/Cocoa/MyOpenGLView.m +++ b/src/Cocoa/MyOpenGLView.m @@ -46,12 +46,23 @@ static NSString * kOOLogKeyDown = @"input.keyMapping.keyPress.keyDown"; @interface MyOpenGLView(Internal) -- (int) translateKeyCode: (int) input; -- (void)performLateSetup; +- (int) translateKeyCode:(int)input; +- (void) performLateSetup; + +- (void) recenterVirtualJoystick; @end +#if !OOLITE_SNOW_LEOPARD +@interface NSResponder (SnowLeopard) + +- (void) setAcceptsTouchEvents:(BOOL)value; + +@end +#endif + + @implementation MyOpenGLView - (id) initWithFrame:(NSRect)frameRect @@ -103,6 +114,10 @@ static NSString * kOOLogKeyDown = @"input.keyMapping.keyPress.keyDown"; self = [super initWithFrame:frameRect pixelFormat:pixelFormat]; virtualJoystickPosition = NSMakePoint(0.0,0.0); + if ([self respondsToSelector:@selector(setAcceptsTouchEvents:)]) + { + [self setAcceptsTouchEvents:YES]; + } typedString = [[NSMutableString alloc] initWithString:@""]; allowingStringInput = gvStringInputNo; @@ -645,6 +660,43 @@ static NSString * kOOLogKeyDown = @"input.keyMapping.keyPress.keyDown"; [self setVirtualJoystick:mx :-my]; } + +- (void) mouseDragged:(NSEvent *)theEvent +{ + [self mouseMoved:theEvent]; +} + + +- (void) otherMouseDragged:(NSEvent *)theEvent +{ + [self mouseMoved:theEvent]; +} + + +- (void) rightMouseDown:(NSEvent *)theEvent +{ + [self recenterVirtualJoystick]; +} + + +- (void) rightMouseUp:(NSEvent *)theEvent +{ + [self recenterVirtualJoystick]; +} + + +- (void) touchesEndedWithEvent:(NSEvent *)theEvent +{ + [self recenterVirtualJoystick]; +} + + +- (void) recenterVirtualJoystick +{ + [[GameController sharedController] recenterVirtualJoystick]; +} + + ///////////////////////////////////////////////////////////// /* Turn the Cocoa ArrowKeys into our arrow key constants. */ - (int) translateKeyCode: (int) input diff --git a/src/Core/GameController.h b/src/Core/GameController.h index 1e87c44d..9bc1caa2 100644 --- a/src/Core/GameController.h +++ b/src/Core/GameController.h @@ -180,6 +180,8 @@ MA 02110-1301, USA. - (NSURL *) snapshotsURLCreatingIfNeeded:(BOOL)create; +- (void) recenterVirtualJoystick; + @end diff --git a/src/Core/GameController.m b/src/Core/GameController.m index 82876827..d58dc089 100644 --- a/src/Core/GameController.m +++ b/src/Core/GameController.m @@ -673,9 +673,8 @@ static NSComparisonResult CompareDisplayModes(id arg1, id arg2, void *context) break; case NSRightMouseDown: - my_mouse_x = my_mouse_y = 0; // center mouse + [self recenterVirtualJoystick]; past_first_mouse_delta = NO; - [gameView setVirtualJoystick:0.0 :0.0]; break; case NSLeftMouseUp: @@ -784,6 +783,14 @@ static NSComparisonResult CompareDisplayModes(id arg1, id arg2, void *context) } +- (void) recenterVirtualJoystick +{ + // FIXME: does this really need to be spread across GameController and MyOpenGLView? -- Ahruman 2011-01-22 + my_mouse_x = my_mouse_y = 0; // center mouse + [gameView setVirtualJoystick:0.0 :0.0]; +} + + - (IBAction) showLogAction:sender { [[NSWorkspace sharedWorkspace] openFile:[OOLogHandlerGetLogBasePath() stringByAppendingPathComponent:@"Previous.log"]]; @@ -1415,13 +1422,6 @@ static void LoadSystemSpecificBundles(void) LoadOneSystemSpecificBundle(@"Oolite Leopard support"); OO_DEBUG_POP_PROGRESS(); } - - if (packedVersion >= kSystemVersion10_6) - { - OO_DEBUG_PUSH_PROGRESS(@"Loading Snow Leopard support bundle"); - LoadOneSystemSpecificBundle(@"Oolite Snow Leopard support"); - OO_DEBUG_POP_PROGRESS(); - } } diff --git a/src/Core/OOCocoa.h b/src/Core/OOCocoa.h index b42d758a..dabe4074 100644 --- a/src/Core/OOCocoa.h +++ b/src/Core/OOCocoa.h @@ -69,6 +69,9 @@ MA 02110-1301, USA. #if defined MAC_OS_X_VERSION_10_5 && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 #define OOLITE_LEOPARD 1 #endif + #if defined MAC_OS_X_VERSION_10_6 && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + #define OOLITE_SNOW_LEOPARD 1 + #endif #endif @@ -80,6 +83,10 @@ MA 02110-1301, USA. #define OOLITE_LEOPARD 0 #endif +#ifndef OOLITE_SNOW_LEOPARD + #define OOLITE_SNOW_LEOPARD 0 +#endif + #if OOLITE_GNUSTEP && !defined(OOLITE_SDL_MAC) #include