Changeset 1794
- Timestamp:
- Aug 23, 2012, 2:32:02 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/input/input.cpp
r1789 r1794 238 238 int InputTracker::GetStatus(Key Button) 239 239 { 240 for (int i = 0; i < m_input_assocation_list.Count(); i++) 241 { 242 ButtonSetting &CurIT = m_input_assocation_list[i]; 243 244 if (Button == CurIT.m_raw_button) 245 return GetCurrentButtonStatus(CurIT.m_raw_button); 246 } 247 return 0; 240 return GetCurrentButtonStatus(Button); 248 241 } 249 242 … … 251 244 bool InputTracker::WasReleased(Key Button) 252 245 { 253 for (int i = 0; i < m_input_assocation_list.Count(); i++) 254 { 255 ButtonSetting &CurIT = m_input_assocation_list[i]; 256 257 if (Button == CurIT.m_raw_button) 258 { 259 if (GetPreviousButtonStatus(CurIT.m_raw_button) && 260 !GetCurrentButtonStatus(CurIT.m_raw_button)) 261 return true; 262 return false; 263 } 264 } 246 if (GetPreviousButtonStatus(Button) && 247 !GetCurrentButtonStatus(Button)) 248 return true; 265 249 return false; 266 250 } … … 269 253 bool InputTracker::WasPressed(Key Button) 270 254 { 271 for (int i = 0; i < m_input_assocation_list.Count(); i++) 272 { 273 ButtonSetting &CurIT = m_input_assocation_list[i]; 274 275 if (Button == CurIT.m_raw_button) 276 { 277 if (!GetPreviousButtonStatus(CurIT.m_raw_button) && 278 GetCurrentButtonStatus(CurIT.m_raw_button)) 279 return true; 280 return false; 281 } 282 } 255 if (!GetPreviousButtonStatus(Button) && 256 GetCurrentButtonStatus(Button)) 257 return true; 283 258 return false; 284 259 } -
trunk/test/BtPhysTest.cpp
r1790 r1794 229 229 WorldEntity::TickGame(seconds); 230 230 231 if (Input:: GetButtonState(27 /*SDLK_ESCAPE*/))231 if (Input::WasReleased(Key::K_ESCAPE)) 232 232 Ticker::Shutdown(); 233 233
Note: See TracChangeset
for help on using the changeset viewer.