Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 31, 2008, 11:24:44 PM (16 years ago)
Author:
rgrieder
Message:
  • set the svn:eol-style property to all files so, that where ever you check out, you'll get the right line endings (had to change every file with mixed endings to windows in order to set the property)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/core/InputManager.cc

    • Property svn:eol-style set to native
    r1468 r1494  
    4141#include "KeyBinder.h"
    4242#include "CommandExecutor.h"
    43 #include "ConsoleCommand.h"
    44 #include "Shell.h"
    45 
     43#include "ConsoleCommand.h"#include "Shell.h"
    4644namespace orxonox
    4745{
     
    152150      addKeyHandler(buffer_, "buffer");
    153151      Shell::getInstance().setInputBuffer(buffer_);
    154 
    155152      keyBinder_ = new KeyBinder();
    156153      keyBinder_->loadBindings();
     
    197194        // register our listener in OIS.
    198195        keyboard_->setEventCallback(this);
    199         // note: OIS will not detect keys that have already been down when the keyboard was created.
    200         CCOUT(ORX_DEBUG) << "Created OIS keyboard" << std::endl;
     196        // note: OIS will not detect keys that have already been down when the keyboard was created.        CCOUT(ORX_DEBUG) << "Created OIS keyboard" << std::endl;
    201197        return true;
    202198      }
     
    314310  void InputManager::setConfigValues()
    315311  {
    316     if (joySticksSize_)
    317     {
    318       std::vector<MultiTypeMath> coeffPos;
     312    if (joySticksSize_)    {      std::vector<MultiTypeMath> coeffPos;
    319313      std::vector<MultiTypeMath> coeffNeg;
    320314      std::vector<MultiTypeMath> zero;
     
    329323      }
    330324
    331       ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");
    332       if (!cont)
    333       {
    334           cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffPos", coeffPos);
    335           getIdentifier()->addConfigValueContainer("CoeffPos", cont);
    336       }
    337       cont->getValue(&coeffPos);
    338 
    339       cont = getIdentifier()->getConfigValueContainer("CoeffNeg");
    340       if (!cont)
    341       {
    342           cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffNeg", coeffNeg);
    343           getIdentifier()->addConfigValueContainer("CoeffNeg", cont);
    344       }
    345       cont->getValue(&coeffNeg);
    346 
    347       cont = getIdentifier()->getConfigValueContainer("Zero");
    348       if (!cont)
    349       {
    350           cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "Zero", zero);
    351           getIdentifier()->addConfigValueContainer("Zero", cont);
    352       }
    353       cont->getValue(&zero);
    354 
    355       // copy values to our own variables
    356       for (unsigned int i = 0; i < 24; i++)
    357       {
    358         joySticksCalibration_[0].positiveCoeff[i] = coeffPos[i];
    359         joySticksCalibration_[0].negativeCoeff[i] = coeffNeg[i];
    360         joySticksCalibration_[0].zeroStates[i]    = zero[i];
    361       }
    362     }
    363   }
     325      ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");      if (!cont)      {          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffPos", coeffPos);          getIdentifier()->addConfigValueContainer("CoeffPos", cont);      }      cont->getValue(&coeffPos);      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");      if (!cont)      {          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffNeg", coeffNeg);          getIdentifier()->addConfigValueContainer("CoeffNeg", cont);      }      cont->getValue(&coeffNeg);      cont = getIdentifier()->getConfigValueContainer("Zero");      if (!cont)      {          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "Zero", zero);          getIdentifier()->addConfigValueContainer("Zero", cont);      }      cont->getValue(&zero);      // copy values to our own variables      for (unsigned int i = 0; i < 24; i++)      {        joySticksCalibration_[0].positiveCoeff[i] = coeffPos[i];        joySticksCalibration_[0].negativeCoeff[i] = coeffNeg[i];        joySticksCalibration_[0].zeroStates[i]    = zero[i];      }    }  }
    364326
    365327  /**
     
    662624      else
    663625        joySticksCalibration_[0].positiveCoeff[i] =  1.0f;
    664 
    665626      // config value
    666       ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");
    667       assert(cont);
    668       cont->set(i, joySticksCalibration_[0].positiveCoeff[i]);
    669 
    670       // negative coefficient
     627      ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");      assert(cont);      cont->set(i, joySticksCalibration_[0].positiveCoeff[i]);      // negative coefficient
    671628      if (marginalsMin_[i] == INT_MAX)
    672629        marginalsMin_[i] = -32768;
    673630      // coefficients
    674631      if (marginalsMin_[i] - joySticksCalibration_[0].zeroStates[i])
    675         joySticksCalibration_[0].negativeCoeff[i] = -1.0f/(marginalsMin_[i] - joySticksCalibration_[0].zeroStates[i]);
    676       else
    677         joySticksCalibration_[0].negativeCoeff[i] =  1.0f;
    678       // config value
    679       cont = getIdentifier()->getConfigValueContainer("CoeffNeg");
    680       assert(cont);
    681       cont->set(i, joySticksCalibration_[0].negativeCoeff[i]);
    682 
    683       // zero states
     632        joySticksCalibration_[0].negativeCoeff[i] = -1.0f/(marginalsMin_[i] - joySticksCalibration_[0].zeroStates[i]);      else        joySticksCalibration_[0].negativeCoeff[i] =  1.0f;      // config value
     633      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");      assert(cont);      cont->set(i, joySticksCalibration_[0].negativeCoeff[i]);      // zero states
    684634      if (i < 8)
    685635      {
     
    697647      }
    698648      // config value
    699       cont = getIdentifier()->getConfigValueContainer("Zero");
    700       assert(cont);
    701       cont->set(i, joySticksCalibration_[0].zeroStates[i]);
    702     }
     649      cont = getIdentifier()->getConfigValueContainer("Zero");      assert(cont);      cont->set(i, joySticksCalibration_[0].zeroStates[i]);    }
    703650  }
    704651
Note: See TracChangeset for help on using the changeset viewer.