Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 19, 2009, 10:34:54 AM (15 years ago)
Author:
rgrieder
Message:

Renaming "tick" to "update" for all those classes not inheriting from Tickable to avoid confusions.
GameState::ticked still exists, but that's going to change anyway.

Location:
code/branches/gui/src/core
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/core/Core.cc

    r2799 r2800  
    563563    }
    564564
    565     void Core::tick(const Clock& time)
    566     {
    567         this->tclThreadManager_->tick(time.getDeltaTime());
     565    void Core::update(const Clock& time)
     566    {
     567        this->tclThreadManager_->update(time);
    568568    }
    569569}
  • code/branches/gui/src/core/Core.h

    r2799 r2800  
    6666
    6767            bool isLoaded() { return this->loaded_; }
    68             void tick(const Clock& time);
     68            void update(const Clock& time);
    6969
    7070            static Core& getInstance() { assert(Core::singletonRef_s); return *Core::singletonRef_s; }
  • code/branches/gui/src/core/TclThreadManager.cc

    r1792 r2800  
    3535#include <OgreTimer.h>
    3636
     37#include "Clock.h"
    3738#include "CoreIncludes.h"
    3839#include "ConsoleCommand.h"
     
    598599    }
    599600
    600     void TclThreadManager::tick(float dt)
     601    void TclThreadManager::update(const Clock& time)
    601602    {
    602603        {
     
    633634            boost::try_mutex::scoped_lock interpreter_lock(this->orxonoxInterpreterBundle_.interpreterMutex_);
    634635#endif
    635             unsigned long maxtime = (unsigned long)(dt * 1000000 * TCLTHREADMANAGER_MAX_CPU_USAGE);
     636            unsigned long maxtime = (unsigned long)(time.getDeltaTime() * 1000000 * TCLTHREADMANAGER_MAX_CPU_USAGE);
    636637            Ogre::Timer timer;
    637638            while (!this->queueIsEmpty())
  • code/branches/gui/src/core/TclThreadManager.h

    r2710 r2800  
    9090            void debug(const std::string& error);
    9191
    92             virtual void tick(float dt);
     92            void update(const Clock& time);
    9393
    9494            std::list<unsigned int> getThreadList() const;
  • code/branches/gui/src/core/input/CalibratorCallback.h

    r1755 r2800  
    5252        void keyHeld    (const KeyEvent& evt) { }
    5353
    54         void tickInput(float dt) { }
     54        void updateInput(float dt) { }
    5555    };
    5656}
  • code/branches/gui/src/core/input/ExtendedInputState.cc

    r2773 r2800  
    402402    }
    403403
    404     void ExtendedInputState::tickInput(float dt)
     404    void ExtendedInputState::updateInput(float dt)
    405405    {
    406406        for (unsigned int i = 0; i < allHandlers_.size(); ++i)
    407407        {
    408             allHandlers_[i]->tickInput(dt);
    409         }
    410     }
    411 
    412     void ExtendedInputState::tickInput(float dt, unsigned int device)
     408            allHandlers_[i]->updateInput(dt);
     409        }
     410    }
     411
     412    void ExtendedInputState::updateInput(float dt, unsigned int device)
    413413    {
    414414        switch (device)
     
    416416        case Keyboard:
    417417            for (unsigned int i = 0; i < keyHandlers_.size(); ++i)
    418                 keyHandlers_[i]->tickKey(dt);
     418                keyHandlers_[i]->updateKey(dt);
    419419            break;
    420420
    421421        case Mouse:
    422422            for (unsigned int i = 0; i < mouseHandlers_.size(); ++i)
    423                 mouseHandlers_[i]->tickMouse(dt);
     423                mouseHandlers_[i]->updateMouse(dt);
    424424            break;
    425425
    426426        default: // joy sticks
    427427            for (unsigned int i = 0; i < joyStickHandlers_[device - 2].size(); ++i)
    428                 joyStickHandlers_[device - 2][i]->tickJoyStick(dt, device - 2);
     428                joyStickHandlers_[device - 2][i]->updateJoyStick(dt, device - 2);
    429429            break;
    430430        }
  • code/branches/gui/src/core/input/ExtendedInputState.h

    r1887 r2800  
    6868        ~ExtendedInputState() { }
    6969
    70         void tickInput(float dt);
    71         void tickInput(float dt, unsigned int device);
     70        void updateInput(float dt);
     71        void updateInput(float dt, unsigned int device);
    7272
    7373        void keyPressed (const KeyEvent& evt);
  • code/branches/gui/src/core/input/InputBuffer.cc

    r2662 r2800  
    224224
    225225    /**
    226         @brief This tick() function is called by the InputManager if the InputBuffer is active.
     226        @brief This update() function is called by the InputManager if the InputBuffer is active.
    227227        @param dt Delta time
    228228    */
    229     void InputBuffer::tickInput(float dt)
     229    void InputBuffer::updateInput(float dt)
    230230    {
    231231        timeSinceKeyPressed_ += dt;
  • code/branches/gui/src/core/input/InputBuffer.h

    r2662 r2800  
    171171            void processKey (const KeyEvent &e);
    172172
    173             void tickInput(float dt);
    174             void tickKey(float dt) { }
     173            void updateInput(float dt);
     174            void updateKey(float dt) { }
    175175
    176176            std::string buffer_;
  • code/branches/gui/src/core/input/InputInterfaces.h

    r2662 r2800  
    474474    public:
    475475        virtual ~InputHandler() { }
    476         virtual void tickInput(float dt) = 0;
     476        virtual void updateInput(float dt) = 0;
    477477    };
    478478
     
    488488        virtual void keyReleased(const KeyEvent& evt) = 0;
    489489        virtual void keyHeld    (const KeyEvent& evt) = 0;
    490         virtual void tickKey    (float dt) = 0;
     490        virtual void updateKey    (float dt) = 0;
    491491    };
    492492
     
    504504        virtual void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) = 0;
    505505        virtual void mouseScrolled      (int abs, int rel)     = 0;
    506         virtual void tickMouse          (float dt) = 0;
     506        virtual void updateMouse          (float dt) = 0;
    507507    };
    508508
     
    520520        virtual void joyStickButtonHeld    (unsigned int joyStickID, JoyStickButtonCode::ByEnum id) = 0;
    521521        virtual void joyStickAxisMoved     (unsigned int joyStickID, unsigned int axis, float value) = 0;
    522         virtual void tickJoyStick          (float dt, unsigned int joyStick) = 0;
     522        virtual void updateJoyStick          (float dt, unsigned int joyStick) = 0;
    523523    };
    524524
     
    531531        virtual ~EmptyHandler() { }
    532532
    533         void tickInput(float dt) { }
    534         void tickJoyStick(float dt, unsigned int joyStick) { }
    535         void tickMouse(float dt) { }
    536         void tickKey(float dt) { }
     533        void updateInput(float dt) { }
     534        void updateJoyStick(float dt, unsigned int joyStick) { }
     535        void updateMouse(float dt) { }
     536        void updateKey(float dt) { }
    537537
    538538        void keyPressed (const KeyEvent& evt) { }
  • code/branches/gui/src/core/input/InputManager.cc

    r2662 r2800  
    4343
    4444#include "util/Exception.h"
     45#include "core/Clock.h"
    4546#include "core/CoreIncludes.h"
    4647#include "core/ConfigValueIncludes.h"
     
    670671    @brief
    671672        Public interface. Only reloads immediately if the call stack doesn't
    672         include the tick() method.
     673        include the update() method.
    673674    @param joyStickSupport
    674675        Whether or not to initialise joy sticks as well.
     
    742743    @brief
    743744        Updates the states and the InputState situation.
    744     @param dt
    745         Delta time
    746     */
    747     void InputManager::tick(float dt)
     745    @param time
     746        Clock holding the current time.
     747    */
     748    void InputManager::update(const Clock& time)
    748749    {
    749750        if (internalState_ == Uninitialised)
     
    849850                }
    850851
    851             // tick the handlers for each active handler
     852            // update the handlers for each active handler
    852853            for (unsigned int i = 0; i < devicesNum_; ++i)
    853854            {
    854                 activeStatesTop_[i]->tickInput(dt, i);
     855                activeStatesTop_[i]->updateInput(time.getDeltaTime(), i);
    855856                if (stateMaster_->isInputDeviceEnabled(i))
    856                     stateMaster_->tickInput(dt, i);
    857             }
    858 
    859             // tick the handler with a general tick afterwards
     857                    stateMaster_->updateInput(time.getDeltaTime(), i);
     858            }
     859
     860            // update the handler with a general tick afterwards
    860861            for (unsigned int i = 0; i < activeStatesTicked_.size(); ++i)
    861                 activeStatesTicked_[i]->tickInput(dt);
    862             stateMaster_->tickInput(dt);
     862                activeStatesTicked_[i]->updateInput(time.getDeltaTime());
     863            stateMaster_->updateInput(time.getDeltaTime());
    863864        }
    864865
     
    869870    @brief
    870871        Updates the currently active states (according to activeStates_) for each device.
    871         Also, a list of all active states (no duplicates!) is compiled for the general tick.
     872        Also, a list of all active states (no duplicates!) is compiled for the general update().
    872873    */
    873874    void InputManager::_updateActiveStates()
     
    12901291    @remarks
    12911292        You can't remove the internal states "empty", "calibrator" and "detector".
    1292         The removal process is being postponed if InputManager::tick() is currently running.
     1293        The removal process is being postponed if InputManager::update() is currently running.
    12931294    */
    12941295    bool InputManager::requestDestroyState(const std::string& name)
  • code/branches/gui/src/core/input/InputManager.h

    r2662 r2800  
    125125        bool requestLeaveState     (const std::string& name);
    126126
    127         void tick(float dt);
     127        void update(const Clock& time);
    128128
    129129        static InputManager& getInstance()    { assert(singletonRef_s); return *singletonRef_s; }
  • code/branches/gui/src/core/input/InputState.h

    r1887 r2800  
    7171        virtual void unRegisterOnLeave()                      { executorOnLeave_ = 0; }
    7272
    73         virtual void tickInput(float dt, unsigned int device) = 0;
    74         virtual void tickInput(float dt) = 0;
     73        virtual void updateInput(float dt, unsigned int device) = 0;
     74        virtual void updateInput(float dt) = 0;
    7575
    7676        virtual void keyPressed (const KeyEvent& evt) = 0;
  • code/branches/gui/src/core/input/KeyBinder.cc

    r2713 r2800  
    309309    }
    310310
    311     void KeyBinder::tickMouse(float dt)
     311    void KeyBinder::updateMouse(float dt)
    312312    {
    313313        if (bDeriveMouseInput_)
     
    349349            // Why dividing relative value by dt? The reason lies in the simple fact, that when you
    350350            // press a button that has relative movement, that value has to be multiplied by dt to be
    351             // frame rate independent. This can easily (and only) be done in tickInput(float).
     351            // frame rate independent. This can easily (and only) be done in updateInput(float).
    352352            // Hence we need to divide by dt here for the mouse to compensate, because the relative
    353353            // move movements have nothing to do with dt.
     
    362362    }
    363363
    364     void KeyBinder::tickJoyStick(float dt, unsigned int joyStick)
     364    void KeyBinder::updateJoyStick(float dt, unsigned int joyStick)
    365365    {
    366366        for (unsigned int i = 0; i < JoyStickAxisCode::numberOfAxes * 2; i++)
  • code/branches/gui/src/core/input/KeyBinder.h

    r2710 r2800  
    6868
    6969    protected: // functions
    70         void tickInput(float dt);
    71         void tickKey(float dt) { }
    72         void tickMouse(float dt);
    73         void tickJoyStick(float dt, unsigned int joyStick);
     70        void updateInput(float dt);
     71        void updateKey(float dt) { }
     72        void updateMouse(float dt);
     73        void updateJoyStick(float dt, unsigned int joyStick);
    7474        // internal
    7575        void tickHalfAxis(HalfAxis& halfAxis);
     
    134134        @brief
    135135            Commands that have additional parameters (axes) are executed at the end of
    136             the tick() so that all values can be buffered for single execution.
     136            update() so that all values can be buffered for single execution.
    137137        */
    138138        std::vector<BufferedParamCommand*> paramCommandBuffer_;
     
    200200    { joyStickButtons_[joyStickID][id].execute(KeybindMode::OnHold); }
    201201
    202     inline void KeyBinder::tickInput(float dt)
     202    inline void KeyBinder::updateInput(float dt)
    203203    {
    204204        // execute all buffered bindings (additional parameter)
  • code/branches/gui/src/core/input/SimpleInputState.h

    r1887 r2800  
    5959        ~SimpleInputState() { }
    6060
    61         void tickInput(float dt);
    62         void tickInput(float dt, unsigned int device);
     61        void updateInput(float dt);
     62        void updateInput(float dt, unsigned int device);
    6363
    6464        void keyPressed (const KeyEvent& evt);
     
    8787    };
    8888
    89     inline void SimpleInputState::tickInput(float dt)
     89    inline void SimpleInputState::updateInput(float dt)
    9090    {
    9191        for (unsigned int i = 0; i < allHandlers_.size(); ++i)
    9292        {
    93             allHandlers_[i]->tickInput(dt);
     93            allHandlers_[i]->updateInput(dt);
    9494        }
    9595    }
    9696
    97     inline void SimpleInputState::tickInput(float dt, unsigned int device)
     97    inline void SimpleInputState::updateInput(float dt, unsigned int device)
    9898    {
    9999        switch (device)
     
    101101        case InputDevice::Keyboard:
    102102            if (keyHandler_)
    103                 keyHandler_->tickKey(dt);
     103                keyHandler_->updateKey(dt);
    104104            break;
    105105
    106106        case InputDevice::Mouse:
    107107            if (mouseHandler_)
    108                 mouseHandler_->tickMouse(dt);
     108                mouseHandler_->updateMouse(dt);
    109109            break;
    110110
    111111        default: // joy sticks
    112112            if (joyStickHandler_[device - 2])
    113                 joyStickHandler_[device - 2]->tickJoyStick(dt, device - 2);
     113                joyStickHandler_[device - 2]->updateJoyStick(dt, device - 2);
    114114            break;
    115115        }
Note: See TracChangeset for help on using the changeset viewer.