Changeset 8806 for code/branches/output/src/libraries/core/input
- Timestamp:
- Jul 31, 2011, 5:15:13 PM (13 years ago)
- Location:
- code/branches/output/src/libraries/core/input
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/core/input/Button.cc
r8788 r8806 255 255 if (serious) 256 256 { 257 COUT(2) << "Error while parsing binding for button/axis " << this->name_ << ". "258 << message << std::endl;257 orxout(internal_error, context::input) << "Error while parsing binding for button/axis " << this->name_ << ". " 258 << message << endl; 259 259 } 260 260 else 261 261 { 262 COUT(3) << "Warning while parsing binding for button/axis " << this->name_ << ". "263 << message << std::endl;262 orxout(internal_warning, context::input) << "Warning while parsing binding for button/axis " << this->name_ << ". " 263 << message << endl; 264 264 } 265 265 } -
code/branches/output/src/libraries/core/input/InputDevice.h
r8788 r8806 135 135 // invalid right until the subclass has been constructed! 136 136 oisDevice_->setEventCallback(static_cast<DeviceClass*>(this)); 137 COUT(4) << "Instantiated a " << this->getClassName() << std::endl;137 orxout(verbose, context::input) << "Instantiated a " << this->getClassName() << endl; 138 138 } 139 139 … … 147 147 catch (const OIS::Exception& ex) 148 148 { 149 COUT(1) << this->getClassName() << " destruction failed: " << ex.eText << std::endl150 << " Potential resource leak!" << std::endl;149 orxout(internal_error, context::input) << this->getClassName() << " destruction failed: " << ex.eText << '\n' 150 << "Potential resource leak!" << endl; 151 151 } 152 152 } -
code/branches/output/src/libraries/core/input/InputManager.cc
r8729 r8806 100 100 RegisterRootObject(InputManager); 101 101 102 CCOUT(4) << "Constructing..." << std::endl;102 orxout(internal_status, context::input) << "InputManager: Constructing..." << endl; 103 103 104 104 // Allocate space for the function call buffer … … 128 128 ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(this); 129 129 130 CCOUT(4) << "Construction complete." << std::endl;130 orxout(internal_status, context::input) << "InputManager: Construction complete." << endl; 131 131 internalState_ = Nothing; 132 132 } … … 143 143 void InputManager::loadDevices() 144 144 { 145 CCOUT(4) << "Loading input devices..." << std::endl;145 orxout(internal_info, context::input) << "InputManager: Loading input devices..." << endl; 146 146 147 147 // When loading the devices they should not already be loaded … … 196 196 // Exception-safety 197 197 Loki::ScopeGuard guard = Loki::MakeGuard(OIS::InputManager::destroyInputSystem, oisInputManager_); 198 CCOUT(4) << "Created OIS input manager." << std::endl;198 orxout(internal_info, context::input) << "Created OIS input manager." << endl; 199 199 200 200 if (oisInputManager_->getNumberOfDevices(OIS::OISKeyboard) > 0) … … 219 219 this->updateActiveStates(); 220 220 221 CCOUT(4) << "Input devices loaded." << std::endl;221 orxout(internal_info, context::input) << "Input devices loaded." << endl; 222 222 } 223 223 … … 233 233 catch (const std::exception& ex) 234 234 { 235 CCOUT(2) << "Warning: Failed to create Mouse:" << ex.what() << std::endl236 << "Proceeding without mouse support." << std::endl;237 } 238 } 239 else 240 CCOUT(2) << "Warning: No mouse found! Proceeding without mouse support." << std::endl;235 orxout(user_warning, context::input) << "Failed to create Mouse:" << ex.what() << '\n' 236 << "Proceeding without mouse support." << endl; 237 } 238 } 239 else 240 orxout(user_warning, context::input) << "No mouse found! Proceeding without mouse support." << endl; 241 241 } 242 242 … … 252 252 catch (const std::exception& ex) 253 253 { 254 CCOUT(2) << "Warning: Failed to create joy stick: " << ex.what() << std::endl;254 orxout(user_warning, context::input) << "Failed to create joy stick: " << ex.what() << endl; 255 255 } 256 256 } … … 270 270 InputManager::~InputManager() 271 271 { 272 CCOUT(3) << "Destroying..." << std::endl;272 orxout(internal_status, context::input) << "InputManager: Destroying..." << endl; 273 273 274 274 // Leave all active InputStates (except "empty") … … 295 295 ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(0); 296 296 297 CCOUT(3) << "Destruction complete." << std::endl;297 orxout(internal_status, context::input) << "InputManager: Destruction complete." << endl; 298 298 } 299 299 … … 306 306 void InputManager::destroyDevices() 307 307 { 308 CCOUT(4) << "Destroying devices..." << std::endl;308 orxout(internal_info, context::input) << "InputManager: Destroying devices..." << endl; 309 309 310 310 BOOST_FOREACH(InputDevice*& device, devices_) … … 315 315 delete device; 316 316 device = 0; 317 CCOUT(4) << className << " destroyed." << std::endl;317 orxout(internal_info, context::input) << className << " destroyed." << endl; 318 318 } 319 319 devices_.resize(InputDeviceEnumerator::FirstJoyStick); … … 326 326 catch (const OIS::Exception& ex) 327 327 { 328 COUT(1) << "OIS::InputManager destruction failed" << ex.eText << std::endl329 << " Potential resource leak!" << std::endl;328 orxout(internal_error, context::input) << "OIS::InputManager destruction failed" << ex.eText << '\n' 329 << "Potential resource leak!" << endl; 330 330 } 331 331 oisInputManager_ = NULL; 332 332 333 333 internalState_ |= Bad; 334 CCOUT(4) << "Destroyed devices." << std::endl;334 orxout(internal_info, context::input) << "Destroyed devices." << endl; 335 335 } 336 336 … … 343 343 { 344 344 if (internalState_ & Calibrating) 345 CCOUT(2) << "Warning: Cannot reload input system. Joy sticks are currently being calibrated." << std::endl;345 orxout(internal_warning, context::input) << "Cannot reload input system. Joy sticks are currently being calibrated." << endl; 346 346 else 347 347 reloadInternal(); … … 351 351 void InputManager::reloadInternal() 352 352 { 353 CCOUT(4) << "Reloading ..." << std::endl;353 orxout(internal_info, context::input) << "InputManager: Reloading ..." << endl; 354 354 355 355 this->destroyDevices(); … … 357 357 358 358 internalState_ &= ~Bad; 359 CCOUT(4) << "Reloading complete." << std::endl;359 orxout(internal_info, context::input) << "InputManager: Reloading complete." << endl; 360 360 } 361 361 … … 471 471 void InputManager::calibrate() 472 472 { 473 COUT(0) << "Move all joy stick axes fully in all directions." << std::endl474 << "When done, put the axex in the middle position and press enter." << std::endl;473 orxout(message) << "Move all joy stick axes fully in all directions." << '\n' 474 << "When done, put the axex in the middle position and press enter." << endl; 475 475 476 476 BOOST_FOREACH(InputDevice* device, devices_) … … 495 495 this->clearBuffers(); 496 496 497 COUT(0) << "Calibration has been stored." << std::endl;497 orxout(message) << "Calibration has been stored." << endl; 498 498 } 499 499 … … 535 535 if (it->second->getPriority() == priority) 536 536 { 537 COUT(2) << "Warning:Could not add an InputState with the same priority '"538 << static_cast<int>(priority) << "' != 0." << std::endl;537 orxout(internal_warning, context::input) << "Could not add an InputState with the same priority '" 538 << static_cast<int>(priority) << "' != 0." << endl; 539 539 return 0; 540 540 } … … 548 548 else 549 549 { 550 COUT(2) << "Warning: Could not add an InputState with the same name '" << name << "'." << std::endl;550 orxout(internal_warning, context::input) << "Could not add an InputState with the same name '" << name << "'." << endl; 551 551 return 0; 552 552 } … … 598 598 if (name == "empty") 599 599 { 600 COUT(2) << "InputManager: Leaving the empty state is not allowed!" << std::endl;600 orxout(internal_warning, context::input) << "InputManager: Leaving the empty state is not allowed!" << endl; 601 601 return false; 602 602 } … … 623 623 if (name == "empty") 624 624 { 625 COUT(2) << "InputManager: Removing the empty state is not allowed!" << std::endl;625 orxout(internal_warning, context::input) << "InputManager: Removing the empty state is not allowed!" << endl; 626 626 return false; 627 627 } … … 649 649 if (name == "empty") 650 650 { 651 COUT(2) << "InputManager: Changing the empty state is not allowed!" << std::endl;651 orxout(internal_warning, context::input) << "InputManager: Changing the empty state is not allowed!" << endl; 652 652 return false; 653 653 } -
code/branches/output/src/libraries/core/input/JoyStick.cc
r6536 r8806 80 80 } 81 81 82 COUT(4) << "Created OIS joy stick with ID " << deviceName_ << std::endl;82 orxout(verbose, context::input) << "Created OIS joy stick with ID " << deviceName_ << endl; 83 83 84 84 // Load calibration -
code/branches/output/src/libraries/core/input/KeyBinder.cc
r8788 r8806 251 251 void KeyBinder::loadBindings() 252 252 { 253 COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;253 orxout(internal_info, context::input) << "KeyBinder: Loading key bindings..." << endl; 254 254 255 255 this->configFile_ = new ConfigFile(this->filename_, !PathConfig::buildDirectoryRun()); … … 277 277 } 278 278 279 COUT(3) << "KeyBinder: Loading key bindings done." << std::endl;279 orxout(internal_info, context::input) << "KeyBinder: Loading key bindings done." << endl; 280 280 } 281 281 … … 294 294 else 295 295 { 296 COUT(2) << "Could not find key/button/axis with name '" << name << "'." << std::endl;296 orxout(internal_warning, context::input) << "Could not find key/button/axis with name '" << name << "'." << endl; 297 297 return false; 298 298 } -
code/branches/output/src/libraries/core/input/KeyBinderManager.cc
r8788 r8806 168 168 if (!this->bBinding_) 169 169 { 170 COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl;170 orxout(message) << "Press any button/key or move a mouse/joystick axis" << endl; 171 171 KeyDetector::getInstance().setCallback(createFunctor(&KeyBinderManager::keybindKeyPressed, this)); 172 172 InputManager::getInstance().enterState("detector"); … … 185 185 if (keyName == "Keys.KeyEscape") 186 186 { 187 COUT(0) << "Keybinding aborted." << std::endl;187 orxout(message) << "Keybinding aborted." << endl; 188 188 } 189 189 else 190 190 { 191 COUT(0) << "Binding string \"" << command_ << "\" on key '" << keyName << "'" << std::endl;191 orxout(message) << "Binding string \"" << command_ << "\" on key '" << keyName << "'" << endl; 192 192 this->currentBinder_->setBinding(command_, keyName, bTemporary_); 193 193 }
Note: See TracChangeset
for help on using the changeset viewer.