Revision: 1689
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1689&view=rev
Author:   rorthomas
Date:     2011-02-20 11:33:19 +0000 (Sun, 20 Feb 2011)

Log Message:
-----------
basics working again :)

Modified Paths:
--------------
    trunk/source/main/framework/AdvancedOgreFramework.cpp
    trunk/source/main/framework/AppStateManager.cpp
    trunk/source/main/framework/GameState.cpp
    trunk/source/main/gameplay/RoRFrameListener.cpp
    trunk/source/main/gfx/ColoredTextAreaOverlayElementFactory.h
    trunk/source/main/gui/OverlayWrapper.cpp
    trunk/source/main/gui/SelectorWindow.cpp
    trunk/source/main/gui/SelectorWindow.h
    trunk/source/main/main_sim/RigsOfRods.cpp
    trunk/source/main/main_sim/RigsOfRods.h
    trunk/source/main/physics/BeamFactory.cpp
    trunk/source/main/physics/input_output/BeamLoadTruck.cpp

Added Paths:
-----------
    trunk/source/main/framework/AdvancedOgreFramework.h
    trunk/source/main/framework/AppState.h
    trunk/source/main/framework/AppStateManager.h
    trunk/source/main/framework/ContentManager.cpp
    trunk/source/main/framework/ContentManager.h
    trunk/source/main/framework/GameState.h

Removed Paths:
-------------
    trunk/source/main/framework/AdvancedOgreFramework.hpp
    trunk/source/main/framework/AppState.hpp
    trunk/source/main/framework/AppStateManager.hpp
    trunk/source/main/framework/GameState.hpp

Modified: trunk/source/main/framework/AdvancedOgreFramework.cpp
===================================================================
--- trunk/source/main/framework/AdvancedOgreFramework.cpp       2011-02-19 
23:09:27 UTC (rev 1688)
+++ trunk/source/main/framework/AdvancedOgreFramework.cpp       2011-02-20 
11:33:19 UTC (rev 1689)
@@ -1,6 +1,6 @@
 //|||||||||||||||||||||||||||||||||||||||||||||||
 
-#include "AdvancedOgreFramework.hpp"
+#include "AdvancedOgreFramework.h"
 
 #include "Settings.h"
 #include "errorutils.h"
@@ -21,7 +21,6 @@
     m_pRoot                            = 0;
     m_pRenderWnd               = 0;
     m_pViewport                        = 0;
-    m_pLog                             = 0;
     m_pTimer                   = 0;
 }
 
@@ -29,9 +28,9 @@
 
 OgreFramework::~OgreFramework()
 {
-    OgreFramework::getSingletonPtr()->m_pLog->logMessage("Shutdown OGRE...");
+       LogManager::getSingleton().logMessage("Shutdown OGRE...");
     //if(m_pTrayMgr)      delete m_pTrayMgr;
-    if(m_pRoot)                        delete m_pRoot;
+    //if(m_pRoot)                      delete m_pRoot;
 }
 
 //|||||||||||||||||||||||||||||||||||||||||||||||
@@ -87,12 +86,16 @@
        this->hwnd     = hwnd;
        this->mainhwnd = mainhwnd;
 
-    Ogre::LogManager* logMgr = new Ogre::LogManager();
+       if(!SETTINGS.setupPaths())
+               return false;
 
-    m_pLog = Ogre::LogManager::getSingleton().createLog(name + ".log", true, 
true, false);
-    m_pLog->setDebugOutputEnabled(true);
+       // load RoR.cfg directly after setting up paths
+       SETTINGS.loadSettings(SETTINGS.getSetting("Config Root")+"RoR.cfg");
 
-    m_pRoot = new Ogre::Root();
+       String logFilename   = SETTINGS.getSetting("Log Path") + name + 
Ogre::String(".log");
+       String pluginsConfig = SETTINGS.getSetting("plugins.cfg");
+       String ogreConfig    = SETTINGS.getSetting("ogre.cfg");
+    m_pRoot = new Ogre::Root(pluginsConfig, ogreConfig, logFilename);
 
        // configure RoR
        configure();
@@ -101,12 +104,16 @@
     m_pViewport->setBackgroundColour(ColourValue(0.5f, 0.5f, 0.5f, 1.0f));
 
     m_pViewport->setCamera(0);
+       m_pViewport->setBackgroundColour(ColourValue::Black);
 
+       //
+       //mRoot->setFrameSmoothingPeriod(2.0);
+
        // init inputsystem
 
 
     Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
-    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+    //Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
 
     //m_pTrayMgr = new OgreBites::SdkTrayManager("AOFTrayMgr", m_pRenderWnd, 
m_pMouse, 0);
 
@@ -115,6 +122,29 @@
 
     m_pRenderWnd->setActive(true);
 
+       // set window icon correctly
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#ifndef _UNICODE
+       if(hwnd == 0)
+       {
+               // only in non-embedded mode
+               size_t hWnd = 0;
+               m_pRenderWnd->getCustomAttribute("WINDOW", &hWnd);
+
+               char buf[MAX_PATH];
+               ::GetModuleFileNameA(0, (LPCH)&buf, MAX_PATH);
+
+               HINSTANCE instance = ::GetModuleHandleA(buf);
+               HICON hIcon = ::LoadIconA(instance, MAKEINTRESOURCE(1001));
+               if (hIcon)
+               {
+                       ::SendMessageA((HWND)hWnd, WM_SETICON, 1, 
(LPARAM)hIcon);
+                       ::SendMessageA((HWND)hWnd, WM_SETICON, 0, 
(LPARAM)hIcon);
+               }
+       }
+#endif //_UNICODE
+#endif //OGRE_PLATFORM_WIN32
+
     return true;
 }
 

Added: trunk/source/main/framework/AdvancedOgreFramework.h
===================================================================
--- trunk/source/main/framework/AdvancedOgreFramework.h                         
(rev 0)
+++ trunk/source/main/framework/AdvancedOgreFramework.h 2011-02-20 11:33:19 UTC 
(rev 1689)
@@ -0,0 +1,58 @@
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#ifndef OGRE_FRAMEWORK_HPP
+#define OGRE_FRAMEWORK_HPP
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#include <OgreCamera.h>
+#include <OgreEntity.h>
+#include <OgreLogManager.h>
+#include <OgreOverlay.h>
+#include <OgreOverlayElement.h>
+#include <OgreOverlayManager.h>
+#include <OgreRoot.h>
+#include <OgreViewport.h>
+#include <OgreSceneManager.h>
+#include <OgreRenderWindow.h>
+#include <OgreConfigFile.h>
+
+//#include <SdkTrays.h>
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+class OgreFramework : public Ogre::Singleton<OgreFramework>
+{
+public:
+       OgreFramework();
+       ~OgreFramework();
+
+       bool initOgre(Ogre::String name, unsigned int hwnd, unsigned int 
mainhwnd);
+       void updateOgre(double timeSinceLastFrame);
+
+       Ogre::Root*                                     m_pRoot;
+       Ogre::RenderWindow*                     m_pRenderWnd;
+       Ogre::Viewport*                         m_pViewport;
+       Ogre::Timer*                            m_pTimer;
+
+    //OgreBites::SdkTrayManager*       m_pTrayMgr;
+
+       bool isEmbedded(void) { return (hwnd != 0); };
+       unsigned int getMainHWND() { return mainhwnd; };
+
+private:
+       OgreFramework(const OgreFramework&);
+       OgreFramework& operator= (const OgreFramework&);
+
+       unsigned int hwnd;
+       unsigned int mainhwnd;
+       Ogre::String name;
+
+       bool configure();
+};
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#endif
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
\ No newline at end of file

Deleted: trunk/source/main/framework/AdvancedOgreFramework.hpp
===================================================================
--- trunk/source/main/framework/AdvancedOgreFramework.hpp       2011-02-19 
23:09:27 UTC (rev 1688)
+++ trunk/source/main/framework/AdvancedOgreFramework.hpp       2011-02-20 
11:33:19 UTC (rev 1689)
@@ -1,56 +0,0 @@
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#ifndef OGRE_FRAMEWORK_HPP
-#define OGRE_FRAMEWORK_HPP
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#include <OgreCamera.h>
-#include <OgreEntity.h>
-#include <OgreLogManager.h>
-#include <OgreOverlay.h>
-#include <OgreOverlayElement.h>
-#include <OgreOverlayManager.h>
-#include <OgreRoot.h>
-#include <OgreViewport.h>
-#include <OgreSceneManager.h>
-#include <OgreRenderWindow.h>
-#include <OgreConfigFile.h>
-
-//#include <SdkTrays.h>
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-class OgreFramework : public Ogre::Singleton<OgreFramework>
-{
-public:
-       OgreFramework();
-       ~OgreFramework();
-
-       bool initOgre(Ogre::String name, unsigned int hwnd, unsigned int 
mainhwnd);
-       void updateOgre(double timeSinceLastFrame);
-
-       Ogre::Root*                                     m_pRoot;
-       Ogre::RenderWindow*                     m_pRenderWnd;
-       Ogre::Viewport*                         m_pViewport;
-       Ogre::Log*                                      m_pLog;
-       Ogre::Timer*                            m_pTimer;
-
-    //OgreBites::SdkTrayManager*       m_pTrayMgr;
-
-private:
-       OgreFramework(const OgreFramework&);
-       OgreFramework& operator= (const OgreFramework&);
-
-       unsigned int hwnd;
-       unsigned int mainhwnd;
-       Ogre::String name;
-
-       bool configure();
-};
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#endif
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
\ No newline at end of file

Added: trunk/source/main/framework/AppState.h
===================================================================
--- trunk/source/main/framework/AppState.h                              (rev 0)
+++ trunk/source/main/framework/AppState.h      2011-02-20 11:33:19 UTC (rev 
1689)
@@ -0,0 +1,77 @@
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#ifndef APP_STATE_HPP
+#define APP_STATE_HPP
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#include "AdvancedOgreFramework.h"
+
+class AppState;
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+class AppStateListener
+{
+public:
+       AppStateListener(){};
+       virtual ~AppStateListener(){};
+
+       virtual void manageAppState(Ogre::String stateName, AppState* state) = 
0;
+
+       virtual AppState*       findByName(Ogre::String stateName) = 0;
+       virtual void            changeAppState(AppState *state) = 0;
+       virtual bool            pushAppState(AppState* state) = 0;
+       virtual void            popAppState() = 0;
+       virtual void            pauseAppState() = 0;
+       virtual void            shutdown() = 0;
+    virtual void        popAllAndPushAppState(AppState* state) = 0;
+};
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+class AppState
+{
+public:
+       static void create(AppStateListener* parent, const Ogre::String name){};
+
+       void destroy(){delete this;}
+
+       virtual void enter() = 0;
+       virtual void exit() = 0;
+       virtual bool pause(){return true;}
+       virtual void resume(){};
+       virtual void update(double timeSinceLastFrame) = 0;
+
+protected:
+       AppState(){};
+
+       AppState*       findByName(Ogre::String stateName){return 
m_pParent->findByName(stateName);}
+       void            changeAppState(AppState* 
state){m_pParent->changeAppState(state);}
+       bool            pushAppState(AppState* state){return 
m_pParent->pushAppState(state);}
+       void            popAppState(){m_pParent->popAppState();}
+       void            shutdown(){m_pParent->shutdown();}
+    void        popAllAndPushAppState(AppState* 
state){m_pParent->popAllAndPushAppState(state);}
+
+       AppStateListener*                       m_pParent;
+
+       Ogre::Camera*                           m_pCamera;
+       Ogre::SceneManager*                     m_pSceneMgr;
+    Ogre::FrameEvent            m_FrameEvent;
+};
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#define DECLARE_APPSTATE_CLASS(T)                                              
                                \
+static void create(AppStateListener* parent, const Ogre::String name)  \
+{                                                                              
                                                                \
+       T* myAppState = new T();                                                
                                        \
+       myAppState->m_pParent = parent;                                         
                                \
+       parent->manageAppState(name, myAppState);                               
                        \
+}
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#endif
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
\ No newline at end of file

Deleted: trunk/source/main/framework/AppState.hpp
===================================================================
--- trunk/source/main/framework/AppState.hpp    2011-02-19 23:09:27 UTC (rev 
1688)
+++ trunk/source/main/framework/AppState.hpp    2011-02-20 11:33:19 UTC (rev 
1689)
@@ -1,77 +0,0 @@
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#ifndef APP_STATE_HPP
-#define APP_STATE_HPP
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#include "AdvancedOgreFramework.hpp"
-
-class AppState;
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-class AppStateListener
-{
-public:
-       AppStateListener(){};
-       virtual ~AppStateListener(){};
-
-       virtual void manageAppState(Ogre::String stateName, AppState* state) = 
0;
-
-       virtual AppState*       findByName(Ogre::String stateName) = 0;
-       virtual void            changeAppState(AppState *state) = 0;
-       virtual bool            pushAppState(AppState* state) = 0;
-       virtual void            popAppState() = 0;
-       virtual void            pauseAppState() = 0;
-       virtual void            shutdown() = 0;
-    virtual void        popAllAndPushAppState(AppState* state) = 0;
-};
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-class AppState
-{
-public:
-       static void create(AppStateListener* parent, const Ogre::String name){};
-
-       void destroy(){delete this;}
-
-       virtual void enter() = 0;
-       virtual void exit() = 0;
-       virtual bool pause(){return true;}
-       virtual void resume(){};
-       virtual void update(double timeSinceLastFrame) = 0;
-
-protected:
-       AppState(){};
-
-       AppState*       findByName(Ogre::String stateName){return 
m_pParent->findByName(stateName);}
-       void            changeAppState(AppState* 
state){m_pParent->changeAppState(state);}
-       bool            pushAppState(AppState* state){return 
m_pParent->pushAppState(state);}
-       void            popAppState(){m_pParent->popAppState();}
-       void            shutdown(){m_pParent->shutdown();}
-    void        popAllAndPushAppState(AppState* 
state){m_pParent->popAllAndPushAppState(state);}
-
-       AppStateListener*                       m_pParent;
-
-       Ogre::Camera*                           m_pCamera;
-       Ogre::SceneManager*                     m_pSceneMgr;
-    Ogre::FrameEvent            m_FrameEvent;
-};
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#define DECLARE_APPSTATE_CLASS(T)                                              
                                \
-static void create(AppStateListener* parent, const Ogre::String name)  \
-{                                                                              
                                                                \
-       T* myAppState = new T();                                                
                                        \
-       myAppState->m_pParent = parent;                                         
                                \
-       parent->manageAppState(name, myAppState);                               
                        \
-}
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#endif
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
\ No newline at end of file

Modified: trunk/source/main/framework/AppStateManager.cpp
===================================================================
--- trunk/source/main/framework/AppStateManager.cpp     2011-02-19 23:09:27 UTC 
(rev 1688)
+++ trunk/source/main/framework/AppStateManager.cpp     2011-02-20 11:33:19 UTC 
(rev 1689)
@@ -1,9 +1,12 @@
 //|||||||||||||||||||||||||||||||||||||||||||||||
 
-#include "AppStateManager.hpp"
+#include "AppStateManager.h"
 
 #include <OgreWindowEventUtilities.h>
+#include <OgreLogManager.h>
 
+using namespace Ogre;
+
 //|||||||||||||||||||||||||||||||||||||||||||||||
 
 AppStateManager::AppStateManager()
@@ -101,7 +104,7 @@
                }
        }
 
-       OgreFramework::getSingletonPtr()->m_pLog->logMessage("Main loop quit");
+       LogManager::getSingleton().logMessage("Main loop quit");
 }
 
 //|||||||||||||||||||||||||||||||||||||||||||||||

Added: trunk/source/main/framework/AppStateManager.h
===================================================================
--- trunk/source/main/framework/AppStateManager.h                               
(rev 0)
+++ trunk/source/main/framework/AppStateManager.h       2011-02-20 11:33:19 UTC 
(rev 1689)
@@ -0,0 +1,48 @@
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#ifndef APP_STATE_MANAGER_HPP
+#define APP_STATE_MANAGER_HPP
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#include "AppState.h"
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+class AppStateManager : public AppStateListener
+{
+public:
+       typedef struct
+       {
+               Ogre::String name;
+               AppState* state;
+       } state_info;
+
+       AppStateManager();
+       ~AppStateManager();
+
+       void manageAppState(Ogre::String stateName, AppState* state);
+
+       AppState* findByName(Ogre::String stateName);
+
+       void start(AppState* state);
+       void changeAppState(AppState* state);
+       bool pushAppState(AppState* state);
+       void popAppState();
+       void pauseAppState();
+       void shutdown();
+    void popAllAndPushAppState(AppState* state);
+
+protected:
+       void init(AppState *state);
+
+       std::vector<AppState*>          m_ActiveStateStack;
+       std::vector<state_info>         m_States;
+       bool                                            m_bShutdown;
+};
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#endif
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
\ No newline at end of file

Deleted: trunk/source/main/framework/AppStateManager.hpp
===================================================================
--- trunk/source/main/framework/AppStateManager.hpp     2011-02-19 23:09:27 UTC 
(rev 1688)
+++ trunk/source/main/framework/AppStateManager.hpp     2011-02-20 11:33:19 UTC 
(rev 1689)
@@ -1,48 +0,0 @@
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#ifndef APP_STATE_MANAGER_HPP
-#define APP_STATE_MANAGER_HPP
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#include "AppState.hpp"
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-class AppStateManager : public AppStateListener
-{
-public:
-       typedef struct
-       {
-               Ogre::String name;
-               AppState* state;
-       } state_info;
-
-       AppStateManager();
-       ~AppStateManager();
-
-       void manageAppState(Ogre::String stateName, AppState* state);
-
-       AppState* findByName(Ogre::String stateName);
-
-       void start(AppState* state);
-       void changeAppState(AppState* state);
-       bool pushAppState(AppState* state);
-       void popAppState();
-       void pauseAppState();
-       void shutdown();
-    void popAllAndPushAppState(AppState* state);
-
-protected:
-       void init(AppState *state);
-
-       std::vector<AppState*>          m_ActiveStateStack;
-       std::vector<state_info>         m_States;
-       bool                                            m_bShutdown;
-};
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#endif
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
\ No newline at end of file

Added: trunk/source/main/framework/ContentManager.cpp
===================================================================
--- trunk/source/main/framework/ContentManager.cpp                              
(rev 0)
+++ trunk/source/main/framework/ContentManager.cpp      2011-02-20 11:33:19 UTC 
(rev 1689)
@@ -0,0 +1,208 @@
+/*
+This source file is part of Rigs of Rods
+Copyright 2005-2011 Pierre-Michel Ricordel
+Copyright 2007-2011 Thomas Fischer
+
+For more information, see http://www.rigsofrods.com/
+
+Rigs of Rods is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 3, as 
+published by the Free Software Foundation.
+
+Rigs of Rods is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Rigs of Rods.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "ContentManager.h"
+
+#include <Ogre.h>
+
+#include "Settings.h"
+#include "ColoredTextAreaOverlayElementFactory.h"
+#include "SoundScriptManager.h"
+#include "skinmanager.h"
+#include "language.h"
+
+using namespace Ogre;
+using namespace std;
+
+template<> ContentManager* Ogre::Singleton<ContentManager>::ms_Singleton = 0;
+
+ContentManager::ContentManager()
+{
+}
+
+ContentManager::~ContentManager()
+{
+}
+
+void ContentManager::loadMainResource(String name, String group)
+{
+       String dirsep="/";
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+       dirsep="\\";
+#endif
+
+       
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("Resources
 Path")+dirsep+name, "FileSystem", group, true);
+       try
+       {
+               
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("Resources
 Path")+name+".zip", "Zip", group, true);
+       } catch(...) {}
+}
+
+bool ContentManager::init(void)
+{
+       //try to get correct paths
+       //note: we don't have LogManager available yet!
+       //FIRST: Get the "program path" and the user space path
+
+       // note: this is now done in the settings class, so set it up
+       // note: you need to set the buildmode correcty before you build the 
paths!
+
+       // by default, display everything in the depth map
+       Ogre::MovableObject::setDefaultVisibilityFlags(DEPTHMAP_ENABLED);
+
+       CACHE.setLocation(SETTINGS.getSetting("Cache Path"), 
SETTINGS.getSetting("Config Root"));
+
+       ColoredTextAreaOverlayElementFactory *cef = new 
ColoredTextAreaOverlayElementFactory();
+       OverlayManager::getSingleton().addOverlayElementFactory(cef);
+
+
+
+       //load bootstrap and main resources
+       String dirsep="/";
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+       dirsep="\\";
+#endif
+       //bootstrap
+       LogManager::getSingleton().logMessage("Loading Bootstrap");
+       loadMainResource("OgreCore", "Bootstrap");
+       //main game resources
+       LogManager::getSingleton().logMessage("Loading main resources");
+       loadMainResource("airfoils");
+       loadMainResource("materials");
+       loadMainResource("meshes");
+       loadMainResource("overlays");
+       loadMainResource("particles");
+       loadMainResource("mygui", "cache"); // HACK for mygui only supporting 
one resource group
+       loadMainResource("scripts");
+       loadMainResource("textures");
+       loadMainResource("flags");
+       loadMainResource("icons");
+
+       // optional ones
+
+       // sound iss a bit special as we mark the base sounds so we dont clear 
them accidentially later on
+#ifdef USE_OPENAL
+       LogManager::getSingleton().logMessage("Creating Sound Manager");
+       SoundScriptManager *ssm = SoundScriptManager::getSingleton();
+       if(ssm) ssm->setLoadingBaseSounds(true);
+#endif // USE_OPENAL
+       if (SETTINGS.getSetting("3D Sound renderer") != "No sound")
+               loadMainResource("sounds");
+
+       if (SETTINGS.getSetting("Sky effects") == "Caelum (best looking, 
slower)")
+               loadMainResource("caelum");
+
+       if(SETTINGS.getSetting("Hydrax") == "Yes")
+               loadMainResource("hydrax", "Hydrax"); // special resourcegroup 
required!
+
+       if(SETTINGS.getSetting("Vegetation") != "None (fastest)")
+               loadMainResource("paged");
+
+       if(SETTINGS.getSetting("HDR") == "Yes")
+               loadMainResource("hdr");
+
+       if(SETTINGS.getSetting("DOF") == "Yes")
+               loadMainResource("dof");
+
+       if(SETTINGS.getSetting("Glow") == "Yes")
+               loadMainResource("glow");
+
+       if(SETTINGS.getSetting("Motion blur") == "Yes")
+               loadMainResource("blur");
+
+       if(SETTINGS.getSetting("HeatHaze") == "Yes")
+               loadMainResource("heathaze");
+
+       if (SETTINGS.getSetting("Sunburn")!="Yes")
+               loadMainResource("sunburn");
+
+       if (SETTINGS.getSetting("Shadow technique")=="Parallel-split Shadow 
Maps")
+               loadMainResource("pssm");
+
+       //streams path, to be processed later by the cache system
+       LogManager::getSingleton().logMessage("Loading filesystems");
+
+       
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("User
 Path")+"cache", "FileSystem", "cache");
+       //config, flat
+       
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("User
 Path")+"config", "FileSystem", 
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+       
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("User
 Path")+"alwaysload", "FileSystem", 
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+       //packs, to be processed later by the cache system
+
+       // add scripts folder
+       
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("User
 Path")+"scripts", "FileSystem", "Scripts", true);
+
+       // init skin manager, important to happen before trucks resource 
loading!
+       LogManager::getSingleton().logMessage("registering Skin Manager");
+       new SkinManager();
+
+       LogManager::getSingleton().logMessage("registering colored text overlay 
factory");
+       ColoredTextAreaOverlayElementFactory *pCT = new 
ColoredTextAreaOverlayElementFactory();
+       OverlayManager::getSingleton().addOverlayElementFactory(pCT);
+
+       // Set default mipmap level (NB some APIs ignore this)
+       TextureManager::getSingleton().setDefaultNumMipmaps(5);
+       String tft=SETTINGS.getSetting("Texture Filtering");
+       TextureFilterOptions tfo=TFO_NONE;
+       if (tft=="Bilinear") tfo=TFO_BILINEAR;
+       if (tft=="Trilinear") tfo=TFO_TRILINEAR;
+       if (tft=="Anisotropic (best looking)") tfo=TFO_ANISOTROPIC;
+       MaterialManager::getSingleton().setDefaultAnisotropy(8);
+       MaterialManager::getSingleton().setDefaultTextureFiltering(tfo);
+
+       // load all resources now, so the zip files are also initiated
+       LogManager::getSingleton().logMessage("initialiseAllResourceGroups()");
+       try
+       {
+               
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+       } catch(Ogre::Exception& e)
+       {
+               LogManager::getSingleton().logMessage("catched error while 
initializing Resource groups: " + e.getFullDescription());
+       }
+#ifdef USE_OPENAL
+       if(ssm) ssm->setLoadingBaseSounds(false);
+#endif // USE_OPENAL
+
+
+       // and the content
+       //main synced streams
+       
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("Streams
 Path"),      "FileSystem", "Streams", true);
+       
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("User
 Path")+"packs", "FileSystem", "Packs", true);
+       
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("User
 Path")+"mods",  "FileSystem", "Packs", true);
+
+       
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("User
 Path")+"vehicles", "FileSystem", "VehicleFolders", true);
+       
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("User
 Path")+"terrains", "FileSystem", "TerrainFolders", true);
+
+       LogManager::getSingleton().logMessage("initialiseAllResourceGroups() - 
Content");
+       try
+       {
+               
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+       } catch(Ogre::Exception& e)
+       {
+               LogManager::getSingleton().logMessage("catched error while 
initializing Content Resource groups: " + e.getFullDescription());
+       }
+
+#ifndef NOLANG
+       // load language, must happen after initializing Settings class and 
Ogre Root!
+       // also it must happen after loading all basic resources!
+       LanguageEngine::Instance().setup();
+#endif //NOLANG
+       return true;
+}
+

Added: trunk/source/main/framework/ContentManager.h
===================================================================
--- trunk/source/main/framework/ContentManager.h                                
(rev 0)
+++ trunk/source/main/framework/ContentManager.h        2011-02-20 11:33:19 UTC 
(rev 1689)
@@ -0,0 +1,44 @@
+/*
+This source file is part of Rigs of Rods
+Copyright 2005-2011 Pierre-Michel Ricordel
+Copyright 2007-2011 Thomas Fischer
+
+For more information, see http://www.rigsofrods.com/
+
+Rigs of Rods is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 3, as 
+published by the Free Software Foundation.
+
+Rigs of Rods is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Rigs of Rods.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CONTENTMANAGER_H__
+#define CONTENTMANAGER_H__
+
+#include <OgreSingleton.h>
+
+#include <OgreResourceGroupManager.h>
+//#include "RoR
+
+class ContentManager : public Ogre::Singleton<ContentManager>
+{
+public:
+       ContentManager();
+       ~ContentManager();
+
+       bool init(void);
+
+private:
+       ContentManager(const ContentManager&);
+       ContentManager& operator= (const ContentManager&);
+
+       void loadMainResource(Ogre::String name, Ogre::String 
group=Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+};
+
+#endif // CONTENTMANAGER_H__

Modified: trunk/source/main/framework/GameState.cpp
===================================================================
--- trunk/source/main/framework/GameState.cpp   2011-02-19 23:09:27 UTC (rev 
1688)
+++ trunk/source/main/framework/GameState.cpp   2011-02-20 11:33:19 UTC (rev 
1689)
@@ -1,112 +1,78 @@
+#include "GameState.h"
 
-#include "GameState.hpp"
+#include "RoRFrameListener.h"
 
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
 using namespace Ogre;
 
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
 GameState::GameState()
 {
 }
 
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
 void GameState::enter()
 {
-    OgreFramework::getSingletonPtr()->m_pLog->logMessage("Entering 
GameState...");
+    LogManager::getSingleton().logMessage("Entering GameState...");
 
-    m_pSceneMgr = 
OgreFramework::getSingletonPtr()->m_pRoot->createSceneManager(ST_GENERIC, 
"GameSceneMgr");
-    m_pSceneMgr->setAmbientLight(Ogre::ColourValue(0.7f, 0.7f, 0.7f));
+       m_pSceneMgr = 
OgreFramework::getSingletonPtr()->m_pRoot->createSceneManager(ST_EXTERIOR_CLOSE);
 
-    m_pRSQ = m_pSceneMgr->createRayQuery(Ray());
-    m_pRSQ->setQueryMask(OGRE_HEAD_MASK);
+       //CREATE CAMERA
+       LogManager::getSingleton().logMessage("Creating camera");
+       // Create the camera
+       m_pCamera = m_pSceneMgr->createCamera("PlayerCam");
+       // Position it at 500 in Z direction
+       m_pCamera->setPosition(Vector3(128,25,128));
+       // Look back along -Z
+       m_pCamera->lookAt(Vector3(0,0,-300));
+       m_pCamera->setNearClipDistance( 0.5 );
+       m_pCamera->setFarClipDistance( 1000.0*1.733 );
+       m_pCamera->setFOVy(Degree(60));
+       m_pCamera->setAutoAspectRatio(true);
+       OgreFramework::getSingletonPtr()->m_pViewport->setCamera(m_pCamera);
 
-    m_pCamera = m_pSceneMgr->createCamera("GameCamera");
-    m_pCamera->setPosition(Vector3(5, 60, 60));
-    m_pCamera->lookAt(Vector3(5, 20, 0));
-    m_pCamera->setNearClipDistance(5);
 
-    
m_pCamera->setAspectRatio(Real(OgreFramework::getSingletonPtr()->m_pViewport->getActualWidth())
 /
-        
Real(OgreFramework::getSingletonPtr()->m_pViewport->getActualHeight()));
+       LogManager::getSingleton().logMessage("Adding Frame Listener");
+       bool isEmbedded = OgreFramework::getSingleton().isEmbedded();
+       
+       RoRFrameListener *mFrameListener = new RoRFrameListener(
+               OgreFramework::getSingleton().m_pRenderWnd,
+               m_pCamera,
+               m_pSceneMgr,
+               OgreFramework::getSingletonPtr()->m_pRoot,
+               OgreFramework::getSingleton().isEmbedded(),
+               OgreFramework::getSingleton().getMainHWND()
+               );
+       
+       OgreFramework::getSingleton().m_pRoot->addFrameListener(mFrameListener);
 
-    OgreFramework::getSingletonPtr()->m_pViewport->setCamera(m_pCamera);
-    m_pCurrentObject = 0;
-
-    createScene();
 }
 
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
 bool GameState::pause()
 {
-    OgreFramework::getSingletonPtr()->m_pLog->logMessage("Pausing 
GameState...");
+    LogManager::getSingleton().logMessage("Pausing GameState...");
 
     return true;
 }
 
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
 void GameState::resume()
 {
-    OgreFramework::getSingletonPtr()->m_pLog->logMessage("Resuming 
GameState...");
+    LogManager::getSingleton().logMessage("Resuming GameState...");
 
     OgreFramework::getSingletonPtr()->m_pViewport->setCamera(m_pCamera);
     m_bQuit = false;
 }
 
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
 void GameState::exit()
 {
-    OgreFramework::getSingletonPtr()->m_pLog->logMessage("Leaving 
GameState...");
+    LogManager::getSingleton().logMessage("Leaving GameState...");
 
     m_pSceneMgr->destroyCamera(m_pCamera);
-    m_pSceneMgr->destroyQuery(m_pRSQ);
     if(m_pSceneMgr)
         
OgreFramework::getSingletonPtr()->m_pRoot->destroySceneManager(m_pSceneMgr);
 }
 
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
 void GameState::createScene()
 {
-    m_pSceneMgr->createLight("Light")->setPosition(75,75,75);
-
-       /*
-    DotSceneLoader* pDotSceneLoader = new DotSceneLoader();
-    pDotSceneLoader->parseDotScene("CubeScene.xml", "General", m_pSceneMgr, 
m_pSceneMgr->getRootSceneNode());
-    delete pDotSceneLoader;
-       */
-
-    m_pSceneMgr->getEntity("Cube01")->setQueryFlags(CUBE_MASK);
-    m_pSceneMgr->getEntity("Cube02")->setQueryFlags(CUBE_MASK);
-    m_pSceneMgr->getEntity("Cube03")->setQueryFlags(CUBE_MASK);
-
-    m_pOgreHeadEntity = m_pSceneMgr->createEntity("Cube", "ogrehead.mesh");
-    m_pOgreHeadEntity->setQueryFlags(OGRE_HEAD_MASK);
-    m_pOgreHeadNode = 
m_pSceneMgr->getRootSceneNode()->createChildSceneNode("CubeNode");
-    m_pOgreHeadNode->attachObject(m_pOgreHeadEntity);
-    m_pOgreHeadNode->setPosition(Vector3(0, 0, -25));
-
-    m_pOgreHeadMat = m_pOgreHeadEntity->getSubEntity(1)->getMaterial();
-    m_pOgreHeadMatHigh = m_pOgreHeadMat->clone("OgreHeadMatHigh");
-    m_pOgreHeadMatHigh->getTechnique(0)->getPass(0)->setAmbient(1, 0, 0);
-    m_pOgreHeadMatHigh->getTechnique(0)->getPass(0)->setDiffuse(1, 0, 0, 0);
 }
 
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-void GameState::moveCamera()
-{
-}
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
 void GameState::update(double timeSinceLastFrame)
 {
-
 }
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
\ No newline at end of file

Copied: trunk/source/main/framework/GameState.h (from rev 1688, 
trunk/source/main/framework/GameState.hpp)
===================================================================
--- trunk/source/main/framework/GameState.h                             (rev 0)
+++ trunk/source/main/framework/GameState.h     2011-02-20 11:33:19 UTC (rev 
1689)
@@ -0,0 +1,58 @@
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#ifndef GAME_STATE_HPP
+#define GAME_STATE_HPP
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#include "AppState.h"
+
+#include <OgreSubEntity.h>
+#include <OgreMaterialManager.h>
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+class GameState : public AppState
+{
+public:
+       GameState();
+
+       DECLARE_APPSTATE_CLASS(GameState)
+
+       void enter();
+       void createScene();
+       void exit();
+       bool pause();
+       void resume();
+
+       void getInput();
+    void buildGUI();
+
+       void update(double timeSinceLastFrame);
+
+private:
+       Ogre::SceneNode*                        m_pOgreHeadNode;
+       Ogre::Entity*                           m_pOgreHeadEntity;
+       Ogre::MaterialPtr                       m_pOgreHeadMat;
+       Ogre::MaterialPtr                       m_pOgreHeadMatHigh;
+
+       bool                                            m_bQuit;
+
+       Ogre::Vector3                           m_TranslateVector;
+       Ogre::Real                                      m_MoveSpeed;
+       Ogre::Degree                            m_RotateSpeed;
+       float                                           m_MoveScale;
+       Ogre::Degree                            m_RotScale;
+
+       Ogre::RaySceneQuery*            m_pRSQ;
+       Ogre::SceneNode*                        m_pCurrentObject;
+       Ogre::Entity*                           m_pCurrentEntity;
+       bool                                            m_bLMouseDown, 
m_bRMouseDown;
+       bool                                            m_bSettingsMode;
+};
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
+
+#endif
+
+//|||||||||||||||||||||||||||||||||||||||||||||||
\ No newline at end of file

Deleted: trunk/source/main/framework/GameState.hpp
===================================================================
--- trunk/source/main/framework/GameState.hpp   2011-02-19 23:09:27 UTC (rev 
1688)
+++ trunk/source/main/framework/GameState.hpp   2011-02-20 11:33:19 UTC (rev 
1689)
@@ -1,67 +0,0 @@
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#ifndef GAME_STATE_HPP
-#define GAME_STATE_HPP
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#include "AppState.hpp"
-
-#include <OgreSubEntity.h>
-#include <OgreMaterialManager.h>
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-enum QueryFlags
-{
-       OGRE_HEAD_MASK  = 1<<0,
-    CUBE_MASK          = 1<<1
-};
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-class GameState : public AppState
-{
-public:
-       GameState();
-
-       DECLARE_APPSTATE_CLASS(GameState)
-
-       void enter();
-       void createScene();
-       void exit();
-       bool pause();
-       void resume();
-
-       void moveCamera();
-       void getInput();
-    void buildGUI();
-
-       void update(double timeSinceLastFrame);
-
-private:
-       Ogre::SceneNode*                        m_pOgreHeadNode;
-       Ogre::Entity*                           m_pOgreHeadEntity;
-       Ogre::MaterialPtr                       m_pOgreHeadMat;
-       Ogre::MaterialPtr                       m_pOgreHeadMatHigh;
-
-       bool                                            m_bQuit;
-
-       Ogre::Vector3                           m_TranslateVector;
-       Ogre::Real                                      m_MoveSpeed;
-       Ogre::Degree                            m_RotateSpeed;
-       float                                           m_MoveScale;
-       Ogre::Degree                            m_RotScale;
-
-       Ogre::RaySceneQuery*            m_pRSQ;
-       Ogre::SceneNode*                        m_pCurrentObject;
-       Ogre::Entity*                           m_pCurrentEntity;
-       bool                                            m_bLMouseDown, 
m_bRMouseDown;
-       bool                                            m_bSettingsMode;
-};
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
-
-#endif
-
-//|||||||||||||||||||||||||||||||||||||||||||||||
\ No newline at end of file

Modified: trunk/source/main/gameplay/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.cpp     2011-02-19 23:09:27 UTC 
(rev 1688)
+++ trunk/source/main/gameplay/RoRFrameListener.cpp     2011-02-20 11:33:19 UTC 
(rev 1689)
@@ -937,7 +937,7 @@
        // setup particle manager
        new DustManager(mSceneMgr);
 
-       new CacheSystem(scm);
+       CACHE.startup(mSceneMgr);
 
        screenWidth=win->getWidth();
        screenHeight=win->getHeight();
@@ -1239,7 +1239,6 @@
        // now continue to load everything...
        if(preselected_map != "")
        {
-               /*
                if(!CACHE.checkResourceLoaded(preselected_map))
                {
                        preselected_map  = preselected_map + ".terrn";
@@ -1253,10 +1252,8 @@
                }
 
                // set the terrain cache entry
-               loaded_terrain = CACHE.getResourceInfo(preselected_map);
+               //loaded_terrain = CACHE.getResourceInfo(preselected_map);
 
-               */
-
                loadTerrain(preselected_map);
                //miniature map stuff
                //char ppname[1024];
@@ -1586,7 +1583,6 @@
        String odefgroup = "";
        String odefname = "";
        bool odefFound = true;
-       /*
        if(terrainUID != "" && !CACHE.stringHasUID(name))
        {
                sprintf(fname,"%s-%s.odef", terrainUID.c_str(), name);
@@ -1610,9 +1606,8 @@
                        odefFound = true;
                }
        }
-       */
 
-       //if(!CACHE.checkResourceLoaded(odefname, odefgroup))
+       if(!CACHE.checkResourceLoaded(odefname, odefgroup))
        if(!odefFound)
        {
                LogManager::getSingleton().logMessage("Error while loading 
Terrain: could not find required .odef file: " + odefname + ". Ignoring 
entry.");
@@ -4526,7 +4521,6 @@
 {
        ScopeLog log("terrain_"+terrainfile);
 
-       /*
        // check if the resource is loaded
        if(!CACHE.checkResourceLoaded(terrainfile))
        {
@@ -4540,7 +4534,6 @@
                }
 
        }
-       */
 
        if(terrainfile == "simple.terrn")
        {
@@ -4595,7 +4588,6 @@
        }
 
        // set the terrain hash
-       /*
        {
                Cache_Entry ce = CACHE.getResourceInfo(terrainfile);
                char hash_result[250];
@@ -4611,7 +4603,6 @@
                sha1.ReportHash(hash_result, RoR::CSHA1::REPORT_HEX_SHORT);
                SETTINGS.setSetting("TerrainHash", String(hash_result));
        }
-       */
 
        loadedTerrain = terrainfile;
 
@@ -5845,13 +5836,11 @@
                                continue;
                        String group="";
                        String truckname=String(type);
-                       /*
                        if(!CACHE.checkResourceLoaded(truckname, group))
                        {
                                LogManager::getSingleton().logMessage("error 
while loading terrain: truck " + String(type) + " not found. ignoring.");
                                continue;
                        }
-                       */
                        //this is a truck or load declaration
                        truck_preload[truck_preload_num].px=ox;
                        truck_preload[truck_preload_num].py=oy;

Modified: trunk/source/main/gfx/ColoredTextAreaOverlayElementFactory.h
===================================================================
--- trunk/source/main/gfx/ColoredTextAreaOverlayElementFactory.h        
2011-02-19 23:09:27 UTC (rev 1688)
+++ trunk/source/main/gfx/ColoredTextAreaOverlayElementFactory.h        
2011-02-20 11:33:19 UTC (rev 1689)
@@ -22,22 +22,24 @@
 
 #include "RoRPrerequisites.h"
 
+#include <OgreString.h>
+#include <OgreOverlayElement.h>
 #include <OgreOverlayElementFactory.h>
 #include "ColoredTextAreaOverlayElement.h"
 
 /** Factory for creating TextAreaOverlayElement instances. */
-class ColoredTextAreaOverlayElementFactory : public OverlayElementFactory
+class ColoredTextAreaOverlayElementFactory : public Ogre::OverlayElementFactory
 {
 public:
        /** See OverlayElementFactory */
-       OverlayElement* createOverlayElement(const String& instanceName)
+       Ogre::OverlayElement* createOverlayElement(const Ogre::String& 
instanceName)
        {
                return new ColoredTextAreaOverlayElement(instanceName);
        }
        /** See OverlayElementFactory */
-       const String& getTypeName() const
+       const Ogre::String& getTypeName() const
        {
-               static String name = "ColoredTextArea";
+               static Ogre::String name = "ColoredTextArea";
                return name;
        }
 };

Modified: trunk/source/main/gui/OverlayWrapper.cpp
===================================================================
--- trunk/source/main/gui/OverlayWrapper.cpp    2011-02-19 23:09:27 UTC (rev 
1688)
+++ trunk/source/main/gui/OverlayWrapper.cpp    2011-02-20 11:33:19 UTC (rev 
1689)
@@ -65,6 +65,7 @@
 Ogre::Overlay *OverlayWrapper::loadOverlay(Ogre::String name, bool 
autoResizeRation)
 {
        Overlay *o = OverlayManager::getSingleton().getByName(name);
+       if(!o) return NULL;
 
        if(autoResizeRation)
        {

Modified: trunk/source/main/gui/SelectorWindow.cpp
===================================================================
--- trunk/source/main/gui/SelectorWindow.cpp    2011-02-19 23:09:27 UTC (rev 
1688)
+++ trunk/source/main/gui/SelectorWindow.cpp    2011-02-20 11:33:19 UTC (rev 
1689)
@@ -26,6 +26,7 @@
 #include "language.h"
 #include "CacheSystem.h"
 #include "skin.h"
+#include "utils.h"
 #include "skinmanager.h"
 #include "BeamData.h"
 
@@ -213,7 +214,6 @@
 
 void SelectorWindow::getData()
 {
-       /*
        mTypeComboBox->removeAllItems();
        if(mModelList->getItemCount() != 0) mModelList->setIndexSelected(0);
        mModelList->removeAllItems();
@@ -334,14 +334,12 @@
                }
                onCategorySelected(*mTypeComboBox->getItemDataAt<int>(0));
        }
-       */
 }
 
 void SelectorWindow::onCategorySelected(int categoryID)
 {
-       /*
        if(mLoaderType == LT_SKIN) return;
-       int ts = CACHE.getTimeStamp();
+       int ts = getTimeStamp();
        mModelList->removeAllItems();
        std::vector<Cache_Entry>::iterator it;
        int counter=0, counter2=0;
@@ -414,12 +412,10 @@
                }
                onEntrySelected(*mModelList->getItemDataAt<int>(0));
        }
-       */
 }
 
 void SelectorWindow::onEntrySelected(int entryID)
 {
-       /*
        if(mLoaderType == LT_SKIN)
        {
                // special skin handling
@@ -457,12 +453,10 @@
        if(!entry) return;
        mSelectedTruck = entry;
        updateControls(mSelectedTruck);
-       */
 }
 
 void SelectorWindow::selectionDone()
 {
-       /*
        if(!mSelectedTruck || mSelectionDone)
                return;
 
@@ -493,12 +487,10 @@
                mSelectionDone = true;
                hide();
        }
-       */
 }
 
 void SelectorWindow::updateControls(Cache_Entry *entry)
 {
-       /*
        int modnumber = entry->number;
        String minitype = entry->minitype;
 
@@ -588,12 +580,10 @@
        {
                mEntryDescriptionStaticText->setCaption("ENCODING ERROR");
        }
-       */
 }
 
 void SelectorWindow::setPreviewImage(Ogre::String texture)
 {
-       /*
        if(texture == "" || texture == "none")
                texture = _L("unknown.dds");
 
@@ -608,7 +598,6 @@
                texture = ("unknown.dds"); // without _L() !
 
        mPreviewStaticImage->setImageTexture(texture);
-       */
 }
 
 bool SelectorWindow::isFinishedSelecting()

Modified: trunk/source/main/gui/SelectorWindow.h
===================================================================
--- trunk/source/main/gui/SelectorWindow.h      2011-02-19 23:09:27 UTC (rev 
1688)
+++ trunk/source/main/gui/SelectorWindow.h      2011-02-20 11:33:19 UTC (rev 
1689)
@@ -72,7 +72,7 @@
        void updateControls(Cache_Entry *entry);
        void setPreviewImage(Ogre::String texture);
 
-       //std::vector<Cache_Entry> mEntries;
+       std::vector<Cache_Entry> mEntries;
        std::map<int, int> mCategoryUsage;
        std::vector<Skin *> mCurrentSkins;
        LoaderType mLoaderType;

Modified: trunk/source/main/main_sim/RigsOfRods.cpp
===================================================================
--- trunk/source/main/main_sim/RigsOfRods.cpp   2011-02-19 23:09:27 UTC (rev 
1688)
+++ trunk/source/main/main_sim/RigsOfRods.cpp   2011-02-20 11:33:19 UTC (rev 
1689)
@@ -21,7 +21,9 @@
 
 #include <Ogre.h>
 
-#include "GameState.hpp"
+#include "GameState.h"
+#include "Settings.h"
+#include "ContentManager.h"
 
 using namespace Ogre;
 
@@ -42,15 +44,22 @@
 
 void RigsOfRods::go(void)
 {
+       // init ogre
        new OgreFramework();
        if(!OgreFramework::getSingletonPtr()->initOgre(name, hwnd, mainhwnd))
                return;
 
+       // then the base content setup
+       new ContentManager();
+       ContentManager::getSingleton().init();
+
+       // now add the game states
        stateManager = new AppStateManager();
 
        GameState::create(stateManager,  "GameState");
 
+       // select the first one
        stateManager->start(stateManager->findByName("GameState"));
 
-       OgreFramework::getSingletonPtr()->m_pLog->logMessage("Rigs of Rods 
initialized!");
+       LogManager::getSingleton().logMessage("Rigs of Rods initialized!");
 }

Modified: trunk/source/main/main_sim/RigsOfRods.h
===================================================================
--- trunk/source/main/main_sim/RigsOfRods.h     2011-02-19 23:09:27 UTC (rev 
1688)
+++ trunk/source/main/main_sim/RigsOfRods.h     2011-02-20 11:33:19 UTC (rev 
1689)
@@ -28,8 +28,8 @@
 
 #include "RoRPrerequisites.h"
 
-#include "AdvancedOgreFramework.hpp"
-#include "AppStateManager.hpp"
+#include "AdvancedOgreFramework.h"
+#include "AppStateManager.h"
 
 class RigsOfRods
 {

Modified: trunk/source/main/physics/BeamFactory.cpp
===================================================================
--- trunk/source/main/physics/BeamFactory.cpp   2011-02-19 23:09:27 UTC (rev 
1688)
+++ trunk/source/main/physics/BeamFactory.cpp   2011-02-20 11:33:19 UTC (rev 
1689)
@@ -141,7 +141,6 @@
        // check if we got this truck installed
        String filename = String(treg->name);
        String group = "";
-       /*
        if(!CACHE.checkResourceLoaded(filename, group))
        {
                LogManager::getSingleton().logMessage("wont add remote stream 
(truck not existing): '"+filename+"'");
@@ -152,7 +151,6 @@
 
                return 0;
        }
-       */
 
        // fill truckconfig
        std::vector<Ogre::String> truckconfig;

Modified: trunk/source/main/physics/input_output/BeamLoadTruck.cpp
===================================================================
--- trunk/source/main/physics/input_output/BeamLoadTruck.cpp    2011-02-19 
23:09:27 UTC (rev 1688)
+++ trunk/source/main/physics/input_output/BeamLoadTruck.cpp    2011-02-20 
11:33:19 UTC (rev 1689)
@@ -62,7 +62,6 @@
        String group = "";
        String filename = String(fname);
 
-       /*
        try
        {
                if(!CACHE.checkResourceLoaded(filename, group))
@@ -78,7 +77,6 @@
                        return -1;
                }
        }
-       */
 
        //this->cacheEntryInfo = CACHE.getResourceInfo(filename);
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to