------------------------------------------------------------------------------
| 594 | |
| 595 | //------------------------------------------------------------------------------ |
| 596 | void ActionMap::removeNode(const U32 inDeviceType, const U32 inDeviceInst, const U32 inModifiers, const U32 inAction, SimObject* object /*= NULL*/) |
| 597 | { |
| 598 | // DMMTODO - Slow INITIAL implementation. Replace with a faster version... |
| 599 | // |
| 600 | DeviceMap* pDeviceMap = NULL; |
| 601 | U32 i; |
| 602 | for (i = 0; i < mDeviceMaps.size(); i++) { |
| 603 | if (mDeviceMaps[i]->deviceType == inDeviceType && |
| 604 | mDeviceMaps[i]->deviceInst == inDeviceInst) { |
| 605 | pDeviceMap = mDeviceMaps[i]; |
| 606 | break; |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | if (pDeviceMap == NULL) |
| 611 | return; |
| 612 | |
| 613 | U32 realMods = inModifiers; |
| 614 | if (realMods & SI_SHIFT) |
| 615 | realMods |= SI_SHIFT; |
| 616 | if (realMods & SI_CTRL) |
| 617 | realMods |= SI_CTRL; |
| 618 | if (realMods & SI_ALT) |
| 619 | realMods |= SI_ALT; |
| 620 | if (realMods & SI_MAC_OPT) |
| 621 | realMods |= SI_MAC_OPT; |
| 622 | |
| 623 | for (i = 0; i < pDeviceMap->nodeMap.size(); i++) { |
| 624 | if (pDeviceMap->nodeMap[i].modifiers == realMods && |
| 625 | pDeviceMap->nodeMap[i].action == inAction && |
| 626 | ( (object != NULL) ? object == pDeviceMap->nodeMap[i].object : true )) |
| 627 | { |
| 628 | dFree(pDeviceMap->nodeMap[i].makeConsoleCommand); |
| 629 | dFree(pDeviceMap->nodeMap[i].breakConsoleCommand); |
| 630 | pDeviceMap->nodeMap.erase(i); |
| 631 | } |
| 632 | } |
| 633 | } |
| 634 | |
| 635 | //------------------------------------------------------------------------------ |
| 636 | const ActionMap::Node* ActionMap::findNode(const U32 inDeviceType, const U32 inDeviceInst, |
no test coverage detected