MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / getMappedTo

Method getMappedTo

src/InputConfig.cpp:92–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92std::vector<std::string> InputConfig::getMappedTo(Input input)
93{
94 std::vector<std::string> maps;
95
96 typedef std::map<std::string, Input>::iterator it_type;
97 for(it_type iterator = mNameMap.begin(); iterator != mNameMap.end(); iterator++)
98 {
99 Input chk = iterator->second;
100
101 if(!chk.configured)
102 continue;
103
104 if(chk.device == input.device && chk.type == input.type && chk.id == input.id)
105 {
106 if(chk.type == TYPE_HAT)
107 {
108 if(input.value == 0 || input.value & chk.value)
109 {
110 maps.push_back(iterator->first);
111 }
112 continue;
113 }
114
115 if(input.type == TYPE_AXIS)
116 {
117 if(input.value == 0 || chk.value == input.value)
118 maps.push_back(iterator->first);
119 }else{
120 maps.push_back(iterator->first);
121 }
122 }
123 }
124
125 return maps;
126}
127
128void InputConfig::loadFromXML(pugi::xml_node node, int playerNum)
129{

Callers 1

inputMethod · 0.80

Calls 3

push_backMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected