Revision: 2701 http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2701&view=rev Author: rorthomas Date: 2012-05-26 04:58:51 +0000 (Sat, 26 May 2012) Log Message: -----------
Modified Paths: -------------- trunk/source/main/gameplay/GEnv.h trunk/source/main/gameplay/RoRFrameListener.cpp trunk/source/main/gfx/ShadowManager.cpp trunk/source/main/gfx/ShadowManager.h trunk/source/main/gfx/vidcam.cpp trunk/source/main/terrain/TerrainManager.cpp Modified: trunk/source/main/gameplay/GEnv.h =================================================================== --- trunk/source/main/gameplay/GEnv.h 2012-05-26 04:48:03 UTC (rev 2700) +++ trunk/source/main/gameplay/GEnv.h 2012-05-26 04:58:51 UTC (rev 2701) @@ -28,6 +28,7 @@ class Network; class MapControl; class Character; +class SkyManager; class GlobalEnvironment { @@ -46,6 +47,7 @@ , network(0) , surveyMap(0) , player(0) + , sky(0) { } Ogre::Root *ogreRoot; @@ -62,6 +64,7 @@ Network *network; MapControl *surveyMap; Character *player; + SkyManager *sky; }; #endif // GEnv_H__ Modified: trunk/source/main/gameplay/RoRFrameListener.cpp =================================================================== --- trunk/source/main/gameplay/RoRFrameListener.cpp 2012-05-26 04:48:03 UTC (rev 2700) +++ trunk/source/main/gameplay/RoRFrameListener.cpp 2012-05-26 04:58:51 UTC (rev 2701) @@ -977,7 +977,7 @@ // new factory for characters, net is INVALID, will be set later new CharacterFactory(); - new ChatSystemFactory(0); + new ChatSystemFactory(); // notice: all factories must be available before starting the network! #ifdef USE_SOCKETW Modified: trunk/source/main/gfx/ShadowManager.cpp =================================================================== --- trunk/source/main/gfx/ShadowManager.cpp 2012-05-26 04:48:03 UTC (rev 2700) +++ trunk/source/main/gfx/ShadowManager.cpp 2012-05-26 04:58:51 UTC (rev 2701) @@ -28,13 +28,11 @@ #include "Settings.h" //using namespace std; -//using namespace Ogre; +using namespace Ogre; //--------------------------------------------------------------------- -ShadowManager::ShadowManager(Ogre::SceneManager *scene, Ogre::RenderWindow *window, Ogre::Camera *camera) : - mSceneMgr(scene), mWindow(window), mCamera(camera), mPSSMSetup() +ShadowManager::ShadowManager() : mPSSMSetup() { - setSingleton(this); mDepthShadows = true; } @@ -52,6 +50,8 @@ int ShadowManager::changeShadowTechnique(Ogre::ShadowTechnique tech) { + SceneManager *mSceneMgr = gEnv->ogreSceneManager; + float shadowFarDistance = std::min(200.0f, (FSETTING("SightRange", 2000)* 0.8f)); float scoef=0.2; mSceneMgr->setShadowColour(Ogre::ColourValue(0.563+scoef, 0.578+scoef, 0.625+scoef)); @@ -91,8 +91,8 @@ { // shadow camera setup Ogre::PSSMShadowCameraSetup* pssmSetup = new Ogre::PSSMShadowCameraSetup(); - pssmSetup->setSplitPadding(mCamera->getNearClipDistance()); - pssmSetup->calculateSplitPoints(3, mCamera->getNearClipDistance(), mSceneMgr->getShadowFarDistance()); + pssmSetup->setSplitPadding(gEnv->ogreCamera->getNearClipDistance()); + pssmSetup->calculateSplitPoints(3, gEnv->ogreCamera->getNearClipDistance(), mSceneMgr->getShadowFarDistance()); for (int i=0; i < num; ++i) { int size = i==0 ? 2048 : 1024; const Ogre::Real cAdjfA[5] = {2, 1, 0.5, 0.25, 0.125}; Modified: trunk/source/main/gfx/ShadowManager.h =================================================================== --- trunk/source/main/gfx/ShadowManager.h 2012-05-26 04:48:03 UTC (rev 2700) +++ trunk/source/main/gfx/ShadowManager.h 2012-05-26 04:58:51 UTC (rev 2701) @@ -43,9 +43,6 @@ void updatePSSM(Ogre::Terrain* terrain=0); protected: - Ogre::SceneManager *mSceneMgr; - Ogre::RenderWindow *mWindow; - Ogre::Camera *mCamera; Ogre::ShadowCameraSetupPtr mPSSMSetup; bool mDepthShadows; Modified: trunk/source/main/gfx/vidcam.cpp =================================================================== --- trunk/source/main/gfx/vidcam.cpp 2012-05-26 04:48:03 UTC (rev 2700) +++ trunk/source/main/gfx/vidcam.cpp 2012-05-26 04:58:51 UTC (rev 2701) @@ -176,8 +176,8 @@ { #ifdef USE_CAELUM // caelum needs to know that we changed the cameras - if(SkyManager::getSingletonPtr()) - SkyManager::getSingleton().notifyCameraChanged(mVidCam); + if(gEnv->sky) + gEnv->sky->notifyCameraChanged(mVidCam); #endif // USE_CAELUM // update the texture now, otherwise shuttering Modified: trunk/source/main/terrain/TerrainManager.cpp =================================================================== --- trunk/source/main/terrain/TerrainManager.cpp 2012-05-26 04:48:03 UTC (rev 2700) +++ trunk/source/main/terrain/TerrainManager.cpp 2012-05-26 04:58:51 UTC (rev 2701) @@ -184,6 +184,7 @@ if (useCaelum) { sky_manager = new SkyManager(mSceneMgr, mWindow, mCamera); + gEnv->sky = sky_manager; // try to load caelum config String caelumConfig = mTerrainConfig.getSetting("CaelumConfigFile"); @@ -197,6 +198,7 @@ // no config provided, fall back to the default one sky_manager->loadScript("ror_default_sky"); } + } else #endif //USE_CAELUM { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Rigsofrods-devel mailing list Rigsofrods-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel