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
Files:
2 deleted
67 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
  • code/trunk/src/libraries/network/CMakeLists.txt

    r8327 r8351  
    8787    enet_orxonox
    8888    ${Boost_THREAD_LIBRARY}
     89    ${CEGUI_TOLUA_LIBRARY}
    8990    util
    9091    core
  • code/trunk/src/libraries/network/LANDiscoverable.cc

    • Property svn:eol-style set to native
    r7801 r8351  
    2929#include "LANDiscoverable.h"
    3030
    31 #include "NetworkPrereqs.h"
    32 #include "packet/ServerInformation.h"
    33 
    3431#include <enet/enet.h>
    3532#include <cassert>
    3633#include <cstring>
     34
     35#include "util/Debug.h"
     36#include "packet/ServerInformation.h"
    3737
    3838namespace orxonox
  • code/trunk/src/libraries/network/LANDiscoverable.h

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/LANDiscovery.cc

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/LANDiscovery.h

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/MasterServer.cc

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/MasterServer.h

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/MasterServerComm.cc

    • Property svn:eol-style set to native
    r7801 r8351  
    2828
    2929#include "MasterServerComm.h"
     30#include "util/Debug.h"
    3031
    3132namespace orxonox
  • code/trunk/src/libraries/network/MasterServerComm.h

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/MasterServerProtocol.h

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/NetworkPrecompiledHeaders.h

    r7952 r8351  
    6262#include <cmath>    // 15
    6363
    64 #define WIN32_LEAN_AND_MEAN
    65 #include <enet/enet.h> // 6, 3.1MB
    66 
    6764#include <OgreMath.h>        // 15
    6865#include <OgreVector2.h>     // 15
     
    7168#include <OgreQuaternion.h>  // 15
    7269#include <OgreColourValue.h> // 15
     70
     71#define WIN32_LEAN_AND_MEAN
     72#include <enet/enet.h> // 6, 3.1MB
    7373
    7474#include "util/mbool.h" // 11
  • code/trunk/src/libraries/network/NetworkPrereqs.h

    r8327 r8351  
    5252#    endif
    5353#  endif
    54 #elif defined ( ORXONOX_GCC_VISIBILITY )
     54#  define _NetworkPrivate
     55#elif defined (ORXONOX_GCC_VISIBILITY)
    5556#  define _NetworkExport  __attribute__ ((visibility("default")))
     57#  define _NetworkPrivate __attribute__ ((visibility("hidden")))
    5658#else
    5759#  define _NetworkExport
     60#  define _NetworkPrivate
    5861#endif
    5962
  • code/trunk/src/libraries/network/PeerList.cc

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/PeerList.h

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/Server.cc

    r8327 r8351  
    252252   * @brief: return packet loss ratio to client (scales from 0 to 1)
    253253   */
    254   double Server::getPacketLoss(unsigned int clientID)
     254  float Server::getPacketLoss(unsigned int clientID)
    255255  {
    256256//     assert(ClientInformation::findClient(clientID));
  • code/trunk/src/libraries/network/Server.h

    r8327 r8351  
    7474    unsigned int getRTT(unsigned int clientID);
    7575    virtual void printRTT();
    76     double getPacketLoss(unsigned int clientID);
     76    float getPacketLoss(unsigned int clientID);
    7777  protected:
    7878    void updateGamestate();
  • code/trunk/src/libraries/network/ServerList.cc

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/ServerList.h

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/WANDiscoverable.cc

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/WANDiscoverable.h

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/WANDiscovery.cc

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/WANDiscovery.h

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/packet/FunctionCalls.cc

    r7801 r8351  
    3333#include "network/FunctionCallManager.h"
    3434#include "network/GamestateHandler.h"
     35#include "network/Host.h"
    3536
    3637namespace orxonox {
  • code/trunk/src/libraries/network/packet/ServerInformation.cc

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/network/packet/ServerInformation.h

    • Property svn:eol-style set to native
  • code/trunk/src/libraries/tools/BulletConversions.h

    r5781 r8351  
    4343    struct ConverterExplicit<orxonox::Vector3, btVector3>
    4444    {
    45         FORCEINLINE static bool convert(btVector3* output, const orxonox::Vector3& input)
     45        ORX_FORCEINLINE static bool convert(btVector3* output, const orxonox::Vector3& input)
    4646        {
    4747            output->setX(input.x);
     
    5656    struct ConverterExplicit<btVector3, orxonox::Vector3>
    5757    {
    58         FORCEINLINE static bool convert(orxonox::Vector3* output, const btVector3& input)
     58        ORX_FORCEINLINE static bool convert(orxonox::Vector3* output, const btVector3& input)
    5959        {
    6060            output->x = input.x();
     
    6969    struct ConverterExplicit<orxonox::Quaternion, btQuaternion>
    7070    {
    71         FORCEINLINE static bool convert(btQuaternion* output, const orxonox::Quaternion& input)
     71        ORX_FORCEINLINE static bool convert(btQuaternion* output, const orxonox::Quaternion& input)
    7272        {
    7373            output->setW(input.w);
     
    8383    struct ConverterExplicit<btQuaternion, orxonox::Quaternion>
    8484    {
    85         FORCEINLINE static bool convert(orxonox::Quaternion* output, const btQuaternion& input)
     85        ORX_FORCEINLINE static bool convert(orxonox::Quaternion* output, const btQuaternion& input)
    8686        {
    8787            output->w = input.w();
  • code/trunk/src/libraries/tools/CMakeLists.txt

    r7172 r8351  
    2121  FIND_HEADER_FILES
    2222  LINK_LIBRARIES
     23    ${OGRE_LIBRARY}
     24    ${Boost_FILESYSTEM_LIBRARY}
     25    ${Boost_SYSTEM_LIBRARY} # Filesystem dependency
     26    tinyxml_orxonox
     27    util
    2328    core
    24   SOURCE_FILES ${TOOLS_SRC_FILES}
     29  SOURCE_FILES
     30    ${TOOLS_SRC_FILES}
    2531)
  • code/trunk/src/libraries/tools/Mesh.cc

    r6417 r8351  
    6969                this->entity_ = this->scenemanager_->createEntity("Mesh" + multi_cast<std::string>(Mesh::meshCounter_s++), meshsource);
    7070                this->entity_->setCastShadows(this->bCastShadows_);
    71 
    72 #if OGRE_VERSION < 0x010600
    73                 this->entity_->setNormaliseNormals(true);
    74                 /*
    75                     Excerpt from Ogre forum:
    76                     "Note that the above is only for the fixed function pipeline.
    77                     If/when you get into shaders, you'll need to manually normalize() the normal inside the vertex or pixel shader."
    78 
    79                     I don't know exactly what this means, but I put this here if there will be problems with shaders.
    80                 */
    81 #endif
    8271            }
    8372            catch (...)
  • code/trunk/src/libraries/tools/ResourceCollection.cc

    r7401 r8351  
    4545
    4646        // Default group is "General"
    47         this->setResourceGroup(Resource::DEFAULT_GROUP);
     47        this->setResourceGroup(Resource::getDefaultResourceGroup());
    4848    }
    4949
  • code/trunk/src/libraries/tools/ToolsPrereqs.h

    r8079 r8351  
    5252#    endif
    5353#  endif
    54 #elif defined ( ORXONOX_GCC_VISIBILITY )
     54#  define _ToolsPrivate
     55#elif defined (ORXONOX_GCC_VISIBILITY)
    5556#  define _ToolsExport  __attribute__ ((visibility("default")))
     57#  define _ToolsPrivate __attribute__ ((visibility("hidden")))
    5658#else
    5759#  define _ToolsExport
     60#  define _ToolsPrivate
    5861#endif
    5962
  • code/trunk/src/libraries/util/CMakeLists.txt

    r7449 r8351  
    1919
    2020SET_SOURCE_FILES(UTIL_SRC_FILES
    21   Clock.cc
    22   Exception.cc
    23   ExprParser.cc
    24   Math.cc
    25   MultiType.cc
    26   Scope.cc
    27   StringUtils.cc
    2821COMPILATION_BEGIN StableCompilation.cc
    2922  Clipboard.cc
     23  Clock.cc
    3024  Convert.cc
    3125  CRC32.cc
     26  ExprParser.cc
    3227  OutputHandler.cc
     28  Scope.cc
    3329  ScopedSingletonManager.cc
    3430  SharedPtr.cc
    35   SignalHandler.cc
    3631  Sleep.cc
    3732  SmallObjectAllocator.cc
    3833  SubString.cc
    3934COMPILATION_END
     35
     36  MultiType.cc
     37  Exception.cc
     38  Math.cc
     39  SignalHandler.cc
     40  StringUtils.cc
    4041)
    4142
    42 IF(GCC_NO_SYSTEM_HEADER_SUPPORT)
    43   # Get around displaying a few hundred lines of warning code
    44   SET_SOURCE_FILES_PROPERTIES(MultiType.cc PROPERTIES COMPILE_FLAGS "-w")
    45 ENDIF()
    4643IF(MSVC)
    4744  # Simply using #pragma warning(disable:4244) doesn't really disable it
  • code/trunk/src/libraries/util/Convert.h

    r7401 r8351  
    143143    struct ConverterFallback
    144144    {
    145         FORCEINLINE static bool convert(ToType* output, const FromType& input)
     145        ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input)
    146146        {
    147147            COUT(2) << "Could not convert value of type " << typeid(FromType).name()
     
    155155    struct ConverterFallback<FromType*, ToType*>
    156156    {
    157         FORCEINLINE static bool convert(ToType** output, FromType* const input)
     157        ORX_FORCEINLINE static bool convert(ToType** output, FromType* const input)
    158158        {
    159159            ToType* temp = dynamic_cast<ToType*>(input);
     
    182182struct ConverterStringStream
    183183{
    184     FORCEINLINE static bool convert(ToType* output, const FromType& input)
     184    ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input)
    185185    {
    186186        return orxonox::ConverterFallback<FromType, ToType>::convert(output, input);
     
    198198    /// Fallback operator <<() (delegates to orxonox::ConverterFallback)
    199199    template <class FromType>
    200     FORCEINLINE bool operator <<(std::ostream& outstream,  const FromType& input)
     200    ORX_FORCEINLINE bool operator <<(std::ostream& outstream,  const FromType& input)
    201201    {
    202202        std::string temp;
     
    215215struct ConverterStringStream<FromType, std::string>
    216216{
    217     FORCEINLINE static bool convert(std::string* output, const FromType& input)
     217    ORX_FORCEINLINE static bool convert(std::string* output, const FromType& input)
    218218    {
    219219        using namespace fallbackTemplates;
     
    241241    /// Fallback operator >>() (delegates to orxonox::ConverterFallback)
    242242    template <class ToType>
    243     FORCEINLINE bool operator >>(std::istream& instream, ToType& output)
     243    ORX_FORCEINLINE bool operator >>(std::istream& instream, ToType& output)
    244244    {
    245245        std::string input(static_cast<std::istringstream&>(instream).str());
     
    252252struct ConverterStringStream<std::string, ToType>
    253253{
    254     FORCEINLINE static bool convert(ToType* output, const std::string& input)
     254    ORX_FORCEINLINE static bool convert(ToType* output, const std::string& input)
    255255    {
    256256        using namespace fallbackTemplates;
     
    276276    /// %Template delegates to ::ConverterStringStream
    277277    template <class FromType, class ToType>
    278     FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<false>)
     278    ORX_FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<false>)
    279279    {
    280280        return ConverterStringStream<FromType, ToType>::convert(output, input);
     
    283283    /// Makes an implicit cast from \a FromType to \a ToType
    284284    template <class FromType, class ToType>
    285     FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<true>)
     285    ORX_FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<true>)
    286286    {
    287287        (*output) = static_cast<ToType>(input);
     
    303303    {
    304304        enum { probe = ImplicitConversion<FromType, ToType>::exists };
    305         FORCEINLINE static bool convert(ToType* output, const FromType& input)
     305        ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input)
    306306        {
    307307            // Use the probe's value to delegate to the right function
     
    327327    */
    328328    template <class FromType, class ToType>
    329     FORCEINLINE bool convertValue(ToType* output, const FromType& input)
     329    ORX_FORCEINLINE bool convertValue(ToType* output, const FromType& input)
    330330    {
    331331        return ConverterExplicit<FromType, ToType>::convert(output, input);
     
    348348    */
    349349    template<class FromType, class ToType>
    350     FORCEINLINE bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
     350    ORX_FORCEINLINE bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
    351351    {
    352352        if (convertValue(output, input))
     
    361361    /// Directly returns the converted value, but uses the fallback on failure. @see convertValue
    362362    template<class FromType, class ToType>
    363     FORCEINLINE ToType getConvertedValue(const FromType& input, const ToType& fallback)
     363    ORX_FORCEINLINE ToType getConvertedValue(const FromType& input, const ToType& fallback)
    364364    {
    365365        ToType output;
     
    380380    */
    381381    template<class ToType, class FromType>
    382     FORCEINLINE ToType multi_cast(const FromType& input)
     382    ORX_FORCEINLINE ToType multi_cast(const FromType& input)
    383383    {
    384384        ToType output;
     
    395395    struct ConverterExplicit<const char*, ToType>
    396396    {
    397         FORCEINLINE static bool convert(ToType* output, const char* input)
     397        ORX_FORCEINLINE static bool convert(ToType* output, const char* input)
    398398        {
    399399            return convertValue<std::string, ToType>(output, input);
     
    405405    struct ConverterExplicit<char, std::string>
    406406    {
    407         FORCEINLINE static bool convert(std::string* output, const char input)
     407        ORX_FORCEINLINE static bool convert(std::string* output, const char input)
    408408        {
    409409            *output = input;
     
    415415    struct ConverterExplicit<unsigned char, std::string>
    416416    {
    417         FORCEINLINE static bool convert(std::string* output, const unsigned char input)
     417        ORX_FORCEINLINE static bool convert(std::string* output, const unsigned char input)
    418418        {
    419419            *output = input;
     
    425425    struct ConverterExplicit<std::string, char>
    426426    {
    427         FORCEINLINE static bool convert(char* output, const std::string& input)
     427        ORX_FORCEINLINE static bool convert(char* output, const std::string& input)
    428428        {
    429429            if (!input.empty())
     
    438438    struct ConverterExplicit<std::string, unsigned char>
    439439    {
    440         FORCEINLINE static bool convert(unsigned char* output, const std::string& input)
     440        ORX_FORCEINLINE static bool convert(unsigned char* output, const std::string& input)
    441441        {
    442442            if (!input.empty())
     
    453453    struct ConverterExplicit<bool, std::string>
    454454    {
    455         FORCEINLINE static bool convert(std::string* output, const bool& input)
     455        ORX_FORCEINLINE static bool convert(std::string* output, const bool& input)
    456456        {
    457457            if (input)
  • code/trunk/src/libraries/util/Exception.cc

    r7401 r8351  
    3535#include "Exception.h"
    3636
     37#include <cstddef>
    3738#include <CEGUIExceptions.h>
    3839#include "Debug.h"
     
    9596            throw;
    9697        }
     98        catch (const CEGUI::Exception& ex)
     99        {
     100            return GeneralException(ex.getMessage().c_str(), ex.getLine(),
     101                ex.getFileName().c_str(), ex.getName().c_str()).getDescription();
     102        }
    97103        catch (const std::exception& ex)
    98104        {
    99105            return ex.what();
    100         }
    101         catch (const CEGUI::Exception& ex)
    102         {
    103 #if CEGUI_VERSION_MAJOR == 0 && CEGUI_VERSION_MINOR < 6
    104             return GeneralException(ex.getMessage().c_str()).getDescription();
    105 #else
    106             return GeneralException(ex.getMessage().c_str(), ex.getLine(),
    107                 ex.getFileName().c_str(), ex.getName().c_str()).getDescription();
    108 #endif
    109106        }
    110107        catch (...)
  • code/trunk/src/libraries/util/ExprParser.cc

    r7184 r8351  
    5252    {
    5353        this->failed_ = false;
    54         this->variables_["pi"] = math::pi_d;
    55         this->variables_["e"] = math::e_d;
    56     }
    57 
    58     void ExprParser::setVariable(const std::string& varname, double value)
     54        this->variables_["pi"] = math::pi;
     55        this->variables_["e"] = math::e;
     56    }
     57
     58    void ExprParser::setVariable(const std::string& varname, float value)
    5959    {
    6060        this->variables_[varname] = value;
     
    7878    //Private functions:
    7979    /******************/
    80     double ExprParser::parse_argument()
    81     {
    82         double value = parse_expr_8();
     80    float ExprParser::parse_argument()
     81    {
     82        float value = parse_expr_8();
    8383        if (*reading_stream == ',')
    8484        {
     
    9393    }
    9494
    95     double ExprParser::parse_last_argument()
    96     {
    97         double value = parse_expr_8();
     95    float ExprParser::parse_last_argument()
     96    {
     97        float value = parse_expr_8();
    9898        if (*reading_stream == ')')
    9999        {
     
    108108    }
    109109
    110     double ExprParser::parse_expr_8()
    111     {
    112         double value = parse_expr_7();
     110    float ExprParser::parse_expr_8()
     111    {
     112        float value = parse_expr_7();
    113113        for(;;)
    114114        {
     
    124124
    125125
    126     double ExprParser::parse_expr_7()
    127     {
    128         double value = parse_expr_6();
     126    float ExprParser::parse_expr_7()
     127    {
     128        float value = parse_expr_6();
    129129        for(;;)
    130130        {
     
    139139    }
    140140
    141     double ExprParser::parse_expr_6()
    142     {
    143         double value = parse_expr_5();
     141    float ExprParser::parse_expr_6()
     142    {
     143        float value = parse_expr_5();
    144144        for(;;)
    145145        {
     
    158158    }
    159159
    160     double ExprParser::parse_expr_5()
    161     {
    162         double value = parse_expr_4();
     160    float ExprParser::parse_expr_5()
     161    {
     162        float value = parse_expr_4();
    163163        for(;;)
    164164        {
     
    183183    }
    184184
    185     double ExprParser::parse_expr_4()
    186     {
    187         double value = parse_expr_3();
     185    float ExprParser::parse_expr_4()
     186    {
     187        float value = parse_expr_3();
    188188        for(;;)
    189189        {
     
    202202    }
    203203
    204     double ExprParser::parse_expr_3()
    205     {
    206         double value = parse_expr_2();
     204    float ExprParser::parse_expr_3()
     205    {
     206        float value = parse_expr_2();
    207207        for(;;)
    208208        {
     
    217217            case modulo:
    218218                {
    219                     double temp = parse_expr_2();
     219                    float temp = parse_expr_2();
    220220                    value = value - floor(value/temp)*temp;
    221221                    break;
     
    227227    }
    228228
    229     double ExprParser::parse_expr_2()
    230     {
    231         double value = parse_expr_1();
     229    float ExprParser::parse_expr_2()
     230    {
     231        float value = parse_expr_1();
    232232        while (*reading_stream != '\0')
    233233        {
     
    246246    }
    247247
    248     double ExprParser::parse_expr_1()
     248    float ExprParser::parse_expr_1()
    249249    {
    250250        PARSE_BLANKS;
    251         double value;
     251        float value;
    252252
    253253        unary_operator op = parse_unary_operator();
     
    262262        else if ((*reading_stream > 47 && *reading_stream < 59) || *reading_stream == 46)
    263263        {  // number
    264             value = strtod(reading_stream, const_cast<char**>(&reading_stream));
     264            value = (float)strtod(reading_stream, const_cast<char**>(&reading_stream));
    265265        }
    266266        else if ((*reading_stream > 64 && *reading_stream < 91) || (*reading_stream > 96 && *reading_stream < 123) || *reading_stream == 46)
     
    306306                {
    307307                    value = parse_last_argument();
    308                     value = 0.5*log((value + 1)/(value - 1));
     308                    value = 0.5f*log((value + 1.0f)/(value - 1.0f));
    309309                }
    310310                CASE("int")
     
    325325                {
    326326                    value = parse_last_argument();
    327                     value = (value>0 ? 1 : (value<0 ? -1 : 0));
     327                    value = (value>0.0f ? 1.0f : (value<0.0f ? -1.0f : 0.0f));
    328328                }
    329329                CASE("sqrt")
    330330                    value = sqrt(parse_last_argument());
    331331                CASE("degrees")
    332                     value = parse_last_argument()*180/math::pi_d;
     332                    value = parse_last_argument()*180.0f/math::pi;
    333333                CASE("radians")
    334                     value = parse_last_argument()*math::pi_d/180;
     334                    value = parse_last_argument()*math::pi/180.0f;
    335335                CASE("mod")
    336336                {
    337337                    value = parse_argument();
    338                     double value2 = parse_last_argument();
     338                    float value2 = parse_last_argument();
    339339                    value = value - floor(value/value2)*value2;
    340340                }
     
    356356            else
    357357            {
    358                 std::map<std::string, double>::const_iterator it = this->variables_.find(word);
     358                std::map<std::string, float>::const_iterator it = this->variables_.find(word);
    359359                if (it != this->variables_.end())
    360360                    value = it->second;
  • code/trunk/src/libraries/util/ExprParser.h

    r7401 r8351  
    5757                COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << std::endl;
    5858            }
    59             double result = expr.getResult();
     59            float result = expr.getResult();
    6060        }
    6161        else
     
    125125        void parse(const std::string& str);
    126126        const std::string& getRemains() { return  this->remains_; }
    127         double             getResult()  { return  this->result_; }
     127        float              getResult()  { return  this->result_; }
    128128        bool               getSuccess() { return !this->failed_; }
    129129
    130         void setVariable(const std::string& varname, double value);
     130        void setVariable(const std::string& varname, float value);
    131131
    132132    private:
    133         double parse_expr_1();
    134         double parse_expr_2();
    135         double parse_expr_3();
    136         double parse_expr_4();
    137         double parse_expr_5();
    138         double parse_expr_6();
    139         double parse_expr_7();
    140         double parse_expr_8();
     133        float parse_expr_1();
     134        float parse_expr_2();
     135        float parse_expr_3();
     136        float parse_expr_4();
     137        float parse_expr_5();
     138        float parse_expr_6();
     139        float parse_expr_7();
     140        float parse_expr_8();
    141141        char* parse_word(char* str);
    142142        binary_operator parse_binary_operator();
    143143        unary_operator parse_unary_operator();
    144144
    145         double parse_argument();
    146         double parse_last_argument();
     145        float parse_argument();
     146        float parse_last_argument();
    147147
    148148        binary_operator op;
    149149        const char* reading_stream;
    150150        bool failed_;
    151         double result_;
     151        float result_;
    152152        std::string remains_;
    153         std::map<std::string, double> variables_;
     153        std::map<std::string, float> variables_;
    154154    };
    155155
    156156    //Endzeichen für float expression: ')', '}', ']', ',', ';'
    157     _UtilExport bool parse_float(char* const, char**, double*);
     157    _UtilExport bool parse_float(char* const, char**, float*);
    158158    //Endzeichen angegeben
    159     _UtilExport bool parse_float(char* const, char**, char, double*);
     159    _UtilExport bool parse_float(char* const, char**, char, float*);
    160160    //Letzter Teil-float eines Vektors parsen (keine Vergleichs- und Logikoperationen)
    161     _UtilExport bool parse_vector_float(char* const, char**, bool, double*);
     161    _UtilExport bool parse_vector_float(char* const, char**, bool, float*);
    162162}
    163163
  • code/trunk/src/libraries/util/Math.h

    r7427 r8351  
    6666namespace orxonox
    6767{
    68     // C++ doesn't define any constants for pi, e, etc.
     68    /** Often used numerical constants because C++ doesn't define any.
     69    @note
     70        The values here are decimal representations of the approximate floating
     71        point value as it is stored according to the IEEE 754 standard.
     72    */
    6973    namespace math
    7074    {
    71         const float pi      = 3.14159265f;      ///< PI
    72         const float pi_2    = 1.57079633f;      ///< PI / 2
    73         const float pi_4    = 7.85398163e-1f;   ///< PI / 4
    74         const float e       = 2.71828183f;      ///< e
    75         const float sqrt2   = 1.41421356f;      ///< sqrt(2)
    76         const float sqrt2_2 = 7.07106781e-1f;   ///< sqrt(2) / 2
    77 
    78         const double pi_d      = 3.14159265358979324;       ///< PI (double)
    79         const double pi_2_d    = 1.57079632679489662;       ///< PI / 2 (double)
    80         const double pi_4_d    = 7.85398163397448310e-1;    ///< PI / 4 (double)
    81         const double e_d       = 2.71828182845904524;       ///< e (double)
    82         const double sqrt2_d   = 1.41421356237309505;       ///< sqrt(2) (double)
    83         const double sqrt2_2_d = 7.07106781186547524e-1;    ///< sqrt(2) / 2 (double)
     75        const float twoPi   = 6.283185482025146484375f;     ///< PI * 2
     76        const float pi      = 3.1415927410125732421875f;    ///< PI
     77        const float pi_2    = 1.57079637050628662109375f;   ///< PI / 2
     78        const float pi_4    = 0.785398185253143310546875f;  ///< PI / 4
     79        const float e       = 2.718281269073486328125f;     ///< e
     80        const float sqrt2   = 1.41421353816986083984375f;   ///< sqrt(2)
     81        const float sqrt2_2 = 0.707106769084930419921875f;  ///< sqrt(2) / 2
    8482    }
    8583
  • code/trunk/src/libraries/util/MathConvert.h

    r7401 r8351  
    5151    struct ConverterExplicit<orxonox::Vector2, std::string>
    5252    {
    53         FORCEINLINE static bool convert(std::string* output, const orxonox::Vector2& input)
     53        ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector2& input)
    5454        {
    5555            std::ostringstream ostream;
     
    6767    struct ConverterExplicit<orxonox::Vector3, std::string>
    6868    {
    69         FORCEINLINE static bool convert(std::string* output, const orxonox::Vector3& input)
     69        ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector3& input)
    7070        {
    7171            std::ostringstream ostream;
     
    8383    struct ConverterExplicit<orxonox::Vector4, std::string>
    8484    {
    85         FORCEINLINE static bool convert(std::string* output, const orxonox::Vector4& input)
     85        ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector4& input)
    8686        {
    8787            std::ostringstream ostream;
     
    9999    struct ConverterExplicit<orxonox::Quaternion, std::string>
    100100    {
    101         FORCEINLINE static bool convert(std::string* output, const orxonox::Quaternion& input)
     101        ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Quaternion& input)
    102102        {
    103103            std::ostringstream ostream;
     
    115115    struct ConverterExplicit<orxonox::ColourValue, std::string>
    116116    {
    117         FORCEINLINE static bool convert(std::string* output, const orxonox::ColourValue& input)
     117        ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::ColourValue& input)
    118118        {
    119119            std::ostringstream ostream;
     
    157157    struct ConverterFallback<orxonox::Radian, ToType>
    158158    {
    159         FORCEINLINE static bool convert(ToType* output, const orxonox::Radian& input)
     159        ORX_FORCEINLINE static bool convert(ToType* output, const orxonox::Radian& input)
    160160        {
    161161            return convertValue<Ogre::Real, ToType>(output, input.valueRadians());
     
    167167    struct ConverterFallback<orxonox::Degree, ToType>
    168168    {
    169         FORCEINLINE static bool convert(ToType* output, const orxonox::Degree& input)
     169        ORX_FORCEINLINE static bool convert(ToType* output, const orxonox::Degree& input)
    170170        {
    171171            return convertValue<Ogre::Real, ToType>(output, input.valueDegrees());
     
    177177    struct ConverterFallback<FromType, orxonox::Radian>
    178178    {
    179         FORCEINLINE static bool convert(orxonox::Radian* output, const FromType& input)
     179        ORX_FORCEINLINE static bool convert(orxonox::Radian* output, const FromType& input)
    180180        {
    181181            float temp;
     
    194194    struct ConverterFallback<FromType, orxonox::Degree>
    195195    {
    196         FORCEINLINE static bool convert(orxonox::Degree* output, const FromType& input)
     196        ORX_FORCEINLINE static bool convert(orxonox::Degree* output, const FromType& input)
    197197        {
    198198            float temp;
  • code/trunk/src/libraries/util/SharedPtr.h

    r7401 r8351  
    163163            public:
    164164                SharedCounter() : count_(1) {}
     165                virtual ~SharedCounter() {}
    165166                virtual void destroy() = 0;
    166167
     
    186187        _UtilExport SmallObjectAllocator& createSharedCounterPool();
    187188
    188         FORCEINLINE SmallObjectAllocator& getSharedCounterPool()
     189        ORX_FORCEINLINE SmallObjectAllocator& getSharedCounterPool()
    189190        {
    190191            static SmallObjectAllocator& instance = createSharedCounterPool();
  • code/trunk/src/libraries/util/SignalHandler.cc

    r7801 r8351  
    3737#include <cstdlib>
    3838#include <cstring>
     39#include <cstdio>
    3940
    4041#include "Debug.h"
  • code/trunk/src/libraries/util/SignalHandler.h

    r7457 r8351  
    7070
    7171    /// The SignalHandler is used to catch signals like SIGSEGV and write a backtrace to the logfile.
    72     class SignalHandler : public Singleton<SignalHandler>
     72    class _UtilExport SignalHandler : public Singleton<SignalHandler>
    7373    {
    7474        friend class Singleton<SignalHandler>;
  • code/trunk/src/libraries/util/UtilPrereqs.h

    r6417 r8351  
    5252#    endif
    5353#  endif
    54 #elif defined ( ORXONOX_GCC_VISIBILITY )
     54#  define _UtilPrivate
     55#elif defined (ORXONOX_GCC_VISIBILITY)
    5556#  define _UtilExport  __attribute__ ((visibility("default")))
     57#  define _UtilPrivate __attribute__ ((visibility("hidden")))
    5658#else
    5759#  define _UtilExport
     60#  define _UtilPrivate
    5861#endif
    5962
Note: See TracChangeset for help on using the changeset viewer.