Changeset 1878 for code/trunk/src/core/input/SimpleInputState.cc
- Timestamp:
- Oct 3, 2008, 1:26:48 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/input/SimpleInputState.cc
r1755 r1878 184 184 } 185 185 186 void SimpleInputState::removeAndDestroyAllHandlers()187 {188 for (std::vector<InputTickable*>::iterator it = allHandlers_.begin();189 it != allHandlers_.end(); ++it)190 delete *it;191 192 allHandlers_.clear();193 keyHandler_ = 0;194 mouseHandler_ = 0;195 joyStickHandlerAll_ = 0;196 for (unsigned int iJoyStick = 0; iJoyStick < joyStickHandler_.size(); ++iJoyStick)197 joyStickHandler_[iJoyStick] = 0;198 199 update();200 }186 //void SimpleInputState::removeAndDestroyAllHandlers() 187 //{ 188 // for (std::vector<InputHandler*>::iterator it = allHandlers_.begin(); 189 // it != allHandlers_.end(); ++it) 190 // delete *it; 191 192 // allHandlers_.clear(); 193 // keyHandler_ = 0; 194 // mouseHandler_ = 0; 195 // joyStickHandlerAll_ = 0; 196 // for (unsigned int iJoyStick = 0; iJoyStick < joyStickHandler_.size(); ++iJoyStick) 197 // joyStickHandler_[iJoyStick] = 0; 198 199 // update(); 200 //} 201 201 202 202 /** … … 208 208 True if added, false if handler already existed. 209 209 */ 210 bool SimpleInputState::setHandler(Input Tickable* handler)210 bool SimpleInputState::setHandler(InputHandler* handler) 211 211 { 212 212 setKeyHandler(dynamic_cast<KeyHandler*>(handler)); … … 247 247 { 248 248 // we can use a set to have a list of unique pointers (an object can implement all 3 handlers) 249 std::set<Input Tickable*> tempSet;249 std::set<InputHandler*> tempSet; 250 250 if (keyHandler_) 251 251 tempSet.insert(keyHandler_); … … 258 258 // copy the content of the map back to the actual vector 259 259 allHandlers_.clear(); 260 for (std::set<Input Tickable*>::const_iterator itHandler = tempSet.begin();260 for (std::set<InputHandler*>::const_iterator itHandler = tempSet.begin(); 261 261 itHandler != tempSet.end(); itHandler++) 262 262 allHandlers_.push_back(*itHandler); … … 267 267 for (unsigned int i = 0; i < joyStickHandler_.size(); ++i) 268 268 setInputDeviceEnabled(2 + i, (joyStickHandler_[i] != 0)); 269 270 // inform InputManager that there might be changes in EMPTY_HANDLER situation 271 bHandlersChanged_ = true; 269 272 } 270 273 }
Note: See TracChangeset
for help on using the changeset viewer.