зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1359670 - Notify GamepadManager when controllers are removed in VRPuppet manager; r=kip
MozReview-Commit-ID: KSlpJy8i7Xo --HG-- extra : rebase_source : 416e8fa155c15829f0c488a2a1bf5f4924a5f375
This commit is contained in:
Родитель
3a6ad95915
Коммит
22637d7222
|
@ -478,13 +478,7 @@ VRSystemManagerPuppet::ScanForControllers()
|
|||
const uint32_t newControllerCount = 2;
|
||||
|
||||
if (newControllerCount != mControllerCount) {
|
||||
// controller count is changed, removing the existing gamepads first.
|
||||
for (uint32_t i = 0; i < mPuppetController.Length(); ++i) {
|
||||
RemoveGamepad(i);
|
||||
}
|
||||
|
||||
mControllerCount = 0;
|
||||
mPuppetController.Clear();
|
||||
RemoveControllers();
|
||||
|
||||
// Re-adding controllers to VRControllerManager.
|
||||
for (uint32_t i = 0; i < newControllerCount; ++i) {
|
||||
|
@ -503,6 +497,10 @@ VRSystemManagerPuppet::ScanForControllers()
|
|||
void
|
||||
VRSystemManagerPuppet::RemoveControllers()
|
||||
{
|
||||
// controller count is changed, removing the existing gamepads first.
|
||||
for (uint32_t i = 0; i < mPuppetController.Length(); ++i) {
|
||||
RemoveGamepad(i);
|
||||
}
|
||||
mPuppetController.Clear();
|
||||
mControllerCount = 0;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче