Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1347


Ignore:
Timestamp:
May 21, 2008, 8:56:31 PM (16 years ago)
Author:
rgrieder
Message:
  • gcc knows more…
Location:
code/branches/input/src/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/input/src/core/InputHandler.cc

    r1344 r1347  
    181181
    182182        // evaluate the command
    183         CommandEvaluation& eval = CommandExecutor::evaluate(commandStr);
     183        CommandEvaluation eval = CommandExecutor::evaluate(commandStr);
    184184        if (!eval.isValid())
    185185          continue;
     
    405405      "MYCOMPUTER", "MAIL", "MEDIASELECT"
    406406    };
    407     for (int i = 0; i < nKeys_s; i++)
     407    for (unsigned int i = 0; i < nKeys_s; i++)
    408408      keys_[i].name_ = "Key" + keyNames[i];
    409409
     
    415415      "MouseWheel1Up", "MouseWheel1Down",
    416416      "MouseWheel2Up", "MouseWheel2Down" };
    417     for (int i = 0; i < nMouseButtons_s; i++)
     417    for (unsigned int i = 0; i < nMouseButtons_s; i++)
    418418      mouseButtons_[i].name_ = mouseButtonNames[i];
    419419
    420420    // joy stick buttons
    421     for (int i = 0; i < 32; i++)
     421    for (unsigned int i = 0; i < 32; i++)
    422422      joyStickButtons_[i].name_ = "JoyButton" + getConvertedValue<int, std::string>(i);
    423     for (int i = 32; i < nJoyStickButtons_s; i += 4)
     423    for (unsigned int i = 32; i < nJoyStickButtons_s; i += 4)
    424424    {
    425425                  joyStickButtons_[i + 0].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "North";
     
    527527  void KeyBinder::clearBindings(bool bInit)
    528528  {
    529     for (int i = 0; i < nKeys_s; i++)
     529    for (unsigned int i = 0; i < nKeys_s; i++)
    530530      keys_[i].clear();
    531531
    532     for (int i = 0; i < nMouseButtons_s; i++)
     532    for (unsigned int i = 0; i < nMouseButtons_s; i++)
    533533      mouseButtons_[i].clear();
    534534
    535     for (int i = 0; i < nJoyStickButtons_s; i++)
     535    for (unsigned int i = 0; i < nJoyStickButtons_s; i++)
    536536      joyStickButtons_[i].clear();
    537537
    538     for (int i = 0; i < nHalfAxes_s; i++)
     538    for (unsigned int i = 0; i < nHalfAxes_s; i++)
    539539      halfAxes_[i].clear();
    540540
     
    588588          if (mouseRelative_[i] > 0)
    589589          {
    590             halfAxes_[2*i + 0].absVal_ = mouseRelative_[i] * derivePeriod_ / 500;
     590            halfAxes_[2*i + 0].absVal_ = mouseRelative_[i] * derivePeriod_ / 500 * mouseSensitivity_;
    591591            halfAxes_[2*i + 1].absVal_ = 0.0f;
    592592          }
     
    594594          {
    595595            halfAxes_[2*i + 0].absVal_ = 0.0f;
    596             halfAxes_[2*i + 1].absVal_ = -mouseRelative_[i] * derivePeriod_ / 500;
     596            halfAxes_[2*i + 1].absVal_ = -mouseRelative_[i] * derivePeriod_ / 500 * mouseSensitivity_;
    597597          }
    598598          COUT(3) << mouseRelative_[i] << " | ";
    599           mouseRelative_[i] = 0.0f;
     599          mouseRelative_[i] = 0;
    600600        }
    601601        COUT(3) << std::endl;
     
    652652    {
    653653      // y axis of mouse input is inverted
    654       int rel[] = { rel_.x * mouseSensitivity_, -rel_.y * mouseSensitivity_ };
     654      int rel[] = { rel_.x, -rel_.y };
    655655
    656656      COUT(3) << rel[0] << " | " << rel[1] << std::endl;
     
    668668            {
    669669              halfAxes_[1 + 2*i].hasChanged_ = true;
    670               halfAxes_[1 + 2*i].absVal_ = -((float)mousePosition_[i])/1024;
     670              halfAxes_[1 + 2*i].absVal_ = -((float)mousePosition_[i])/1024 * mouseSensitivity_;
    671671              halfAxes_[0 + 2*i].absVal_ =  0.0f;
    672672            }
    673673            else
    674               halfAxes_[1 + 2*i].absVal_ =  ((float)mousePosition_[i])/1024;
     674              halfAxes_[1 + 2*i].absVal_ =  ((float)mousePosition_[i])/1024 * mouseSensitivity_;
    675675          }
    676676          else
     
    681681            {
    682682              halfAxes_[0 + 2*i].hasChanged_ = true;
    683               halfAxes_[0 + 2*i].absVal_ =  ((float)mousePosition_[i])/1024;
     683              halfAxes_[0 + 2*i].absVal_ =  ((float)mousePosition_[i])/1024 * mouseSensitivity_;
    684684              halfAxes_[1 + 2*i].absVal_ =  0.0f;
    685685            }
    686686            else
    687               halfAxes_[1 + 2*i].absVal_ = -((float)mousePosition_[i])/1024;
     687              halfAxes_[1 + 2*i].absVal_ = -((float)mousePosition_[i])/1024 * mouseSensitivity_;
    688688          }
    689689
    690690          // relative
    691691          if (rel[i] > 0)
    692             halfAxes_[0 + 2*i].relVal_ =  ((float)rel[i])/1024;
     692            halfAxes_[0 + 2*i].relVal_ =  ((float)rel[i])/1024 * mouseSensitivity_;
    693693          else
    694             halfAxes_[1 + 2*i].relVal_ = -((float)rel[i])/1024;
     694            halfAxes_[1 + 2*i].relVal_ = -((float)rel[i])/1024 * mouseSensitivity_;
    695695        }
    696696      }
     
    698698    else
    699699    {
    700       mouseRelative_[0] += rel_.x * mouseSensitivity_;
    701       mouseRelative_[1] -= rel_.y * mouseSensitivity_;
     700      mouseRelative_[0] += rel_.x;
     701      mouseRelative_[1] -= rel_.y;
    702702    }
    703703  }
  • code/branches/input/src/core/InputHandler.h

    r1344 r1347  
    213213    float deriveTime_;
    214214
    215     //**** ConfigValues *****\\
     215    //##### ConfigValues #####
    216216    //! Threshold for analog triggers until which the state is 0.
    217217    float analogThreshold_;
Note: See TracChangeset for help on using the changeset viewer.