Merge pull request #239 from dtinth/MacOSX10.9.sdk
Update to Mac OS X 10.10 SDK Here's to hoping this doesn't cause too many problems.
This commit is contained in:
@@ -1757,6 +1757,7 @@
|
||||
EEC7863F0E58208B00F559BC /* StepsDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EEC7863D0E58208B00F559BC /* StepsDisplay.cpp */; };
|
||||
F4BC045409E6B578003F770B /* ScreenGameplaySyncMachine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAB55EB509A7E3D3008FDC69 /* ScreenGameplaySyncMachine.cpp */; };
|
||||
F4BC045509E6B582003F770B /* ScreenGameplaySyncMachine.h in Headers */ = {isa = PBXBuildFile; fileRef = AAB55EB609A7E3D3008FDC69 /* ScreenGameplaySyncMachine.h */; };
|
||||
F8FFD97A19E909ED00AEAA69 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8FFD97919E909ED00AEAA69 /* Accelerate.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -3249,6 +3250,8 @@
|
||||
EE9D33F414B81BE80098EB9C /* jutils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jutils.c; path = ../extern/libjpeg/jutils.c; sourceTree = SOURCE_ROOT; };
|
||||
EEC7863D0E58208B00F559BC /* StepsDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StepsDisplay.cpp; path = ../src/StepsDisplay.cpp; sourceTree = "<group>"; };
|
||||
EEC7863E0E58208B00F559BC /* StepsDisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StepsDisplay.h; path = ../src/StepsDisplay.h; sourceTree = "<group>"; };
|
||||
F8FFD97719E907BA00AEAA69 /* vecLib.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = vecLib.framework; path = ../../../../../System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework; sourceTree = "<group>"; };
|
||||
F8FFD97919E909ED00AEAA69 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -3284,6 +3287,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F8FFD97A19E909ED00AEAA69 /* Accelerate.framework in Frameworks */,
|
||||
AA29CE3C0558741A00961A51 /* Cocoa.framework in Frameworks */,
|
||||
AA29CE3D0558741A00961A51 /* Carbon.framework in Frameworks */,
|
||||
AA29CE3E0558741A00961A51 /* IOKit.framework in Frameworks */,
|
||||
@@ -3506,6 +3510,8 @@
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8FFD97919E909ED00AEAA69 /* Accelerate.framework */,
|
||||
F8FFD97719E907BA00AEAA69 /* vecLib.framework */,
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
|
||||
);
|
||||
@@ -6264,7 +6270,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 0460;
|
||||
LastUpgradeCheck = 0610;
|
||||
};
|
||||
buildConfigurationList = AAC845130856A19700A9FEAB /* Build configuration list for PBXProject "stepmania" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -8317,6 +8323,10 @@
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SYSTEM_LIBRARY_DIR)/Frameworks/Accelerate.framework/Versions/A/Frameworks",
|
||||
);
|
||||
FULL_NAME = "$(PRODUCT_NAME).$(WRAPPER_EXTENSION)";
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
|
||||
GCC_PREFIX_HEADER = "$(SRCROOT)/../src/archutils/Darwin/StepMania.pch";
|
||||
@@ -8388,8 +8398,9 @@
|
||||
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/Libraries";
|
||||
LINKER_DISPLAYS_MANGLED_NAMES = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES;
|
||||
SDKROOT = macosx10.6;
|
||||
SDKROOT = macosx;
|
||||
SHARED_PRECOMPS_DIR = "/Library/Caches/com.apple.Xcode.$(UID)/SharedPrecompiledHeaders/$(PRODUCT_NAME)/$(CONFIGURATION)";
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
STRIP_STYLE = "non-global";
|
||||
@@ -8661,7 +8672,7 @@
|
||||
"HAVE_MEMORY_H=1",
|
||||
"HAVE_WAITPID=1",
|
||||
"SIZEOF_LONG=4",
|
||||
"FPM_INTEL=1",
|
||||
"FPM_64BIT=1",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO;
|
||||
@@ -8691,7 +8702,7 @@
|
||||
"HAVE_MEMORY_H=1",
|
||||
"HAVE_WAITPID=1",
|
||||
"SIZEOF_LONG=4",
|
||||
"FPM_INTEL=1",
|
||||
"FPM_64BIT=1",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO;
|
||||
@@ -8722,7 +8733,7 @@
|
||||
"HAVE_MEMORY_H=1",
|
||||
"HAVE_WAITPID=1",
|
||||
"SIZEOF_LONG=4",
|
||||
"FPM_INTEL=1",
|
||||
"FPM_64BIT=1",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO;
|
||||
@@ -8770,7 +8781,7 @@
|
||||
LINKER_DISPLAYS_MANGLED_NAMES = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES;
|
||||
SDKROOT = macosx10.6;
|
||||
SDKROOT = macosx;
|
||||
SHARED_PRECOMPS_DIR = "/Library/Caches/com.apple.Xcode.$(UID)/SharedPrecompiledHeaders/$(PRODUCT_NAME)/$(CONFIGURATION)";
|
||||
STRIP_STYLE = "non-global";
|
||||
USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../extern/glew-1.5.8/include $(PROJECT_DIR)/../extern/jsoncpp/include $(PROJECT_DIR)/../extern/vorbis";
|
||||
@@ -8785,6 +8796,10 @@
|
||||
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = stabs;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SYSTEM_LIBRARY_DIR)/Frameworks/Accelerate.framework/Versions/A/Frameworks",
|
||||
);
|
||||
FULL_NAME = "$(PRODUCT_NAME).$(WRAPPER_EXTENSION)";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
|
||||
@@ -9007,6 +9022,10 @@
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SYSTEM_LIBRARY_DIR)/Frameworks/Accelerate.framework/Versions/A/Frameworks",
|
||||
);
|
||||
FULL_NAME = "$(PRODUCT_NAME).$(WRAPPER_EXTENSION)";
|
||||
GCC_PREFIX_HEADER = "$(SRCROOT)/../src/archutils/Darwin/StepMania.pch";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = _XOPEN_SOURCE;
|
||||
@@ -9075,7 +9094,7 @@
|
||||
LINKER_DISPLAYS_MANGLED_NAMES = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES;
|
||||
SDKROOT = macosx10.6;
|
||||
SDKROOT = macosx;
|
||||
SHARED_PRECOMPS_DIR = "/Library/Caches/com.apple.Xcode.$(UID)/SharedPrecompiledHeaders/$(PRODUCT_NAME)/$(CONFIGURATION)";
|
||||
STRIP_STYLE = "non-global";
|
||||
USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../extern/glew-1.5.8/include $(PROJECT_DIR)/../extern/jsoncpp/include $(PROJECT_DIR)/../extern/vorbis";
|
||||
|
||||
@@ -223,15 +223,13 @@ void ArchHooks_MacOSX::DumpDebugInfo()
|
||||
// Get system version
|
||||
RString sSystemVersion;
|
||||
{
|
||||
long major = 0, minor = 0, bugFix = 0;
|
||||
|
||||
Gestalt( gestaltSystemVersionMajor, &major );
|
||||
Gestalt( gestaltSystemVersionMinor, &minor );
|
||||
Gestalt( gestaltSystemVersionBugFix, &bugFix );
|
||||
if( bugFix )
|
||||
sSystemVersion = ssprintf( "Mac OS X %ld.%ld.%ld", major, minor, bugFix );
|
||||
char osrelease[256];
|
||||
size_t size = sizeof(osrelease);
|
||||
|
||||
if( sysctlbyname( "kern.osrelease", osrelease, &size, NULL, 0 ) )
|
||||
sSystemVersion = ssprintf( "Mac OS X %s", osrelease );
|
||||
else
|
||||
sSystemVersion = ssprintf( "Mac OS X %ld.%ld", major, minor );
|
||||
sSystemVersion = ssprintf( "Mac OS X Unknown" );
|
||||
}
|
||||
|
||||
size_t size;
|
||||
|
||||
@@ -25,7 +25,7 @@ void InputHandler_MacOSX_HID::QueueCallback( void *target, int result, void *ref
|
||||
IOHIDQueueInterface **queue = (IOHIDQueueInterface **)sender;
|
||||
IOHIDEventStruct event;
|
||||
AbsoluteTime zeroTime = { 0, 0 };
|
||||
HIDDevice *dev = This->m_vDevices[int( refcon )];
|
||||
HIDDevice *dev = This->m_vDevices[size_t( refcon )];
|
||||
vector<DeviceInput> vPresses;
|
||||
|
||||
while( (result = CALL(queue, getNextEvent, &event, zeroTime, 0)) == kIOReturnSuccess )
|
||||
@@ -373,6 +373,50 @@ RString InputHandler_MacOSX_HID::GetDeviceSpecificInputString( const DeviceInput
|
||||
return InputHandler::GetDeviceSpecificInputString( di );
|
||||
}
|
||||
|
||||
// Modified from NESControllerInterface of Macifom project,
|
||||
// used under MIT license from http://macifom.googlecode.com/svn-history/r89/Macifom/trunk/NESControllerInterface.m
|
||||
// Used under MIT license from http://inquisitivecocoa.com/2009/04/05/key-code-translator/
|
||||
static wchar_t KeyCodeToChar(CGKeyCode keyCode, unsigned int modifierFlags)
|
||||
{
|
||||
TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource();
|
||||
CFDataRef uchr = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData);
|
||||
const UCKeyboardLayout *keyboardLayout = (const UCKeyboardLayout*)CFDataGetBytePtr(uchr);
|
||||
|
||||
if( keyboardLayout )
|
||||
{
|
||||
UInt32 deadKeyState = 0;
|
||||
UniCharCount maxStringLength = 255;
|
||||
UniCharCount actualStringLength = 0;
|
||||
UniChar unicodeString[maxStringLength];
|
||||
|
||||
OSStatus status = UCKeyTranslate(keyboardLayout,
|
||||
keyCode, kUCKeyActionDown, modifierFlags,
|
||||
LMGetKbdType(), 0,
|
||||
&deadKeyState,
|
||||
maxStringLength,
|
||||
&actualStringLength, unicodeString);
|
||||
|
||||
if( status != noErr )
|
||||
{
|
||||
fprintf(stderr, "There was an %s error translating from the '%d' key code to a human readable string: %s\n",
|
||||
GetMacOSStatusErrorString(status), (int)status, GetMacOSStatusCommentString(status));
|
||||
}
|
||||
else if( actualStringLength == 0 )
|
||||
{
|
||||
fprintf(stderr, "Couldn't find a translation for the '%d' key code\n", keyCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
return unicodeString[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Couldn't find a translation for the '%d' key code\n", keyCode);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
wchar_t InputHandler_MacOSX_HID::DeviceButtonToChar( DeviceButton button, bool bUseCurrentKeyModifiers )
|
||||
{
|
||||
// KeyTranslate maps these keys to a character. They shouldn't be mapped to any character.
|
||||
@@ -402,71 +446,15 @@ wchar_t InputHandler_MacOSX_HID::DeviceButtonToChar( DeviceButton button, bool b
|
||||
return L'\0';
|
||||
}
|
||||
|
||||
// Find the USB key code for this DeviceButton
|
||||
// Use Text Input Source services to convert the key code to character code.
|
||||
UInt8 iMacVirtualKey;
|
||||
if( KeyboardDevice::DeviceButtonToMacVirtualKey( button, iMacVirtualKey ) )
|
||||
{
|
||||
UInt32 modifiers = 0;
|
||||
if( bUseCurrentKeyModifiers )
|
||||
modifiers = GetCurrentKeyModifiers();
|
||||
|
||||
// todo: handle Caps Lock -freem
|
||||
|
||||
SInt16 iCurrentKeyScript = GetScriptManagerVariable( smKeyScript );
|
||||
SInt16 iCurrentKeyLayoutID = GetScriptVariable( iCurrentKeyScript, smScriptKeys );
|
||||
static SInt16 iLastKeyLayoutID = !iCurrentKeyLayoutID; // Just be different.
|
||||
static UInt32 iDeadKeyState;
|
||||
static UCKeyboardLayout **KeyLayout;
|
||||
|
||||
if( iCurrentKeyLayoutID != iLastKeyLayoutID )
|
||||
UInt32 nModifiers = bUseCurrentKeyModifiers ? GetCurrentKeyModifiers() : 0;
|
||||
wchar_t sCharCode = KeyCodeToChar( iMacVirtualKey, nModifiers );
|
||||
if( sCharCode != 0 )
|
||||
{
|
||||
iDeadKeyState = 0;
|
||||
KeyLayout = (UCKeyboardLayout **)GetResource( 'uchr', iCurrentKeyLayoutID );
|
||||
iLastKeyLayoutID = iCurrentKeyLayoutID;
|
||||
}
|
||||
if( KeyLayout )
|
||||
{
|
||||
UInt32 keyboardType = LMGetKbdType();
|
||||
UInt32 nModifiers = bUseCurrentKeyModifiers ? GetCurrentKeyModifiers() : 0;
|
||||
UniChar unicodeInputString[4];
|
||||
UniCharCount length;
|
||||
OSStatus status = UCKeyTranslate( *KeyLayout, iMacVirtualKey, kUCKeyActionDown, nModifiers,
|
||||
keyboardType, 0, &iDeadKeyState, ARRAYLEN(unicodeInputString),
|
||||
&length, unicodeInputString );
|
||||
|
||||
if( status )
|
||||
return L'\0';
|
||||
|
||||
CFStringRef inputString = CFStringCreateWithCharacters( NULL, unicodeInputString, length );
|
||||
char utf8InputString[7]; // Max size is 6 (although really only 4 are used) + null.
|
||||
|
||||
if( !CFStringGetCString(inputString, utf8InputString, 7, kCFStringEncodingUTF8) )
|
||||
{
|
||||
CFRelease( inputString );
|
||||
return L'\0';
|
||||
}
|
||||
|
||||
wchar_t ch = utf8_get_char( utf8InputString );
|
||||
|
||||
CFRelease( inputString );
|
||||
return ch == INVALID_CHAR ? L'\0' : ch;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fall back on the 'KCHR' resource.
|
||||
static unsigned long state = 0;
|
||||
static Ptr keymap = NULL;
|
||||
Ptr new_keymap;
|
||||
|
||||
new_keymap = (Ptr)GetScriptManagerVariable(smKCHRCache);
|
||||
if( new_keymap != keymap )
|
||||
{
|
||||
keymap = new_keymap;
|
||||
state = 0;
|
||||
}
|
||||
// XXX: Only returns ascii. é will be returned as e.
|
||||
return KeyTranslate( keymap, UInt16(iMacVirtualKey)|modifiers, &state ) & 0xFF;
|
||||
return sCharCode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,18 +59,8 @@ MemoryCardDriverThreaded_MacOSX::~MemoryCardDriverThreaded_MacOSX()
|
||||
}
|
||||
|
||||
void MemoryCardDriverThreaded_MacOSX::Unmount( UsbStorageDevice *pDevice )
|
||||
{
|
||||
ParamBlockRec pb;
|
||||
Str255 name; // A pascal string.
|
||||
const RString& base = Basename( pDevice->sOsMountDir );
|
||||
|
||||
memset( &pb, 0, sizeof(pb) );
|
||||
name[0] = min( base.length(), size_t(255) );
|
||||
strncpy( (char *)&name[1], base, name[0] );
|
||||
pb.volumeParam.ioNamePtr = name;
|
||||
pb.volumeParam.ioVolIndex = -1; // Use ioNamePtr to find the volume.
|
||||
|
||||
if( PBFlushVolSync(&pb) != noErr )
|
||||
{
|
||||
if( sync_volume_np( pDevice->sOsMountDir.c_str(), SYNC_VOLUME_FULLSYNC | SYNC_VOLUME_WAIT ) != 0 )
|
||||
LOG->Warn( "Failed to flush the memory card." );
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ inline Boolean LongValue( CFTypeRef o, long &n )
|
||||
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
#ifndef __LP64__
|
||||
template<>
|
||||
struct hash<IOHIDElementCookie> : private hash<uintptr_t>
|
||||
{
|
||||
@@ -53,6 +54,7 @@ namespace __gnu_cxx
|
||||
return hash<unsigned long>::operator()( uintptr_t(cookie) );
|
||||
}
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
/* This is just awful, these aren't objects, treating them as such
|
||||
|
||||
Reference in New Issue
Block a user