Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2011, 6:32:28 PM (13 years ago)
Author:
rgrieder
Message:

Merged revisions 7940-7974 from kicklib to kicklib2.

Location:
code/branches/kicklib2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib2

  • code/branches/kicklib2/src/libraries/core/GUIManager.h

    r8079 r8283  
    4242#include <string>
    4343#include <CEGUIForwardRefs.h>
    44 #include <boost/scoped_ptr.hpp>
     44#include <CEGUIVersion.h>
    4545#include <boost/shared_ptr.hpp>
     46#include <loki/ScopeGuard.h>
    4647
    4748#include "util/OgreForwardRefs.h"
     
    5758$cfile "../util/TriBool.h" // tolua_export
    5859*/
     60
     61#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
     62#  define ORXONOX_OLD_CEGUI
     63#endif
    5964
    6065namespace orxonox // tolua_export
     
    7883    public:
    7984        GUIManager(const std::pair<int, int>& mousePosition);
    80         ~GUIManager();
     85        //! Leave empty and use cleanup() instead
     86        ~GUIManager() {}
    8187
    8288        void setConfigValues(void);
     
    104110        const std::string& createInputState(const std::string& name, TriBool::Value showCursor = TriBool::True, TriBool::Value useKeyboard = TriBool::True, bool bBlockJoyStick = false); // tolua_export
    105111        LuaState* getLuaState(void)
    106             { return this->luaState_.get(); }
     112            { return this->luaState_; }
    107113
    108114        //! Returns the root window for all menu sheets
     
    127133    private:
    128134        GUIManager(const GUIManager& instance); //!< private and undefined copy c'tor (this is a singleton class)
     135
     136        /// Destructor that also executes when object fails to construct
     137        void cleanup();
     138
    129139        void executeCode(const std::string& str);
    130140
     
    147157        virtual void windowFocusChanged(bool bFocus);
    148158
    149         scoped_ptr<CEGUI::OgreCEGUIRenderer> guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
    150         scoped_ptr<LuaState>                 luaState_;         //!< LuaState, access point to the Lua engine
    151         scoped_ptr<CEGUI::LuaScriptModule>   scriptModule_;     //!< CEGUI's script module to use Lua
    152         scoped_ptr<CEGUI::System>            guiSystem_;        //!< CEGUI's main system
     159        /// Surrogate for the destructor
     160        Loki::ObjScopeGuardImpl0<GUIManager, void (GUIManager::*)()> destroyer_;
     161
     162#ifdef ORXONOX_OLD_CEGUI
     163        CEGUI::OgreCEGUIRenderer*            guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
     164        CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
     165#else
     166        CEGUI::OgreRenderer*                 guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
     167        CEGUI::OgreResourceProvider*         resourceProvider_; //!< CEGUI's resource provider
     168        CEGUI::OgreImageCodec*               imageCodec_;
     169#endif
     170        LuaState*                            luaState_;         //!< LuaState, access point to the Lua engine
     171        CEGUI::LuaScriptModule*              scriptModule_;     //!< CEGUI's script module to use Lua
     172        CEGUI::System*                       guiSystem_;        //!< CEGUI's main system
    153173        shared_ptr<ResourceInfo>             rootFileInfo_;     //!< Resource information about the root script
    154         CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
    155174        CEGUI::Logger*                       ceguiLogger_;      //!< CEGUI's logger to be able to log CEGUI errors in our log
    156175        CEGUI::Window*                       rootWindow_;       //!< Root node for all windows
Note: See TracChangeset for help on using the changeset viewer.