Revision: 2751 http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2751&view=rev Author: rorthomas Date: 2012-05-29 02:47:32 +0000 (Tue, 29 May 2012) Log Message: ----------- fixed new terrain up
Modified Paths: -------------- trunk/source/main/gameplay/RoRFrameListener.cpp trunk/source/main/gfx/camera/CameraBehaviorCharacter.cpp trunk/source/main/gui/Dashboard.cpp trunk/source/main/gui/Dashboard.h trunk/source/main/physics/Beam.cpp trunk/source/main/terrain/TerrainManager.cpp trunk/source/main/utils/MeshObject.cpp trunk/source/main/utils/MeshObject.h Modified: trunk/source/main/gameplay/RoRFrameListener.cpp =================================================================== --- trunk/source/main/gameplay/RoRFrameListener.cpp 2012-05-29 02:13:31 UTC (rev 2750) +++ trunk/source/main/gameplay/RoRFrameListener.cpp 2012-05-29 02:47:32 UTC (rev 2751) @@ -2821,10 +2821,19 @@ gEnv->terrainManager = new TerrainManager(); gEnv->terrainManager->loadTerrain(terrainfile); + loading_state=TERRAIN_LOADED; + if (gEnv->player) gEnv->player->setVisible(true); #ifdef USE_MYGUI - LoadingWindow::getSingleton().hide(); + if (!BSETTING("REPO_MODE", false)) + { + // hide loading window + LoadingWindow::getSingleton().hide(); + // hide wallpaper + MyGUI::Window *w = MyGUI::Gui::getInstance().findWidget<MyGUI::Window>("wallpaper"); + if (w) w->setVisibleSmooth(false); + } #endif //USE_MYGUI } Modified: trunk/source/main/gfx/camera/CameraBehaviorCharacter.cpp =================================================================== --- trunk/source/main/gfx/camera/CameraBehaviorCharacter.cpp 2012-05-29 02:13:31 UTC (rev 2750) +++ trunk/source/main/gfx/camera/CameraBehaviorCharacter.cpp 2012-05-29 02:47:32 UTC (rev 2751) @@ -33,6 +33,7 @@ void CameraBehaviorCharacter::update(const CameraManager::cameraContext_t &ctx) { + if(!gEnv->player) return; targetDirection = -gEnv->player->getRotation() - Radian(Math::HALF_PI); camLookAt = gEnv->player->getPosition() + camPositionOffset; @@ -41,6 +42,7 @@ bool CameraBehaviorCharacter::mouseMoved(const CameraManager::cameraContext_t &ctx, const OIS::MouseEvent& _arg) { + if(!gEnv->player) return false; if ( camMode == CHARACTER_FIRST_PERSON ) { const OIS::MouseState ms = _arg.state; Modified: trunk/source/main/gui/Dashboard.cpp =================================================================== --- trunk/source/main/gui/Dashboard.cpp 2012-05-29 02:13:31 UTC (rev 2750) +++ trunk/source/main/gui/Dashboard.cpp 2012-05-29 02:47:32 UTC (rev 2751) @@ -87,7 +87,7 @@ void DashboardListener::preRenderTargetUpdate(const RenderTargetEvent& evt) { // hide everything - mScene->setFindVisibleObjects(false); + gEnv->sceneManager->setFindVisibleObjects(false); // hide fps stats if (fpsOverlay) @@ -119,7 +119,7 @@ void DashboardListener::postRenderTargetUpdate(const RenderTargetEvent& evt) { // show everything - mScene->setFindVisibleObjects(true); + gEnv->sceneManager->setFindVisibleObjects(true); // show everything again, if it was displayed before hiding it... if (fpsOverlay && fpsDisplayed) Modified: trunk/source/main/gui/Dashboard.h =================================================================== --- trunk/source/main/gui/Dashboard.h 2012-05-29 02:13:31 UTC (rev 2750) +++ trunk/source/main/gui/Dashboard.h 2012-05-29 02:47:32 UTC (rev 2751) @@ -62,7 +62,6 @@ Ogre::Overlay *fpsOverlay; Ogre::Overlay *needlesOverlay; Ogre::Overlay *truckHUDOverlay; - Ogre::SceneManager *mScene; bool consolevisible; bool fpsDisplayed; bool truckHUD; Modified: trunk/source/main/physics/Beam.cpp =================================================================== --- trunk/source/main/physics/Beam.cpp 2012-05-29 02:13:31 UTC (rev 2750) +++ trunk/source/main/physics/Beam.cpp 2012-05-29 02:47:32 UTC (rev 2751) @@ -182,7 +182,7 @@ , pointCD(0) , GUIFeaturesChanged(false) { - + mCamera = gEnv->mainCamera; airbrakeval = 0; alb_minspeed = 0.0f; alb_mode = 0; Modified: trunk/source/main/terrain/TerrainManager.cpp =================================================================== --- trunk/source/main/terrain/TerrainManager.cpp 2012-05-29 02:13:31 UTC (rev 2750) +++ trunk/source/main/terrain/TerrainManager.cpp 2012-05-29 02:47:32 UTC (rev 2751) @@ -116,6 +116,7 @@ collisions->printStats(); + // rorframelistener still has its own var, need to fix this loading_state = TERRAIN_LOADED; Modified: trunk/source/main/utils/MeshObject.cpp =================================================================== --- trunk/source/main/utils/MeshObject.cpp 2012-05-29 02:13:31 UTC (rev 2750) +++ trunk/source/main/utils/MeshObject.cpp 2012-05-29 02:47:32 UTC (rev 2751) @@ -47,7 +47,7 @@ { // create a new sceneNode if not existing if (!sceneNode) - sceneNode = smgr->getRootSceneNode()->createChildSceneNode(); + sceneNode = gEnv->sceneManager->getRootSceneNode()->createChildSceneNode(); loadMesh(); } @@ -183,9 +183,9 @@ try { if (entityName.empty()) - ent = smgr->createEntity(meshName); + ent = gEnv->sceneManager->createEntity(meshName); else - ent = smgr->createEntity(entityName, meshName); + ent = gEnv->sceneManager->createEntity(entityName, meshName); if (ent) sceneNode->attachObject(ent); } catch(Ogre::Exception& e) Modified: trunk/source/main/utils/MeshObject.h =================================================================== --- trunk/source/main/utils/MeshObject.h 2012-05-29 02:13:31 UTC (rev 2750) +++ trunk/source/main/utils/MeshObject.h 2012-05-29 02:47:32 UTC (rev 2751) @@ -43,7 +43,6 @@ protected: MaterialReplacer *mr; - Ogre::SceneManager *smgr; Ogre::String meshName; Ogre::String entityName; Ogre::SceneNode *sceneNode; 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