Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 30, 2009, 2:10:44 PM (15 years ago)
Author:
rgrieder
Message:

Merged resource branch back to the trunk. Changes:

  • Automated graphics loading by evaluating whether a GameState requires it
  • Using native Tcl library (x3n)

Windows users: Update your dependency package!

Location:
code/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/input/InputManager.cc

    r3331 r3370  
    6464    InputHandler InputHandler::EMPTY;
    6565
    66     InputManager* InputManager::singletonRef_s = 0;
     66    InputManager* InputManager::singletonPtr_s = 0;
    6767
    6868    //! Defines the |= operator for easier use.
     
    9393        RegisterRootObject(InputManager);
    9494
    95         assert(singletonRef_s == 0);
    96         singletonRef_s = this;
    97 
    9895        CCOUT(4) << "Constructing..." << std::endl;
    9996
     
    138135        }
    139136
     137        CCOUT(4) << "Construction complete." << std::endl;
    140138        internalState_ = Nothing;
    141         CCOUT(4) << "Construction complete." << std::endl;
    142139    }
    143140
     
    297294
    298295        CCOUT(4) << "Destruction complete." << std::endl;
    299         singletonRef_s = 0;
    300296    }
    301297
  • code/trunk/src/core/input/InputManager.h

    r3327 r3370  
    3737#include <vector>
    3838
     39#include "util/Singleton.h"
    3940#include "core/WindowEventListener.h"
    4041#include "InputState.h"
     
    6263          If the OIS::InputManager or the Keyboard fail, an exception is thrown.
    6364    */
    64     class _CoreExport InputManager : public WindowEventListener
     65    class _CoreExport InputManager : public Singleton<InputManager>, public WindowEventListener
    6566    {
     67        friend class Singleton<InputManager>;
    6668    public:
    6769        //! Represents internal states of the InputManager.
     
    168170            { return this->oisInputManager_; }
    169171
    170         //! Returns a reference to the singleton instance
    171         static InputManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
    172 
    173172    private: // functions
    174173        // don't mess with a Singleton
     
    211210        std::set<InputState*>               stateDestroyRequests_; //!< Requests to destroy a state
    212211
    213         static InputManager*                singletonRef_s;        //!< Pointer reference to the singleton
     212        static InputManager*                singletonPtr_s;        //!< Pointer reference to the singleton
    214213    };
    215214}
Note: See TracChangeset for help on using the changeset viewer.