------------------------------------------------------------------------------
| 893 | |
| 894 | //------------------------------------------------------------------------------ |
| 895 | const char* ActionMap::getDeadZone( const char* device, const char* action ) |
| 896 | { |
| 897 | U32 deviceType; |
| 898 | U32 deviceInst; |
| 899 | if ( getDeviceTypeAndInstance( device, deviceType, deviceInst ) ) |
| 900 | { |
| 901 | EventDescriptor eventDescriptor; |
| 902 | if ( createEventDescriptor( action, &eventDescriptor ) ) |
| 903 | { |
| 904 | const ActionMap::Node* mapNode = findNode( deviceType, deviceInst, eventDescriptor.flags, eventDescriptor.eventCode ); |
| 905 | if ( mapNode ) |
| 906 | { |
| 907 | if ( mapNode->flags & Node::HasDeadZone ) |
| 908 | { |
| 909 | char buf[64]; |
| 910 | dSprintf( buf, sizeof( buf ), "%g %g", mapNode->deadZoneBegin, mapNode->deadZoneEnd ); |
| 911 | dsize_t returnLen = dStrlen(buf) + 1; |
| 912 | char* returnString = Con::getReturnBuffer( returnLen ); |
| 913 | dStrcpy( returnString, buf, returnLen ); |
| 914 | return( returnString ); |
| 915 | } |
| 916 | else |
| 917 | return( "0 0" ); |
| 918 | } |
| 919 | } |
| 920 | } |
| 921 | |
| 922 | Con::errorf( "The input event specified by %s %s is not in this action map!", device, action ); |
| 923 | return( "" ); |
| 924 | } |
| 925 | |
| 926 | //------------------------------------------------------------------------------ |
| 927 | const char* ActionMap::buildActionString( const InputEventInfo* event ) |
no test coverage detected