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)
CursorControl = new CCursorControl(CreationParams.WindowSize, this);
createDriver();
createGUIAndScene();
initialiseJoysticks();
}
CIrrDeviceMacOSX::~CIrrDeviceMacOSX()
......@@ -987,24 +985,24 @@ bool CIrrDeviceMacOSX::activateJoysticks(core::array<SJoystickInfo> & joystickIn
result = IOMasterPort (bootstrap_port, &masterPort);
if (kIOReturnSuccess != result) {
os::Printer::log("initialiseJoysticks IOMasterPort failed", ELL_ERROR);
return;
return false;
}
hidDictionaryRef = IOServiceMatching (kIOHIDDeviceKey);
if (!hidDictionaryRef) {
os::Printer::log("initialiseJoysticks IOServiceMatching failed", ELL_ERROR);
return;
return false;
}
result = IOServiceGetMatchingServices (masterPort, hidDictionaryRef, &hidIterator);
if (kIOReturnSuccess != result) {
os::Printer::log("initialiseJoysticks IOServiceGetMatchingServices failed", ELL_ERROR);
return;
return false;
}
//no joysticks just return
if (!hidIterator)
return;
return false;
while ((hidObject = IOIteratorNext (hidIterator)))
{
......@@ -1071,13 +1069,14 @@ bool CIrrDeviceMacOSX::activateJoysticks(core::array<SJoystickInfo> & joystickIn
SJoystickInfo returnInfo;
returnInfo.Axes = info.axes;
returnInfo.Hats = info.hats;
returnInfo.Buttons = info.Buttons;
//returnInfo.Hats = info.hats;
returnInfo.Buttons = info.buttons;
returnInfo.Name = info.joystickName;
returnInfo.PovHat = SJoystickInfo::POV_HAT_UNKNOWN;
joystickInfo.push_back(returnInfo);
}
} else
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