Commit f0b392d9 authored by teella's avatar teella

minor fix for OSX optional joystick activation like Win and Linux

added example 19.MouseAndJoystick to OSX project


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1719 dfc29bdd-3216-0410-991c-e03cc46cb475
parent cefc1978
...@@ -361,8 +361,6 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param) ...@@ -361,8 +361,6 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param)
CursorControl = new CCursorControl(CreationParams.WindowSize, this); CursorControl = new CCursorControl(CreationParams.WindowSize, this);
createDriver(); createDriver();
createGUIAndScene(); createGUIAndScene();
initialiseJoysticks();
} }
CIrrDeviceMacOSX::~CIrrDeviceMacOSX() CIrrDeviceMacOSX::~CIrrDeviceMacOSX()
...@@ -987,24 +985,24 @@ bool CIrrDeviceMacOSX::activateJoysticks(core::array<SJoystickInfo> & joystickIn ...@@ -987,24 +985,24 @@ bool CIrrDeviceMacOSX::activateJoysticks(core::array<SJoystickInfo> & joystickIn
result = IOMasterPort (bootstrap_port, &masterPort); result = IOMasterPort (bootstrap_port, &masterPort);
if (kIOReturnSuccess != result) { if (kIOReturnSuccess != result) {
os::Printer::log("initialiseJoysticks IOMasterPort failed", ELL_ERROR); os::Printer::log("initialiseJoysticks IOMasterPort failed", ELL_ERROR);
return; return false;
} }
hidDictionaryRef = IOServiceMatching (kIOHIDDeviceKey); hidDictionaryRef = IOServiceMatching (kIOHIDDeviceKey);
if (!hidDictionaryRef) { if (!hidDictionaryRef) {
os::Printer::log("initialiseJoysticks IOServiceMatching failed", ELL_ERROR); os::Printer::log("initialiseJoysticks IOServiceMatching failed", ELL_ERROR);
return; return false;
} }
result = IOServiceGetMatchingServices (masterPort, hidDictionaryRef, &hidIterator); result = IOServiceGetMatchingServices (masterPort, hidDictionaryRef, &hidIterator);
if (kIOReturnSuccess != result) { if (kIOReturnSuccess != result) {
os::Printer::log("initialiseJoysticks IOServiceGetMatchingServices failed", ELL_ERROR); os::Printer::log("initialiseJoysticks IOServiceGetMatchingServices failed", ELL_ERROR);
return; return false;
} }
//no joysticks just return //no joysticks just return
if (!hidIterator) if (!hidIterator)
return; return false;
while ((hidObject = IOIteratorNext (hidIterator))) while ((hidObject = IOIteratorNext (hidIterator)))
{ {
...@@ -1071,12 +1069,13 @@ bool CIrrDeviceMacOSX::activateJoysticks(core::array<SJoystickInfo> & joystickIn ...@@ -1071,12 +1069,13 @@ bool CIrrDeviceMacOSX::activateJoysticks(core::array<SJoystickInfo> & joystickIn
SJoystickInfo returnInfo; SJoystickInfo returnInfo;
returnInfo.Axes = info.axes; returnInfo.Axes = info.axes;
returnInfo.Hats = info.hats; //returnInfo.Hats = info.hats;
returnInfo.Buttons = info.Buttons; returnInfo.Buttons = info.buttons;
returnInfo.Name = info.joystickName; returnInfo.Name = info.joystickName;
returnInfo.PovHat = SJoystickInfo::POV_HAT_UNKNOWN; returnInfo.PovHat = SJoystickInfo::POV_HAT_UNKNOWN;
joystickInfo.push_back(returnInfo); joystickInfo.push_back(returnInfo);
}
} else } else
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment