Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 31, 2011, 5:15:13 PM (13 years ago)
Author:
landauf
Message:

Replaced COUT with orxout in core. Tried to set levels and contexts in a more or less useful way, but not really optimized.

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  
    255255        if (serious)
    256256        {
    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;
    259259        }
    260260        else
    261261        {
    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;
    264264        }
    265265    }
  • code/branches/output/src/libraries/core/input/InputDevice.h

    r8788 r8806  
    135135            //       invalid right until the subclass has been constructed!
    136136            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;
    138138        }
    139139
     
    147147            catch (const OIS::Exception& ex)
    148148            {
    149                 COUT(1) << this->getClassName() << " destruction failed: " << ex.eText << std::endl
    150                         << "    Potential resource leak!" << std::endl;
     149                orxout(internal_error, context::input) << this->getClassName() << " destruction failed: " << ex.eText << '\n'
     150                                                       << "Potential resource leak!" << endl;
    151151            }
    152152        }
  • code/branches/output/src/libraries/core/input/InputManager.cc

    r8729 r8806  
    100100        RegisterRootObject(InputManager);
    101101
    102         CCOUT(4) << "Constructing..." << std::endl;
     102        orxout(internal_status, context::input) << "InputManager: Constructing..." << endl;
    103103
    104104        // Allocate space for the function call buffer
     
    128128        ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(this);
    129129
    130         CCOUT(4) << "Construction complete." << std::endl;
     130        orxout(internal_status, context::input) << "InputManager: Construction complete." << endl;
    131131        internalState_ = Nothing;
    132132    }
     
    143143    void InputManager::loadDevices()
    144144    {
    145         CCOUT(4) << "Loading input devices..." << std::endl;
     145        orxout(internal_info, context::input) << "InputManager: Loading input devices..." << endl;
    146146
    147147        // When loading the devices they should not already be loaded
     
    196196            // Exception-safety
    197197            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;
    199199
    200200            if (oisInputManager_->getNumberOfDevices(OIS::OISKeyboard) > 0)
     
    219219        this->updateActiveStates();
    220220
    221         CCOUT(4) << "Input devices loaded." << std::endl;
     221        orxout(internal_info, context::input) << "Input devices loaded." << endl;
    222222    }
    223223
     
    233233            catch (const std::exception& ex)
    234234            {
    235                 CCOUT(2) << "Warning: Failed to create Mouse:" << ex.what() << std::endl
    236                          << "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;
    241241    }
    242242
     
    252252            catch (const std::exception& ex)
    253253            {
    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;
    255255            }
    256256        }
     
    270270    InputManager::~InputManager()
    271271    {
    272         CCOUT(3) << "Destroying..." << std::endl;
     272        orxout(internal_status, context::input) << "InputManager: Destroying..." << endl;
    273273
    274274        // Leave all active InputStates (except "empty")
     
    295295        ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(0);
    296296
    297         CCOUT(3) << "Destruction complete." << std::endl;
     297        orxout(internal_status, context::input) << "InputManager: Destruction complete." << endl;
    298298    }
    299299
     
    306306    void InputManager::destroyDevices()
    307307    {
    308         CCOUT(4) << "Destroying devices..." << std::endl;
     308        orxout(internal_info, context::input) << "InputManager: Destroying devices..." << endl;
    309309
    310310        BOOST_FOREACH(InputDevice*& device, devices_)
     
    315315            delete device;
    316316            device = 0;
    317             CCOUT(4) << className << " destroyed." << std::endl;
     317            orxout(internal_info, context::input) << className << " destroyed." << endl;
    318318        }
    319319        devices_.resize(InputDeviceEnumerator::FirstJoyStick);
     
    326326        catch (const OIS::Exception& ex)
    327327        {
    328             COUT(1) << "OIS::InputManager destruction failed" << ex.eText << std::endl
    329                     << "    Potential resource leak!" << std::endl;
     328            orxout(internal_error, context::input) << "OIS::InputManager destruction failed" << ex.eText << '\n'
     329                                                   << "Potential resource leak!" << endl;
    330330        }
    331331        oisInputManager_ = NULL;
    332332
    333333        internalState_ |= Bad;
    334         CCOUT(4) << "Destroyed devices." << std::endl;
     334        orxout(internal_info, context::input) << "Destroyed devices." << endl;
    335335    }
    336336
     
    343343    {
    344344        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;
    346346        else
    347347            reloadInternal();
     
    351351    void InputManager::reloadInternal()
    352352    {
    353         CCOUT(4) << "Reloading ..." << std::endl;
     353        orxout(internal_info, context::input) << "InputManager: Reloading ..." << endl;
    354354
    355355        this->destroyDevices();
     
    357357
    358358        internalState_ &= ~Bad;
    359         CCOUT(4) << "Reloading complete." << std::endl;
     359        orxout(internal_info, context::input) << "InputManager: Reloading complete." << endl;
    360360    }
    361361
     
    471471    void InputManager::calibrate()
    472472    {
    473         COUT(0) << "Move all joy stick axes fully in all directions." << std::endl
    474                 << "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;
    475475
    476476        BOOST_FOREACH(InputDevice* device, devices_)
     
    495495        this->clearBuffers();
    496496
    497         COUT(0) << "Calibration has been stored." << std::endl;
     497        orxout(message) << "Calibration has been stored." << endl;
    498498    }
    499499
     
    535535                    if (it->second->getPriority() == priority)
    536536                    {
    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;
    539539                        return 0;
    540540                    }
     
    548548        else
    549549        {
    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;
    551551            return 0;
    552552        }
     
    598598        if (name == "empty")
    599599        {
    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;
    601601            return false;
    602602        }
     
    623623        if (name == "empty")
    624624        {
    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;
    626626            return false;
    627627        }
     
    649649        if (name == "empty")
    650650        {
    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;
    652652            return false;
    653653        }
  • code/branches/output/src/libraries/core/input/JoyStick.cc

    r6536 r8806  
    8080        }
    8181
    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;
    8383
    8484        // Load calibration
  • code/branches/output/src/libraries/core/input/KeyBinder.cc

    r8788 r8806  
    251251    void KeyBinder::loadBindings()
    252252    {
    253         COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
     253        orxout(internal_info, context::input) << "KeyBinder: Loading key bindings..." << endl;
    254254
    255255        this->configFile_ = new ConfigFile(this->filename_, !PathConfig::buildDirectoryRun());
     
    277277        }
    278278
    279         COUT(3) << "KeyBinder: Loading key bindings done." << std::endl;
     279        orxout(internal_info, context::input) << "KeyBinder: Loading key bindings done." << endl;
    280280    }
    281281
     
    294294        else
    295295        {
    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;
    297297            return false;
    298298        }
  • code/branches/output/src/libraries/core/input/KeyBinderManager.cc

    r8788 r8806  
    168168        if (!this->bBinding_)
    169169        {
    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;
    171171            KeyDetector::getInstance().setCallback(createFunctor(&KeyBinderManager::keybindKeyPressed, this));
    172172            InputManager::getInstance().enterState("detector");
     
    185185            if (keyName == "Keys.KeyEscape")
    186186            {
    187                 COUT(0) << "Keybinding aborted." << std::endl;
     187                orxout(message) << "Keybinding aborted." << endl;
    188188            }
    189189            else
    190190            {
    191                 COUT(0) << "Binding string \"" << command_ << "\" on key '" << keyName << "'" << std::endl;
     191                orxout(message) << "Binding string \"" << command_ << "\" on key '" << keyName << "'" << endl;
    192192                this->currentBinder_->setBinding(command_, keyName, bTemporary_);
    193193            }
Note: See TracChangeset for help on using the changeset viewer.