| 29 | namespace ICS |
| 30 | { |
| 31 | void InputControlSystem::loadKeyBinders(TiXmlElement* xmlControlNode) |
| 32 | { |
| 33 | TiXmlElement* xmlKeyBinder = xmlControlNode->FirstChildElement("KeyBinder"); |
| 34 | while(xmlKeyBinder) |
| 35 | { |
| 36 | Control::ControlChangingDirection dir = Control::STOP; |
| 37 | if(std::string(xmlKeyBinder->Attribute("direction")) == "INCREASE") |
| 38 | { |
| 39 | dir = Control::INCREASE; |
| 40 | } |
| 41 | else if(std::string(xmlKeyBinder->Attribute("direction")) == "DECREASE") |
| 42 | { |
| 43 | dir = Control::DECREASE; |
| 44 | } |
| 45 | |
| 46 | addKeyBinding(mControls.back(), SDL_Scancode(FromString<int>(xmlKeyBinder->Attribute("key"))), dir); |
| 47 | |
| 48 | xmlKeyBinder = xmlKeyBinder->NextSiblingElement("KeyBinder"); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | void InputControlSystem::addKeyBinding(Control* control, SDL_Scancode key, Control::ControlChangingDirection direction) |
| 53 | { |
nothing calls this directly
no test coverage detected