Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 20, 2009, 9:20:47 AM (15 years ago)
Author:
rgrieder
Message:

Merged pch branch back to trunk.

Location:
code/trunk
Files:
2 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/input/CMakeLists.txt

    r2710 r3196  
    11ADD_SOURCE_FILES(CORE_SRC_FILES
    22  Button.cc
    3   CalibratorCallback.cc
    43  ExtendedInputState.cc
    54  HalfAxis.cc
  • code/trunk/src/core/input/ExtendedInputState.cc

    r2896 r3196  
    3636
    3737#include <cassert>
    38 #include "util/Debug.h"
     38#include "core/Executor.h"
    3939
    4040namespace orxonox
     
    457457        this->bHandlersChanged_ = true;
    458458    }
     459
     460    void ExtendedInputState::onEnter()
     461    {
     462        if (executorOnEnter_)
     463            (*executorOnEnter_)();
     464    }
     465
     466    void ExtendedInputState::onLeave()
     467    {
     468        if (executorOnLeave_)
     469            (*executorOnLeave_)();
     470    }
    459471}
  • code/trunk/src/core/input/ExtendedInputState.h

    r2896 r3196  
    3838
    3939#include <vector>
    40 
    4140#include "InputInterfaces.h"
    4241#include "InputState.h"
     
    8988        void update();
    9089
     90        void onEnter();
     91        void onLeave();
     92
    9193        std::vector<KeyHandler*>                    keyHandlers_;
    9294        std::vector<MouseHandler*>                  mouseHandlers_;
  • code/trunk/src/core/input/HalfAxis.h

    r2087 r3196  
    3737
    3838#include "core/CorePrereqs.h"
     39
    3940#include "Button.h"
    4041#include "InputCommands.h"
  • code/trunk/src/core/input/InputBuffer.cc

    r2896 r3196  
    2828
    2929#include "InputBuffer.h"
    30 
    31 #include <iostream>
    3230
    3331#include "util/Clipboard.h"
     
    5755    }
    5856
    59     InputBuffer::InputBuffer(const std::string allowedChars)
     57    InputBuffer::InputBuffer(const std::string& allowedChars)
    6058    {
    6159        RegisterRootObject(InputBuffer);
  • code/trunk/src/core/input/InputBuffer.h

    r2896 r3196  
    3232#include "core/CorePrereqs.h"
    3333
     34#include <list>
    3435#include <string>
    35 #include <list>
    36 
    3736#include "core/OrxonoxClass.h"
    3837#include "InputInterfaces.h"
     
    8079            InputBuffer();
    8180            ~InputBuffer();
    82             InputBuffer(const std::string allowedChars);
     81            InputBuffer(const std::string& allowedChars);
    8382
    8483            void setConfigValues();
     
    145144            void updated(const char& update, bool bSingleInput);
    146145
    147             inline std::string get() const
     146            inline const std::string& get() const
    148147                { return this->buffer_; }
    149148            inline unsigned int getSize() const
  • code/trunk/src/core/input/InputCommands.cc

    r2087 r3196  
    3535#include "InputCommands.h"
    3636#include "util/Math.h"
    37 #include "core/CommandExecutor.h"
    3837
    3938namespace orxonox
  • code/trunk/src/core/input/InputInterfaces.h

    r2896 r3196  
    3838#include "core/CorePrereqs.h"
    3939
    40 #include "ois/OISKeyboard.h"
    41 #include "ois/OISMouse.h"
    42 #include "ois/OISJoyStick.h"
     40#include <ois/OISKeyboard.h>
     41#include <ois/OISMouse.h>
     42#include <ois/OISJoyStick.h>
    4343#include "util/Math.h"
    4444
  • code/trunk/src/core/input/InputManager.cc

    r3084 r3196  
    3838#include <climits>
    3939#include <cassert>
    40 
    41 #include "ois/OISException.h"
    42 #include "ois/OISInputManager.h"
    43 #include "core/ConsoleCommand.h"
    44 
    45 // HACK
    46 #ifdef ORXONOX_PLATFORM_LINUX
    47 #  include "ois/linux/LinuxMouse.h"
    48 #endif
    49 
     40#include <ois/OISException.h>
     41#include <ois/OISInputManager.h>
     42
     43#include "util/Convert.h"
    5044#include "util/Exception.h"
     45#include "util/Debug.h"
    5146#include "core/Clock.h"
    5247#include "core/CoreIncludes.h"
    5348#include "core/ConfigValueIncludes.h"
    54 #include "core/CommandExecutor.h"
     49#include "core/ConsoleCommand.h"
    5550#include "core/CommandLine.h"
    56 #include "util/Debug.h"
    5751
    5852#include "InputBuffer.h"
    59 #include "KeyBinder.h"
    6053#include "KeyDetector.h"
    61 #include "CalibratorCallback.h"
    6254#include "InputState.h"
    6355#include "SimpleInputState.h"
    6456#include "ExtendedInputState.h"
    6557#include "JoyStickDeviceNumberListener.h"
     58
     59// HACK (include this as last, X11 seems to define some macros...)
     60#ifdef ORXONOX_PLATFORM_LINUX
     61#  include <ois/linux/LinuxMouse.h>
     62#endif
    6663
    6764namespace orxonox
     
    367364        for (unsigned int i = 0; i < configValueVectorSize; ++i)
    368365        {
    369             list[i] = omni_cast<int>(ConfigFileManager::getInstance().getValue(
    370                 ConfigFileType::JoyStickCalibration, sectionName, valueName, i, omni_cast<std::string>(defaultValue), false));
     366            list[i] = multi_cast<int>(ConfigFileManager::getInstance().getValue(
     367                ConfigFileType::JoyStickCalibration, sectionName, valueName, i, multi_cast<std::string>(defaultValue), false));
    371368        }
    372369
     
    403400            // Generate some sort of execution unique id per joy stick
    404401            std::string id = "JoyStick_";
    405             id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Button))  + "_";
    406             id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Axis))    + "_";
    407             id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Slider))  + "_";
    408             id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_POV))     + "_";
    409             id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Vector3)) + "_";
     402            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Button))  + "_";
     403            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Axis))    + "_";
     404            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Slider))  + "_";
     405            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_POV))     + "_";
     406            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Vector3)) + "_";
    410407            id += joySticks_[iJoyStick]->vendor();
    411408            for (unsigned int i = 0; i < iJoyStick; ++i)
     
    414411                {
    415412                    // Two joysticks are probably equal --> add the index as well
    416                     id += "_" + omni_cast<std::string>(iJoyStick);
     413                    id += "_" + multi_cast<std::string>(iJoyStick);
    417414                }
    418415            }
     
    497494                    joyStickMinValues_[iJoyStick][i] = -32768;
    498495                ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
    499                     this->joyStickIDs_[iJoyStick], "MinValue", i, omni_cast<std::string>(joyStickMinValues_[iJoyStick][i]), false);
     496                    this->joyStickIDs_[iJoyStick], "MinValue", i, multi_cast<std::string>(joyStickMinValues_[iJoyStick][i]), false);
    500497
    501498                // Maximum values
     
    503500                    joyStickMaxValues_[iJoyStick][i] = 32767;
    504501                ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
    505                     this->joyStickIDs_[iJoyStick], "MaxValue", i, omni_cast<std::string>(joyStickMaxValues_[iJoyStick][i]), false);
     502                    this->joyStickIDs_[iJoyStick], "MaxValue", i, multi_cast<std::string>(joyStickMaxValues_[iJoyStick][i]), false);
    506503
    507504                // Middle values
    508505                ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
    509                     this->joyStickIDs_[iJoyStick], "MiddleValue", i, omni_cast<std::string>(joyStickMiddleValues_[iJoyStick][i]), false);
     506                    this->joyStickIDs_[iJoyStick], "MiddleValue", i, multi_cast<std::string>(joyStickMiddleValues_[iJoyStick][i]), false);
    510507            }
    511508        }
     
    11691166        else
    11701167        {
    1171             float fValue = value - joyStickCalibrations_[iJoyStick].middleValue[axis];
     1168            float fValue = static_cast<float>(value - joyStickCalibrations_[iJoyStick].middleValue[axis]);
    11721169            if (fValue > 0.0f)
    11731170                fValue *= joyStickCalibrations_[iJoyStick].positiveCoeff[axis];
  • code/trunk/src/core/input/InputManager.h

    r3084 r3196  
    4040
    4141#include <map>
     42#include <set>
     43#include <string>
    4244#include <vector>
    43 #include <stack>
     45#include <ois/OISKeyboard.h>
     46#include <ois/OISMouse.h>
     47#include <ois/OISJoyStick.h>
     48
    4449#include "util/Math.h"
    4550#include "util/OrxEnum.h"
  • code/trunk/src/core/input/InputState.h

    r2896 r3196  
    3939#include <string>
    4040#include <vector>
    41 #include "core/Executor.h"
    4241#include "InputInterfaces.h"
    4342
     
    6362        void resetHandlersChanged() { bHandlersChanged_ = false; }
    6463
    65         virtual void onEnter() { if (executorOnEnter_) (*executorOnEnter_)(); }
    66         virtual void onLeave() { if (executorOnLeave_) (*executorOnLeave_)(); }
     64        virtual void onEnter() = 0;
     65        virtual void onLeave() = 0;
    6766
    6867        virtual void registerOnEnter(Executor* executor)      { executorOnEnter_ = executor; }
     
    9291        InputState()
    9392            : bHandlersChanged_(false)
     93            , executorOnEnter_(0)
     94            , executorOnLeave_(0)
    9495            , priority_(0)
    9596            , bAlwaysGetsInput_(false)
    9697            , bTransparent_(false)
    97             , executorOnEnter_(0)
    98             , executorOnLeave_(0)
    9998        { }
    10099        virtual ~InputState() { }
     
    108107
    109108        bool bHandlersChanged_;
     109        Executor*                                   executorOnEnter_;
     110        Executor*                                   executorOnLeave_;
    110111
    111112    private:
     
    123124        bool                                        bAlwaysGetsInput_;
    124125        bool                                        bTransparent_;
    125 
    126         Executor*                                   executorOnEnter_;
    127         Executor*                                   executorOnLeave_;
    128126    };
    129127}
  • code/trunk/src/core/input/KeyBinder.cc

    r2896 r3196  
    3333
    3434#include "KeyBinder.h"
    35 
    36 #include <fstream>
    37 #include <string>
    3835
    3936#include "util/Convert.h"
     
    320317                    {
    321318                        mouseAxes_[2*i + 0].absVal_
    322                             = -mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
     319                            = -mouseRelative_[i] / deriveTime_ * 0.0005f * mouseSensitivityDerived_;
    323320                        mouseAxes_[2*i + 1].absVal_ = 0.0f;
    324321                    }
     
    327324                        mouseAxes_[2*i + 0].absVal_ = 0.0f;
    328325                        mouseAxes_[2*i + 1].absVal_
    329                             =  mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
     326                            =  mouseRelative_[i] / deriveTime_ * 0.0005f * mouseSensitivityDerived_;
    330327                    }
    331328                    else
  • code/trunk/src/core/input/KeyBinder.h

    r2896 r3196  
    3838#include "core/CorePrereqs.h"
    3939
     40#include <cassert>
     41#include <string>
    4042#include <vector>
    41 #include <cassert>
    4243
    4344#include "InputInterfaces.h"
  • code/trunk/src/core/input/KeyDetector.cc

    r1887 r3196  
    3434
    3535#include "KeyDetector.h"
     36
    3637#include "util/Debug.h"
    3738#include "core/CoreIncludes.h"
    38 #include "core/CommandExecutor.h"
    39 #include "core/CommandEvaluation.h"
    40 #include "InputCommands.h"
    4139#include "Button.h"
    4240
  • code/trunk/src/core/input/KeyDetector.h

    r1887 r3196  
    3838#include "core/CorePrereqs.h"
    3939
     40#include <string>
    4041#include "KeyBinder.h"
    4142
  • code/trunk/src/core/input/SimpleInputState.cc

    r1887 r3196  
    3434
    3535#include "SimpleInputState.h"
     36#include "core/Executor.h"
    3637
    3738namespace orxonox
     
    148149        bHandlersChanged_ = true;
    149150    }
     151
     152    void SimpleInputState::onEnter()
     153    {
     154        if (executorOnEnter_)
     155            (*executorOnEnter_)();
     156    }
     157
     158    void SimpleInputState::onLeave()
     159    {
     160        if (executorOnLeave_)
     161            (*executorOnLeave_)();
     162    }
    150163}
  • code/trunk/src/core/input/SimpleInputState.h

    r2896 r3196  
    7979        void update();
    8080        void numberOfJoySticksChanged(unsigned int n);
     81
     82        void onEnter();
     83        void onLeave();
    8184
    8285        KeyHandler*                   keyHandler_;
Note: See TracChangeset for help on using the changeset viewer.