MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / removeNode

Method removeNode

Engine/source/sim/actionMap.cpp:596–633  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

594
595//------------------------------------------------------------------------------
596void 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//------------------------------------------------------------------------------
636const ActionMap::Node* ActionMap::findNode(const U32 inDeviceType, const U32 inDeviceInst,

Callers 8

ActionAddNodeFunction · 0.45
CheetahDAEFunction · 0.45
WheelDaeFunction · 0.45
Cheetah_TurretDAEFunction · 0.45
WheelBackDaeFunction · 0.45
ActionAddNodeFunction · 0.45

Calls 3

dFreeFunction · 0.50
sizeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected