Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3148 for code/branches/pch/src


Ignore:
Timestamp:
Jun 11, 2009, 10:26:40 PM (15 years ago)
Author:
rgrieder
Message:

Another clean up in core/input

Location:
code/branches/pch/src/core/input
Files:
16 edited

Legend:

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

    r2896 r3148  
    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/branches/pch/src/core/input/ExtendedInputState.h

    r2896 r3148  
    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/branches/pch/src/core/input/HalfAxis.h

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

    r2896 r3148  
    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/branches/pch/src/core/input/InputBuffer.h

    r2896 r3148  
    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/branches/pch/src/core/input/InputCommands.cc

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

    r2896 r3148  
    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/branches/pch/src/core/input/InputManager.cc

    r3147 r3148  
    3838#include <climits>
    3939#include <cassert>
    40 
    41 #include "ois/OISException.h"
    42 #include "ois/OISInputManager.h"
    43 #include "core/ConsoleCommand.h"
     40#include <ois/OISException.h>
     41#include <ois/OISInputManager.h>
    4442
    4543// HACK
    4644#ifdef ORXONOX_PLATFORM_LINUX
    47 #  include "ois/linux/LinuxMouse.h"
     45#  include <ois/linux/LinuxMouse.h>
    4846#endif
    4947
    5048#include "util/Exception.h"
     49#include "util/Debug.h"
     50#include "core/ConsoleCommand.h"
    5151#include "core/Clock.h"
    5252#include "core/CoreIncludes.h"
    5353#include "core/ConfigValueIncludes.h"
    54 #include "core/CommandExecutor.h"
    5554#include "core/CommandLine.h"
    56 #include "util/Debug.h"
    5755
    5856#include "InputBuffer.h"
    59 #include "KeyBinder.h"
    6057#include "KeyDetector.h"
    6158#include "InputState.h"
  • code/branches/pch/src/core/input/InputManager.h

    r3084 r3148  
    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/branches/pch/src/core/input/InputState.h

    r2896 r3148  
    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; }
     
    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/branches/pch/src/core/input/KeyBinder.cc

    r2896 r3148  
    3333
    3434#include "KeyBinder.h"
    35 
    36 #include <fstream>
    37 #include <string>
    3835
    3936#include "util/Convert.h"
  • code/branches/pch/src/core/input/KeyBinder.h

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

    r1887 r3148  
    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/branches/pch/src/core/input/KeyDetector.h

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

    r1887 r3148  
    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/branches/pch/src/core/input/SimpleInputState.h

    r2896 r3148  
    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.