Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2011, 7:15:14 AM (14 years ago)
Author:
rgrieder
Message:

Merged kicklib2 branch back to trunk (includes former branches ois_update, mac_osx and kicklib).

Notes for updating

Linux:
You don't need an extra package for CEGUILua and Tolua, it's already shipped with CEGUI.
However you do need to make sure that the OgreRenderer is installed too with CEGUI 0.7 (may be a separate package).
Also, Orxonox now recognises if you install the CgProgramManager (a separate package available on newer Ubuntu on Debian systems).

Windows:
Download the new dependency packages versioned 6.0 and use these. If you have problems with that or if you don't like the in game console problem mentioned below, you can download the new 4.3 version of the packages (only available for Visual Studio 2005/2008).

Key new features:

  • *Support for Mac OS X*
  • Visual Studio 2010 support
  • Bullet library update to 2.77
  • OIS library update to 1.3
  • Support for CEGUI 0.7 —> Support for Arch Linux and even SuSE
  • Improved install target
  • Compiles now with GCC 4.6
  • Ogre Cg Shader plugin activated for Linux if available
  • And of course lots of bug fixes

There are also some regressions:

  • No support for CEGUI 0.5, Ogre 1.4 and boost 1.35 - 1.39 any more
  • In game console is not working in main menu for CEGUI 0.7
  • Tolua (just the C lib, not the application) and CEGUILua libraries are no longer in our repository. —> You will need to get these as well when compiling Orxonox
  • And of course lots of new bugs we don't yet know about
Location:
code/trunk/src/libraries/core
Files:
2 deleted
26 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/CMakeLists.txt

    r8079 r8351  
    5858  command/ArgumentCompletionFunctions.cc
    5959  ConfigFileManager.cc
    60   MemoryArchive.cc
    6160  PathConfig.cc
    6261COMPILATION_END
     
    9897    ${CEGUI_LIBRARY}
    9998    ${CEGUILUA_LIBRARY}
    100     ${LUA_LIBRARIES}
     99    ${CEGUI_TOLUA_LIBRARY}
     100    ${CEGUI_OGRE_RENDERER_LIBRARY}
     101    ${LUA5.1_LIBRARY}
    101102    cpptcl_orxonox
    102     ogreceguirenderer_orxonox
    103103    ois_orxonox
    104104    tinyxml_orxonox
    105     tolua_orxonox
    106105    util
     106  LINK_LIBS_UNIX
     107    dl
     108    pthread
    107109  SOURCE_FILES
    108110    ${CORE_SRC_FILES}
  • code/trunk/src/libraries/core/ConfigValueContainer.cc

    r7284 r8351  
    158158        {
    159159            return this->callFunctionWithIndex(&ConfigValueContainer::tset, input);
    160             return false;
    161160        }
    162161        else
  • code/trunk/src/libraries/core/Core.cc

    r8079 r8351  
    8181
    8282    SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
     83#if !defined(ORXONOX_PLATFORM_APPLE) && !defined(ORXONOX_USE_WINMAIN)
    8384    SetCommandLineSwitch(noIOConsole).information("Use this if you don't want to use the IOConsole (for instance for Lua debugging)");
     85#endif
    8486
    8587#ifdef ORXONOX_PLATFORM_WINDOWS
     
    156158        this->setConfigValues();
    157159
    158         // create persistent io console
     160#if !defined(ORXONOX_PLATFORM_APPLE) && !defined(ORXONOX_USE_WINMAIN)
     161        // Create persistent IO console
    159162        if (CommandLineParser::getValue("noIOConsole").getBool())
    160163        {
     
    163166        if (this->bStartIOConsole_)
    164167            this->ioConsole_.reset(new IOConsole());
     168#endif
    165169
    166170        // creates the class hierarchy for all classes with factories
  • code/trunk/src/libraries/core/CorePrereqs.h

    r8079 r8351  
    3838#include "OrxonoxConfig.h"
    3939#include <boost/version.hpp>
     40#include <CEGUIVersion.h>
    4041
    4142//-----------------------------------------------------------------------
     
    5354#    endif
    5455#  endif
    55 #elif defined ( ORXONOX_GCC_VISIBILITY )
     56#  define _CorePrivate
     57#elif defined (ORXONOX_GCC_VISIBILITY)
    5658#  define _CoreExport  __attribute__ ((visibility("default")))
     59#  define _CorePrivate __attribute__ ((visibility("hidden")))
    5760#else
    5861#  define _CoreExport
     62#  define _CorePrivate
    5963#endif
    6064
     
    259263{
    260264#if (BOOST_VERSION < 104400)
     265
    261266    namespace filesystem
    262267    {
     
    265270        typedef basic_path<std::string, path_traits> path;
    266271    }
    267 #else
     272
     273#elif (BOOST_VERSION < 104800)
     274
     275# if BOOST_FILESYSTEM_VERSION == 2
    268276    namespace filesystem2
    269277    {
     
    278286        using filesystem2::path;
    279287    }
     288# elif BOOST_FILESYSTEM_VERSION == 3
     289    namespace filesystem3
     290    {
     291        class path;
     292    }
     293    namespace filesystem
     294    {
     295        using filesystem3::path;
     296    }
     297# endif
     298
     299#else
     300
     301    // TODO: Check this once boost 1.48 is released
     302    namespace filesystem
     303    {
     304        class path;
     305    }
     306
    280307#endif
     308
    281309    class thread;
    282310    class mutex;
     
    306334    class LuaScriptModule;
    307335
     336#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
    308337    class OgreCEGUIRenderer;
    309338    class OgreCEGUIResourceProvider;
    310339    class OgreCEGUITexture;
     340#else
     341    class OgreRenderer;
     342    class OgreResourceProvider;
     343    class OgreImageCodec;
     344#endif
    311345}
    312346
  • code/trunk/src/libraries/core/DynLib.cc

    r6417 r8351  
    4242#endif
    4343
    44 #ifdef ORXONOX_PLATFORM_LINUX
     44#ifdef ORXONOX_PLATFORM_UNIX
    4545#  include <dlfcn.h>
    4646#endif
    4747
    4848#ifdef ORXONOX_PLATFORM_APPLE
    49 include <macPlugins.h>
     49 include <OSX/macUtils.h> // OGRE include
    5050#endif
    5151
     
    7575        if (name.substr(name.length() - 3, 3) != ".so")
    7676           name += ".so";
     77#elif defined(ORXONOX_PLATFORM_APPLE)
     78        // dlopen() does not add .dylib to the filename, like windows does for .dll
     79        if (name.substr(name.length() - 6, 6) != ".dylib")
     80            name += ".dylib";
     81#elif defined(ORXONOX_PLATFORM_WINDOWS)
     82        // Although LoadLibraryEx will add .dll itself when you only specify the library name,
     83        // if you include a relative path then it does not. So, add it to be sure.
     84        if (name.substr(name.length() - 4, 4) != ".dll")
     85            name += ".dll";
    7786#endif
    7887
     
    127136        LocalFree( lpMsgBuf );
    128137        return ret;
    129 #elif defined(ORXONOX_PLATFORM_LINUX)
     138#elif defined(ORXONOX_PLATFORM_UNIX)
    130139        return std::string(dlerror());
    131 #elif defined(ORXONOX_PLATFORM_APPLE)
    132         return std::string(mac_errorBundle());
    133140#else
    134141        return "";
    135142#endif
    136143    }
    137 
    138144}
  • code/trunk/src/libraries/core/DynLib.h

    r7401 r8351  
    5252typedef struct HINSTANCE__* hInstance;
    5353
    54 #elif defined(ORXONOX_PLATFORM_LINUX)
     54#elif defined(ORXONOX_PLATFORM_UNIX)
    5555#    define DYNLIB_HANDLE void*
    5656#    define DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY | RTLD_GLOBAL)
    5757#    define DYNLIB_GETSYM( a, b ) dlsym( a, b )
    5858#    define DYNLIB_UNLOAD( a ) dlclose( a )
    59 
    60 #elif defined(ORXONOX_PLATFORM_APPLE)
    61 #    define DYNLIB_HANDLE CFBundleRef
    62 #    define DYNLIB_LOAD( a ) mac_loadExeBundle( a )
    63 #    define DYNLIB_GETSYM( a, b ) mac_getBundleSym( a, b )
    64 #    define DYNLIB_UNLOAD( a ) mac_unloadExeBundle( a )
    6559#endif
    6660
  • code/trunk/src/libraries/core/GUIManager.cc

    r8079 r8351  
    3030#include "GUIManager.h"
    3131
     32#include <memory>
    3233#include <boost/bind.hpp>
    33 #include <memory>
     34#include <OgreRenderQueue.h>
     35#include <OgreRenderWindow.h>
    3436
    3537#include <CEGUIDefaultLogger.h>
     
    4345#include <elements/CEGUIListbox.h>
    4446#include <elements/CEGUIListboxItem.h>
    45 #include <ogreceguirenderer/OgreCEGUIRenderer.h>
    46 
    47 #include "SpecialConfig.h" // Configures the macro below
    48 #ifdef CEGUILUA_USE_INTERNAL_LIBRARY
    49 #   include <ceguilua/CEGUILua.h>
    50 #else
    51 #   include <CEGUILua.h>
     47
     48#ifdef ORXONOX_OLD_CEGUI
     49#  include <CEGUILua.h>
     50#  include <ogreceguirenderer/OgreCEGUIRenderer.h>
     51extern "C" {
     52#  include <lauxlib.h>
     53}
     54#else
     55#  include <ScriptingModules/LuaScriptModule/CEGUILua.h>
     56#  include <RendererModules/Ogre/CEGUIOgreImageCodec.h>
     57#  include <RendererModules/Ogre/CEGUIOgreRenderer.h>
     58#  include <RendererModules/Ogre/CEGUIOgreResourceProvider.h>
     59#  include <OgreCamera.h>
     60#  include <OgreRenderQueueListener.h>
     61#  include <OgreSceneManager.h>
    5262#endif
    5363
     
    8999                case CEGUI::Informative: orxonoxLevel = 5; break;
    90100                case CEGUI::Insane:      orxonoxLevel = 6; break;
    91                 default: OrxAssert(false, "CEGUI log level out of range, inpect immediately!");
     101                default: OrxAssert(false, "CEGUI log level out of range, inspect immediately!");
    92102            }
    93103            OutputHandler::getOutStream(orxonoxLevel)
     
    97107        }
    98108    };
     109
     110#ifdef ORXONOX_OLD_CEGUI
     111    /** Class with the same memory layout as CEGUI::LuaScriptModule. <br>
     112        We need this to fix a problem with an uninitialised member variable
     113        in CEGUI < 0.7 <br>
     114        Notice the "public" modifier for the otherwise private variables.
     115    */
     116    class LuaScriptModuleWorkaround : public CEGUI::ScriptModule
     117    {
     118    public:
     119        LuaScriptModuleWorkaround();
     120        ~LuaScriptModuleWorkaround();
     121
     122    public:
     123        bool d_ownsState;
     124        lua_State* d_state;
     125        CEGUI::String d_errFuncName;
     126        int d_errFuncIndex;
     127        CEGUI::String d_activeErrFuncName;
     128        int d_activeErrFuncIndex;
     129    };
     130#else
     131    /// RenderQueueListener based class used to hook into the ogre rendering system
     132    class RQListener : public Ogre::RenderQueueListener
     133    {
     134    public:
     135        /// Callback from Ogre invoked before other stuff in our target queue is rendered
     136        void renderQueueEnded(Ogre::uint8 id, const Ogre::String& invocation, bool& skipThisQueue)
     137        {
     138            if (id == Ogre::RENDER_QUEUE_SKIES_LATE)//Ogre::RENDER_QUEUE_OVERLAY)
     139                CEGUI::System::getSingleton().renderGUI();
     140        }
     141    };
     142#endif
    99143
    100144    static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
     
    118162    */
    119163    GUIManager::GUIManager(const std::pair<int, int>& mousePosition)
    120         : resourceProvider_(NULL)
     164        : destroyer_(*this, &GUIManager::cleanup)
     165        , guiRenderer_(NULL)
     166        , resourceProvider_(NULL)
     167#ifndef ORXONOX_OLD_CEGUI
     168        , imageCodec_(NULL)
     169#endif
     170        , luaState_(NULL)
     171        , scriptModule_(NULL)
     172        , guiSystem_(NULL)
    121173        , camera_(NULL)
    122174    {
     
    129181
    130182        // Note: No SceneManager specified yet
    131         guiRenderer_.reset(new OgreCEGUIRenderer(GraphicsManager::getInstance().getRenderWindow(), Ogre::RENDER_QUEUE_OVERLAY, false, 3000));
     183#ifdef ORXONOX_OLD_CEGUI
     184        guiRenderer_ = new OgreCEGUIRenderer(GraphicsManager::getInstance().getRenderWindow(), Ogre::RENDER_QUEUE_OVERLAY, false, 3000);
    132185        resourceProvider_ = guiRenderer_->createResourceProvider();
     186#else
     187        guiRenderer_ = &OgreRenderer::create(*GraphicsManager::getInstance().getRenderWindow());
     188        // We use our own RenderQueueListener so we can draw UNDER overlays
     189        guiRenderer_->setFrameControlExecutionEnabled(false);
     190        rqListener_ = new RQListener();
     191        resourceProvider_ = &OgreRenderer::createOgreResourceProvider();
     192        imageCodec_ = &OgreRenderer::createOgreImageCodec();
     193#endif
    133194        resourceProvider_->setDefaultResourceGroup("General");
    134195
    135196        // Setup scripting
    136         luaState_.reset(new LuaState());
     197        luaState_ = new LuaState();
    137198        rootFileInfo_ = Resource::getInfo("InitialiseGUI.lua");
    138199        // This is necessary to ensure that input events also use the right resource info when triggering lua functions
    139200        luaState_->setDefaultResourceInfo(this->rootFileInfo_);
    140         scriptModule_.reset(new LuaScriptModule(luaState_->getInternalLuaState()));
     201#ifdef ORXONOX_OLD_CEGUI
     202        scriptModule_ = new LuaScriptModule(luaState_->getInternalLuaState());
     203        // Ugly workaround: older CEGUILua versions don't initialise the member
     204        // d_activeErrFuncIndex at all. That leads to "error in error handling"
     205        // problems when a Lua error occurs.
     206        // We fix this by setting the member manually.
     207        reinterpret_cast<LuaScriptModuleWorkaround*>(scriptModule_)->d_activeErrFuncIndex = LUA_NOREF;
     208        luaState_->doString("ORXONOX_OLD_CEGUI = true");
     209#else
     210        scriptModule_ = &LuaScriptModule::create(luaState_->getInternalLuaState());
     211#endif
    141212        scriptModule_->setDefaultPCallErrorHandler(LuaState::ERROR_HANDLER_NAME);
    142213
     
    144215        std::auto_ptr<CEGUILogger> ceguiLogger(new CEGUILogger());
    145216        ceguiLogger->setLogFilename(PathConfig::getLogPathString() + "cegui.log");
    146         // set the log level according to ours (translate by subtracting 1)
     217        // Set the log level according to ours (translate by subtracting 1)
    147218        ceguiLogger->setLoggingLevel(
    148219            static_cast<LoggingLevel>(OutputHandler::getInstance().getSoftDebugLevel("logFile") - 1));
     
    150221
    151222        // Create the CEGUI system singleton
    152         guiSystem_.reset(new System(guiRenderer_.get(), resourceProvider_, 0, scriptModule_.get()));
     223#ifdef ORXONOX_OLD_CEGUI
     224        guiSystem_ = new System(guiRenderer_, resourceProvider_, 0, scriptModule_);
     225        // Add functions that have been renamed in newer versions
     226        luaState_->doString("CEGUI.SchemeManager.create = CEGUI.SchemeManager.loadScheme");
     227        luaState_->doString("CEGUI.Window.getUnclippedOuterRect = CEGUI.Window.getUnclippedPixelRect");
     228#else
     229        guiSystem_ = &System::create(*guiRenderer_, resourceProvider_, 0, imageCodec_, scriptModule_);
     230#endif
    153231
    154232        // Align CEGUI mouse with OIS mouse
     
    175253    }
    176254
    177     /**
    178     @brief
    179         Basically shuts down CEGUI (member smart pointers) but first unloads our Tolua modules.
    180     */
    181     GUIManager::~GUIManager()
    182     {
     255    void GUIManager::cleanup()
     256    {
     257        using namespace CEGUI;
     258
     259#ifdef ORXONOX_OLD_CEGUI
     260        delete guiSystem_;
     261        delete guiRenderer_;
     262        delete scriptModule_;
     263#else
     264        System::destroy();
     265        OgreRenderer::destroyOgreResourceProvider(*resourceProvider_);
     266        OgreRenderer::destroyOgreImageCodec(*imageCodec_);
     267        OgreRenderer::destroy(*guiRenderer_);
     268        LuaScriptModule::destroy(*scriptModule_);
     269        delete ceguiLogger_;
     270        delete rqListener_;
     271#endif
     272        delete luaState_;
    183273    }
    184274
     
    221311    void GUIManager::setCamera(Ogre::Camera* camera)
    222312    {
    223         this->camera_ = camera;
     313#ifdef ORXONOX_OLD_CEGUI
    224314        if (camera == NULL)
    225315            this->guiRenderer_->setTargetSceneManager(0);
    226316        else
    227317            this->guiRenderer_->setTargetSceneManager(camera->getSceneManager());
     318#else
     319        if (camera_ != NULL && camera_->getSceneManager() != NULL)
     320            camera_->getSceneManager()->removeRenderQueueListener(rqListener_);
     321        if (camera != NULL && camera->getSceneManager() != NULL)
     322            camera->getSceneManager()->addRenderQueueListener(rqListener_);
     323#endif
     324        this->camera_ = camera;
    228325    }
    229326
     
    321418        false                     | False | True  | Dontcare
    322419        */
     420
     421#ifdef ORXONOX_PLATFORM_APPLE
     422        // There is no non exclusive mode on OS X yet
     423        state->setMouseExclusive(TriBool::True);
     424#else
    323425        if (showCursor == TriBool::Dontcare)
    324426            state->setMouseExclusive(TriBool::Dontcare);
     
    327429        else
    328430            state->setMouseExclusive(TriBool::False);
     431#endif
    329432
    330433        if (showCursor == TriBool::True)
     
    522625        The Listbox for which to enable (or disable) tooltips.
    523626    @param enabled
    524         Whether to enable or disabel the tooltips.
     627        Whether to enable or disable the tooltips.
    525628    */
    526629    void GUIManager::setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled)
  • code/trunk/src/libraries/core/GUIManager.h

    r8079 r8351  
    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        Ogre::RenderQueueListener*           rqListener_;       //!< RQ listener so we can draw UNDER Ogre overlays
     168        CEGUI::OgreResourceProvider*         resourceProvider_; //!< CEGUI's resource provider
     169        CEGUI::OgreImageCodec*               imageCodec_;
     170#endif
     171        LuaState*                            luaState_;         //!< LuaState, access point to the Lua engine
     172        CEGUI::LuaScriptModule*              scriptModule_;     //!< CEGUI's script module to use Lua
     173        CEGUI::System*                       guiSystem_;        //!< CEGUI's main system
    153174        shared_ptr<ResourceInfo>             rootFileInfo_;     //!< Resource information about the root script
    154         CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
    155175        CEGUI::Logger*                       ceguiLogger_;      //!< CEGUI's logger to be able to log CEGUI errors in our log
    156176        CEGUI::Window*                       rootWindow_;       //!< Root node for all windows
  • code/trunk/src/libraries/core/Game.cc

    r8245 r8351  
    459459            ThrowException(GameState, "Emtpy GameState hierarchy provided, terminating.");
    460460        // Add element with large identation to detect the last with just an iterator
    461         stateStrings.push_back(std::make_pair("", -1));
     461        stateStrings.push_back(std::make_pair(std::string(), -1));
    462462
    463463        // Parse elements recursively
  • code/trunk/src/libraries/core/GraphicsManager.cc

    r8079 r8351  
    3030#include "GraphicsManager.h"
    3131
     32#include <cstdlib>
    3233#include <fstream>
    3334#include <sstream>
     
    3536#include <boost/shared_array.hpp>
    3637
    37 #include <OgreArchiveFactory.h>
    38 #include <OgreArchiveManager.h>
    3938#include <OgreFrameListener.h>
    4039#include <OgreRoot.h>
     
    6059#include "GUIManager.h"
    6160#include "Loader.h"
    62 #include "MemoryArchive.h"
    6361#include "PathConfig.h"
    6462#include "ViewportEventListener.h"
     
    102100    GraphicsManager::GraphicsManager(bool bLoadRenderer)
    103101        : ogreWindowEventListener_(new OgreWindowEventListener())
    104 #if OGRE_VERSION < 0x010600
    105         , memoryArchiveFactory_(new MemoryArchiveFactory())
    106 #endif
    107102        , renderWindow_(0)
    108103        , viewport_(0)
     
    126121        // Only for development runs
    127122        if (PathConfig::isDevelopmentRun())
    128         {
    129123            Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getExternalDataPathString(), "FileSystem");
    130             extResources_.reset(new XMLFile("resources.oxr"));
    131             extResources_->setLuaSupport(false);
    132             Loader::open(extResources_.get());
    133         }
     124
     125        extResources_.reset(new XMLFile("resources.oxr"));
     126        extResources_->setLuaSupport(false);
     127        Loader::open(extResources_.get());
    134128
    135129        if (bLoadRenderer)
     
    156150        // Undeclare the resources
    157151        Loader::unload(resources_.get());
    158         if (PathConfig::isDevelopmentRun())
    159             Loader::unload(extResources_.get());
     152        Loader::unload(extResources_.get());
    160153    }
    161154
     
    164157        SetConfigValue(ogreConfigFile_,  "ogre.cfg")
    165158            .description("Location of the Ogre config file");
    166         SetConfigValue(ogrePluginsDirectory_, specialConfig::ogrePluginsDirectory)
    167             .description("Folder where the Ogre plugins are located.");
    168159        SetConfigValue(ogrePlugins_, specialConfig::ogrePlugins)
    169160            .description("Comma separated list of all plugins to load.");
     
    196187        this->loadRenderer();
    197188
    198 #if OGRE_VERSION < 0x010600
    199         // WORKAROUND: There is an incompatibility for particle scripts when trying
    200         // to support both Ogre 1.4 and 1.6. The hacky solution is to create
    201         // scripts for the 1.6 version and then remove the inserted "particle_system"
    202         // keyword. But we need to supply these new scripts as well, which is why
    203         // there is an extra Ogre::Archive dealing with it in the memory.
    204         using namespace Ogre;
    205         ArchiveManager::getSingleton().addArchiveFactory(memoryArchiveFactory_.get());
    206         const StringVector& groups = ResourceGroupManager::getSingleton().getResourceGroups();
    207         // Travers all groups
    208         for (StringVector::const_iterator itGroup = groups.begin(); itGroup != groups.end(); ++itGroup)
    209         {
    210             FileInfoListPtr files = ResourceGroupManager::getSingleton().findResourceFileInfo(*itGroup, "*.particle");
    211             for (FileInfoList::const_iterator itFile = files->begin(); itFile != files->end(); ++itFile)
    212             {
    213                 // open file
    214                 Ogre::DataStreamPtr input = ResourceGroupManager::getSingleton().openResource(itFile->filename, *itGroup, false);
    215                 std::stringstream output;
    216                 // Parse file and replace "particle_system" with nothing
    217                 while (!input->eof())
    218                 {
    219                     std::string line = input->getLine();
    220                     size_t pos = line.find("particle_system");
    221                     if (pos != std::string::npos)
    222                     {
    223                         // 15 is the length of "particle_system"
    224                         line.replace(pos, 15, "");
    225                     }
    226                     output << line << std::endl;
    227                 }
    228                 // Add file to the memory archive
    229                 shared_array<char> data(new char[output.str().size()]);
    230                 // Debug optimisations
    231                 const std::string& outputStr = output.str();
    232                 char* rawData = data.get();
    233                 for (unsigned i = 0; i < outputStr.size(); ++i)
    234                     rawData[i] = outputStr[i];
    235                 MemoryArchive::addFile("particle_scripts_ogre_1.4_" + *itGroup, itFile->filename, data, output.str().size());
    236             }
    237             if (!files->empty())
    238             {
    239                 // Declare the files, but using a new group
    240                 ResourceGroupManager::getSingleton().addResourceLocation("particle_scripts_ogre_1.4_" + *itGroup,
    241                     "Memory", "particle_scripts_ogre_1.4_" + *itGroup);
    242             }
    243         }
    244 #endif
    245 
    246189        // Initialise all resources (do this AFTER the renderer has been loaded!)
    247190        // Note: You can only do this once! Ogre will check whether a resource group has
     
    305248    void GraphicsManager::loadOgrePlugins()
    306249    {
    307         // just to make sure the next statement doesn't segfault
    308         if (ogrePluginsDirectory_.empty())
    309             ogrePluginsDirectory_ = '.';
    310 
    311         boost::filesystem::path folder(ogrePluginsDirectory_);
     250        // Plugin path can have many different locations...
     251        std::string pluginPath = specialConfig::ogrePluginsDirectory;
     252#ifdef DEPENDENCY_PACKAGE_ENABLE
     253        if (!PathConfig::isDevelopmentRun())
     254        {
     255#  if defined(ORXONOX_PLATFORM_WINDOWS)
     256            pluginPath = PathConfig::getExecutablePathString();
     257#  elif defined(ORXONOX_PLATFORM_APPLE)
     258            // TODO: Where are the plugins being installed to?
     259            pluginPath = PathConfig::getExecutablePathString();
     260#  endif
     261        }
     262#endif
     263
     264#ifdef ORXONOX_PLATFORM_WINDOWS
     265        // Add OGRE plugin path to the environment. That way one plugin could
     266        // also depend on another without problems on Windows
     267        const char* currentPATH = getenv("PATH");
     268        std::string newPATH = pluginPath;
     269        if (currentPATH != NULL)
     270            newPATH = std::string(currentPATH) + ';' + newPATH;
     271        putenv(const_cast<char*>(("PATH=" + newPATH).c_str()));
     272#endif
     273
    312274        // Do some SubString magic to get the comma separated list of plugins
    313275        SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '{', '}', false, '\0');
    314         // Use backslash paths on Windows! file_string() already does that though.
    315276        for (unsigned int i = 0; i < plugins.size(); ++i)
    316             ogreRoot_->loadPlugin((folder / plugins[i]).file_string());
     277            ogreRoot_->loadPlugin(pluginPath + '/' + plugins[i]);
    317278    }
    318279
  • code/trunk/src/libraries/core/GraphicsManager.h

    r8079 r8351  
    114114
    115115        scoped_ptr<OgreWindowEventListener> ogreWindowEventListener_; //!< Pimpl to hide OgreWindowUtilities.h
    116 #if OGRE_VERSION < 0x010600
    117         scoped_ptr<MemoryArchiveFactory>    memoryArchiveFactory_;    //!< Stores the modified particle scripts
    118 #endif
    119116        scoped_ptr<Ogre::LogManager>        ogreLogger_;
    120117        scoped_ptr<Ogre::Root>              ogreRoot_;                //!< Ogre's root
     
    131128        // config values
    132129        std::string         ogreConfigFile_;           //!< ogre config filename
    133         std::string         ogrePluginsDirectory_;     //!< Directory where the Ogre plugins are located
    134130        std::string         ogrePlugins_;              //!< Comma separated list of all plugins to load
    135131        std::string         ogreLogFile_;              //!< log filename for Ogre log messages
  • code/trunk/src/libraries/core/Identifier.h

    r7401 r8351  
    123123
    124124            /// Returns the unique ID of the class.
    125             FORCEINLINE unsigned int getClassID() const { return this->classID_; }
     125            ORX_FORCEINLINE unsigned int getClassID() const { return this->classID_; }
    126126
    127127            /// Returns the list of all existing objects of this class.
     
    395395    {
    396396        // Get the name of the class
    397         const std::string& name = typeid(T).name();
     397        std::string name = typeid(T).name();
    398398
    399399        // create a new identifier anyway. Will be deleted in Identifier::getIdentifier if not used.
     
    486486    */
    487487    template <class T, class U>
    488     FORCEINLINE T orxonox_cast(U* source)
     488    ORX_FORCEINLINE T orxonox_cast(U* source)
    489489    {
    490490#ifdef ORXONOX_COMPILER_MSVC
  • code/trunk/src/libraries/core/LuaState.cc

    r7284 r8351  
    3030#include "LuaState.h"
    3131
    32 #include <tolua/tolua++.h>
     32#include <tolua++.h>
    3333extern "C" {
    3434#include <lua.h>
     
    6060        luaState_ = lua_open();
    6161        Loki::ScopeGuard luaStateGuard = Loki::MakeGuard(&lua_close, luaState_);
    62 #if LUA_VERSION_NUM == 501
    6362        luaL_openlibs(luaState_);
    64 #else
    65         luaopen_base(luaState_);
    66         luaopen_string(luaState_);
    67         luaopen_table(luaState_);
    68         luaopen_math(luaState_);
    69         luaopen_io(luaState_);
    70         luaopen_debug(luaState_);
    71 #endif
    7263
    7364        // Open all available tolua interfaces
     
    187178        }
    188179
    189 #if LUA_VERSION_NUM != 501
    190         LoadS ls;
    191         ls.s = code.c_str();
    192         ls.size = code.size();
    193         int error = lua_load(luaState_, &orxonox::LuaState::lua_Chunkreader, &ls, chunkname.c_str());
    194 #else
    195180        int error = luaL_loadbuffer(luaState_, code.c_str(), code.size(), chunkname.c_str());
    196 #endif
    197181
    198182        switch (error)
     
    293277    }
    294278
    295 #if LUA_VERSION_NUM != 501
    296     const char * LuaState::lua_Chunkreader(lua_State *L, void *data, size_t *size)
    297     {
    298         LoadS* ls = static_cast<LoadS*>(data);
    299         if (ls->size == 0)
    300             return NULL;
    301         *size = ls->size;
    302         ls->size = 0;
    303         return ls->s;
    304     }
    305 #endif
    306 
    307279    /*static*/ bool LuaState::addToluaInterface(int (*function)(lua_State*), const std::string& name)
    308280    {
  • code/trunk/src/libraries/core/LuaState.h

    r7401 r8351  
    113113        shared_ptr<ResourceInfo> getFileInfo(const std::string& filename);
    114114
    115 #if LUA_VERSION_NUM != 501
    116         struct LoadS
    117         {
    118             const char* s;
    119             size_t size;
    120         };
    121 
    122         static const char * lua_Chunkreader(lua_State *L, void *data, size_t *size);
    123 #endif
    124 
    125115        std::stringstream output_;
    126116        lua_State* luaState_;
  • code/trunk/src/libraries/core/OrxonoxClass.h

    r8079 r8351  
    135135                Returns NULL if the no pointer was found.
    136136            */
    137             FORCEINLINE void* getDerivedPointer(unsigned int classID)
     137            ORX_FORCEINLINE void* getDerivedPointer(unsigned int classID)
    138138            {
    139139                for (int i = this->objectPointers_.size() - 1; i >= 0; --i)
     
    146146
    147147            /// Version of getDerivedPointer with template
    148             template <class T> FORCEINLINE T* getDerivedPointer(unsigned int classID)
     148            template <class T> ORX_FORCEINLINE T* getDerivedPointer(unsigned int classID)
    149149            {   return static_cast<T*>(this->getDerivedPointer(classID));   }
    150150            /// Const version of getDerivedPointer with template
    151             template <class T> FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
     151            template <class T> ORX_FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
    152152            {   return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID);   }
    153153
  • code/trunk/src/libraries/core/PathConfig.cc

    r6417 r8351  
    3333#include <cstdio>
    3434#include <vector>
    35 #include <boost/version.hpp>
    3635#include <boost/filesystem.hpp>
    3736
     
    5655#include "CommandLineParser.h"
    5756
    58 // Boost 1.36 has some issues with deprecated functions that have been omitted
    59 #if (BOOST_VERSION == 103600)
    60 #  define BOOST_LEAF_FUNCTION filename
     57// Differentiate Boost Filesystem v2 and v3
     58#if (BOOST_FILESYSTEM_VERSION < 3)
     59#  define BF_LEAF leaf
     60#  define BF_GENERIC_STRING string
     61#  define BF_NATIVE_STRING file_string
    6162#else
    62 #  define BOOST_LEAF_FUNCTION leaf
     63#  define BF_LEAF path().filename().string
     64#  define BF_GENERIC_STRING generic_string
     65#  define BF_NATIVE_STRING string
    6366#endif
    6467
     
    9598#elif defined(ORXONOX_PLATFORM_APPLE)
    9699        char buffer[1024];
    97         unsigned long path_len = 1023;
     100        uint32_t path_len = 1023;
    98101        if (_NSGetExecutablePath(buffer, &path_len))
    99102            ThrowException(General, "Could not retrieve executable path.");
     
    125128#endif
    126129
    127         executablePath_ = bf::path(buffer);
    128 #ifndef ORXONOX_PLATFORM_APPLE
    129         executablePath_ = executablePath_.branch_path(); // remove executable name
    130 #endif
     130        // Remove executable filename
     131        executablePath_ = bf::path(buffer).branch_path();
    131132
    132133        /////////////////////
     
    206207
    207208            // Get user directory
    208 #  ifdef ORXONOX_PLATFORM_UNIX /* Apple? */
     209#ifdef ORXONOX_PLATFORM_UNIX
    209210            char* userDataPathPtr(getenv("HOME"));
    210 #  else
     211#else
    211212            char* userDataPathPtr(getenv("APPDATA"));
    212 #  endif
     213#endif
    213214            if (userDataPathPtr == NULL)
    214215                ThrowException(General, "Could not retrieve user data path.");
     
    233234        // Create directories to avoid problems when opening files in non existent folders.
    234235        std::vector<std::pair<bf::path, std::string> > directories;
    235         directories.push_back(std::make_pair(bf::path(configPath_), "config"));
    236         directories.push_back(std::make_pair(bf::path(logPath_), "log"));
     236        directories.push_back(std::make_pair(bf::path(configPath_), std::string("config")));
     237        directories.push_back(std::make_pair(bf::path(logPath_), std::string("log")));
    237238
    238239        for (std::vector<std::pair<bf::path, std::string> >::iterator it = directories.begin();
     
    242243            {
    243244                ThrowException(General, std::string("The ") + it->second + " directory has been preoccupied by a file! \
    244                                          Please remove " + it->first.string());
     245                                         Please remove " + it->first.BF_GENERIC_STRING());
    245246            }
    246247            if (bf::create_directories(it->first)) // function may not return true at all (bug?)
     
    259260        size_t moduleextensionlength = moduleextension.size();
    260261
     262#ifdef ORXONOX_PLATFORM_WINDOWS
    261263        // Add that path to the PATH variable in case a module depends on another one
    262         std::string pathVariable(getenv("PATH"));
    263         putenv(const_cast<char*>(("PATH=" + pathVariable + ';' + modulePath_.string()).c_str()));
     264        const char* currentPATH = getenv("PATH");
     265        std::string newPATH = modulePath_.BF_NATIVE_STRING();
     266        if (currentPATH != NULL)
     267            newPATH = std::string(currentPATH) + ';' + newPATH;
     268        putenv(const_cast<char*>(("PATH=" + newPATH).c_str()));
     269#endif
    264270
    265271        // Make sure the path exists, otherwise don't load modules
     
    273279        while (file != end)
    274280        {
    275             const std::string& filename = file->BOOST_LEAF_FUNCTION();
    276 
    277             // Check if the file ends with the exension in question
     281            std::string filename = file->BF_LEAF();
     282
     283            // Check if the file ends with the extension in question
    278284            if (filename.size() > moduleextensionlength)
    279285            {
     
    282288                    // We've found a helper file
    283289                    const std::string& library = filename.substr(0, filename.size() - moduleextensionlength);
    284                     modulePaths.push_back((modulePath_ / library).file_string());
     290                    modulePaths.push_back(getModulePathString() + library);
    285291                }
    286292            }
     
    293299    /*static*/ std::string PathConfig::getRootPathString()
    294300    {
    295         return getInstance().rootPath_.string() + '/';
     301        return getInstance().rootPath_.BF_GENERIC_STRING() + '/';
    296302    }
    297303
    298304    /*static*/ std::string PathConfig::getExecutablePathString()
    299305    {
    300         return getInstance().executablePath_.string() + '/';
     306        return getInstance().executablePath_.BF_GENERIC_STRING() + '/';
    301307    }
    302308
    303309    /*static*/ std::string PathConfig::getDataPathString()
    304310    {
    305         return getInstance().dataPath_.string() + '/';
     311        return getInstance().dataPath_.BF_GENERIC_STRING() + '/';
    306312    }
    307313
    308314    /*static*/ std::string PathConfig::getExternalDataPathString()
    309315    {
    310         return getInstance().externalDataPath_.string() + '/';
     316        return getInstance().externalDataPath_.BF_GENERIC_STRING() + '/';
    311317    }
    312318
    313319    /*static*/ std::string PathConfig::getConfigPathString()
    314320    {
    315         return getInstance().configPath_.string() + '/';
     321        return getInstance().configPath_.BF_GENERIC_STRING() + '/';
    316322    }
    317323
    318324    /*static*/ std::string PathConfig::getLogPathString()
    319325    {
    320         return getInstance().logPath_.string() + '/';
     326        return getInstance().logPath_.BF_GENERIC_STRING() + '/';
    321327    }
    322328
    323329    /*static*/ std::string PathConfig::getModulePathString()
    324330    {
    325         return getInstance().modulePath_.string() + '/';
     331        return getInstance().modulePath_.BF_GENERIC_STRING() + '/';
    326332    }
    327333}
  • code/trunk/src/libraries/core/PathConfig.h

    r7427 r8351  
    113113            static std::string getModulePathString();
    114114
    115             //! Return trrue for runs in the build directory (not installed)
     115            //! Return true for runs in the build directory (not installed)
    116116            static bool isDevelopmentRun() { return getInstance().bDevRun_; }
    117117
  • code/trunk/src/libraries/core/Resource.cc

    r6746 r8351  
    3434#include <OgreResourceGroupManager.h>
    3535
     36// Differentiate Boost Filesystem v2 and v3
     37#if (BOOST_FILESYSTEM_VERSION < 3)
     38#  define BF_GENERIC_STRING string
     39#else
     40#  define BF_GENERIC_STRING generic_string
     41#endif
     42
    3643namespace orxonox
    3744{
    38     std::string Resource::DEFAULT_GROUP(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
     45    const std::string& Resource::getDefaultResourceGroup()
     46    {
     47        return Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME;
     48    }
    3949
    4050    DataStreamPtr Resource::open(const std::string& name)
    4151    {
    4252        return Ogre::ResourceGroupManager::getSingleton().openResource(name,
    43             Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
     53            getDefaultResourceGroup(), true);
    4454    }
    4555
     
    95105                    boost::filesystem::path base(it->archive->getName());
    96106                    base /= it->filename;
    97                     ptr->fileSystemPath = base.string();
     107                    ptr->fileSystemPath = base.BF_GENERIC_STRING();
    98108                }
    99109                return ptr;
  • code/trunk/src/libraries/core/Resource.h

    r7401 r8351  
    137137
    138138        //! Name of the default resource group (usually "General")
    139         static std::string DEFAULT_GROUP;
     139        static const std::string& getDefaultResourceGroup();
    140140
    141141    private:
  • code/trunk/src/libraries/core/Super.h

    r7401 r8351  
    9494        struct SuperFunctionCondition<functionnumber, T, 0, templatehack2> \
    9595        { \
    96             static void check() \
     96            static void superCheck() \
    9797            { \
    9898                SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0)); \
    99                 SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::check(); \
     99                SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::superCheck(); \
    100100            } \
    101101            \
     
    132132        struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \
    133133        { \
    134             static void check() \
    135             { \
    136                 SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::check(); \
     134            static void superCheck() \
     135            { \
     136                SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::superCheck(); \
    137137            } \
    138138        };
     
    150150        struct SuperFunctionCondition<functionnumber, T, 0, templatehack2>
    151151        {
    152             static void check()
     152            static void superCheck()
    153153            {
    154154                // This call to the apply-function is the whole check. By calling the function with
     
    156156                SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0));
    157157
    158                 // Go go the check for of next super-function (functionnumber + 1)
    159                 SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::check();
     158                // Go go the superCheck for of next super-function (functionnumber + 1)
     159                SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::superCheck();
    160160            }
    161161
     
    202202        struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \
    203203        { \
    204             // The check function acts like the fallback - it advances to the check for the next super-function (functionnumber + 1)
    205             static void check() \
    206             { \
    207                 SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::check(); \
     204            // The superCheck function acts like the fallback - it advances to the check for the next super-function (functionnumber + 1)
     205            static void superCheck() \
     206            { \
     207                SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::superCheck(); \
    208208            } \
    209209        };
     
    303303        struct SuperFunctionCondition
    304304        {
    305             static void check() {}
     305            static void superCheck() {}
    306306        };
    307307
     
    338338            struct SuperFunctionCondition<functionnumber, T, templatehack1, templatehack2> \
    339339            { \
    340                 static void check() \
     340                static void superCheck() \
    341341                { \
    342                     SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::check(); \
     342                    SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::superCheck(); \
    343343                } \
    344344            }; \
     
    421421            // If this function gets called, the header-file of the super function is not
    422422            // included, so this fallback template (templatehack not specialized) is used
    423             static void check()
     423            static void superCheck()
    424424            {
    425425                // Calls the condition-check of the next super-function (functionnumber + 1)
    426                 SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::check();
     426                SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::superCheck();
    427427            }
    428428        };
     
    574574        virtual void createSuperFunctionCaller() const
    575575        {
    576             SuperFunctionCondition<0, T, 0, 0>::check();
     576            SuperFunctionCondition<0, T, 0, 0>::superCheck();
    577577        }
    578578
  • code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.cc

    r7401 r8351  
    3535
    3636#include <map>
    37 #include <boost/version.hpp>
    3837#include <boost/filesystem.hpp>
    3938
     
    4746#include "TclThreadManager.h"
    4847
    49 // Boost 1.36 has some issues with deprecated functions that have been omitted
    50 #if (BOOST_VERSION == 103600)
    51 #  define BOOST_LEAF_FUNCTION filename
     48// Differentiate Boost Filesystem v2 and v3
     49#if (BOOST_FILESYSTEM_VERSION < 3)
     50#  define BF_LEAF leaf
     51#  define BF_GENERIC_STRING string
     52#  define BF_DICTIONARY_ENTRY_NAME string
    5253#else
    53 #  define BOOST_LEAF_FUNCTION leaf
     54#  define BF_LEAF path().filename().string
     55#  define BF_GENERIC_STRING generic_string
     56#  define BF_DICTIONARY_ENTRY_NAME path().string
    5457#endif
    5558
     
    245248                else
    246249                {
    247                     const std::string& dir = startdirectory.string();
     250                    const std::string& dir = startdirectory.BF_GENERIC_STRING();
    248251                    if (dir.size() > 0 && dir[dir.size() - 1] == ':')
    249252                        startdirectory = dir + '/';
     
    257260                {
    258261                    if (boost::filesystem::is_directory(*file))
    259                         dirlist.push_back(ArgumentCompletionListElement(file->string() + '/', getLowercase(file->string()) + '/', file->BOOST_LEAF_FUNCTION() + '/'));
     262                        dirlist.push_back(ArgumentCompletionListElement(file->BF_DICTIONARY_ENTRY_NAME() + '/', getLowercase(file->BF_DICTIONARY_ENTRY_NAME()) + '/', file->BF_LEAF() + '/'));
    260263                    else
    261                         filelist.push_back(ArgumentCompletionListElement(file->string(), getLowercase(file->string()), file->BOOST_LEAF_FUNCTION()));
     264                        filelist.push_back(ArgumentCompletionListElement(file->BF_DICTIONARY_ENTRY_NAME(), getLowercase(file->BF_DICTIONARY_ENTRY_NAME()), file->BF_LEAF()));
    262265                    ++file;
    263266                }
  • code/trunk/src/libraries/core/command/TclThreadManager.cc

    r8079 r8351  
    116116    TclThreadManager::~TclThreadManager()
    117117    {
     118        delete this->interpreterBundles_[0];
    118119        delete this->interpreterBundlesMutex_;
    119 //        delete this->mainInterpreterMutex_; // <-- temporary disabled to avoid crash if a thread is still actively queriyng
     120//        delete this->mainInterpreterMutex_; // <-- temporarily disabled to avoid crash if a thread is still actively querying
    120121        delete this->messageQueue_;
    121122    }
  • code/trunk/src/libraries/core/input/InputDevice.h

    r7271 r8351  
    184184    protected:
    185185        //! Common code for all button pressed events (updates pressed buttons list and calls the input states)
    186         FORCEINLINE void buttonPressed(ButtonTypeParam button)
     186        ORX_FORCEINLINE void buttonPressed(ButtonTypeParam button)
    187187        {
    188188            // check whether the button already is in the list (can happen when focus was lost)
     
    201201
    202202        //! Common code for all button released events (updates pressed buttons list and calls the input states)
    203         FORCEINLINE void buttonReleased(ButtonTypeParam button)
     203        ORX_FORCEINLINE void buttonReleased(ButtonTypeParam button)
    204204        {
    205205            // remove the button from the pressedButtons_ list
  • code/trunk/src/libraries/core/input/InputManager.cc

    r8079 r8351  
    151151        assert(devices_.size() == InputDeviceEnumerator::FirstJoyStick);
    152152
     153        typedef std::pair<std::string, std::string> StringPair;
     154
    153155        // Fill parameter list
    154156        OIS::ParamList paramList;
    155157        size_t windowHnd = GraphicsManager::getInstance().getRenderWindowHandle();
    156         paramList.insert(std::make_pair("WINDOW", multi_cast<std::string>(windowHnd)));
     158        paramList.insert(StringPair("WINDOW", multi_cast<std::string>(windowHnd)));
    157159#if defined(ORXONOX_PLATFORM_WINDOWS)
    158         paramList.insert(std::make_pair("w32_keyboard", "DISCL_NONEXCLUSIVE"));
    159         paramList.insert(std::make_pair("w32_keyboard", "DISCL_FOREGROUND"));
    160         paramList.insert(std::make_pair("w32_mouse", "DISCL_FOREGROUND"));
     160        paramList.insert(StringPair("w32_keyboard", "DISCL_NONEXCLUSIVE"));
     161        paramList.insert(StringPair("w32_keyboard", "DISCL_FOREGROUND"));
     162        paramList.insert(StringPair("w32_mouse", "DISCL_FOREGROUND"));
    161163        if (exclusiveMouse_ == TriBool::True || GraphicsManager::getInstance().isFullScreen())
    162164        {
    163165            // Disable Windows key plus special keys (like play, stop, next, etc.)
    164             paramList.insert(std::make_pair("w32_keyboard", "DISCL_NOWINKEY"));
    165             paramList.insert(std::make_pair("w32_mouse", "DISCL_EXCLUSIVE"));
    166         }
    167         else
    168             paramList.insert(std::make_pair("w32_mouse", "DISCL_NONEXCLUSIVE"));
     166            paramList.insert(StringPair("w32_keyboard", "DISCL_NOWINKEY"));
     167            paramList.insert(StringPair("w32_mouse", "DISCL_EXCLUSIVE"));
     168        }
     169        else
     170            paramList.insert(StringPair("w32_mouse", "DISCL_NONEXCLUSIVE"));
    169171#elif defined(ORXONOX_PLATFORM_LINUX)
    170172        // Enabling this is probably a bad idea, but whenever orxonox crashes, the setting stays on
    171173        // Trouble might be that the Pressed event occurs a bit too often...
    172         paramList.insert(std::make_pair("XAutoRepeatOn", "true"));
     174        paramList.insert(StringPair("XAutoRepeatOn", "true"));
    173175
    174176        if (exclusiveMouse_ == TriBool::True || GraphicsManager::getInstance().isFullScreen())
    175177        {
    176178            if (CommandLineParser::getValue("keyboard_no_grab").getBool())
    177                 paramList.insert(std::make_pair("x11_keyboard_grab", "false"));
     179                paramList.insert(StringPair("x11_keyboard_grab", "false"));
    178180            else
    179                 paramList.insert(std::make_pair("x11_keyboard_grab", "true"));
    180             paramList.insert(std::make_pair("x11_mouse_grab",  "true"));
    181             paramList.insert(std::make_pair("x11_mouse_hide", "true"));
    182         }
    183         else
    184         {
    185             paramList.insert(std::make_pair("x11_keyboard_grab", "false"));
    186             paramList.insert(std::make_pair("x11_mouse_grab",  "false"));
    187             paramList.insert(std::make_pair("x11_mouse_hide", "false"));
     181                paramList.insert(StringPair("x11_keyboard_grab", "true"));
     182            paramList.insert(StringPair("x11_mouse_grab",  "true"));
     183            paramList.insert(StringPair("x11_mouse_hide", "true"));
     184        }
     185        else
     186        {
     187            paramList.insert(StringPair("x11_keyboard_grab", "false"));
     188            paramList.insert(StringPair("x11_mouse_grab",  "false"));
     189            paramList.insert(StringPair("x11_mouse_hide", "false"));
    188190        }
    189191#endif
  • code/trunk/src/libraries/core/input/InputState.h

    r7401 r8351  
    176176    };
    177177
    178     FORCEINLINE void InputState::update(float dt)
     178    ORX_FORCEINLINE void InputState::update(float dt)
    179179    {
    180180        for (unsigned int i = 0; i < handlers_.size(); ++i)
     
    183183    }
    184184
    185     FORCEINLINE void InputState::update(float dt, unsigned int device)
     185    ORX_FORCEINLINE void InputState::update(float dt, unsigned int device)
    186186    {
    187187        switch (device)
     
    205205
    206206    template <typename EventType, class ButtonTypeParam>
    207     FORCEINLINE void InputState::buttonEvent(unsigned int device, ButtonTypeParam button)
     207    ORX_FORCEINLINE void InputState::buttonEvent(unsigned int device, ButtonTypeParam button)
    208208    {
    209209        assert(device < handlers_.size());
     
    216216    }
    217217
    218     FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
     218    ORX_FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
    219219    {
    220220        if (handlers_[mouseIndex_s] != NULL)
     
    222222    }
    223223
    224     FORCEINLINE void InputState::mouseScrolled(int abs, int rel)
     224    ORX_FORCEINLINE void InputState::mouseScrolled(int abs, int rel)
    225225    {
    226226        if (handlers_[mouseIndex_s] != NULL)
     
    228228    }
    229229
    230     FORCEINLINE void InputState::joyStickAxisMoved(unsigned int device, unsigned int axis, float value)
     230    ORX_FORCEINLINE void InputState::joyStickAxisMoved(unsigned int device, unsigned int axis, float value)
    231231    {
    232232        assert(device < handlers_.size());
  • code/trunk/src/libraries/core/input/KeyBinder.cc

    r8079 r8351  
    396396
    397397            // iterate over all modes
    398             for (size_t mode_index = 0; mode_index < 3; ++mode_index)
    399             {
    400                 if (mode_index == (unsigned int)new_mode) // skip commands that are already in the desired mode
     398            for (int mode_index = 0; mode_index < 3; ++mode_index)
     399            {
     400                if (mode_index == new_mode) // skip commands that are already in the desired mode
    401401                    continue;
    402402
Note: See TracChangeset for help on using the changeset viewer.