From 49c2da27b386a9f4cecfe36cff5039f3be17a227 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 19 Mar 2015 17:21:15 +0100 Subject: [PATCH] OpenCS compiles and runs again (no rendering) --- apps/opencs/CMakeLists.txt | 2 +- apps/opencs/editor.cpp | 122 +----------------- apps/opencs/editor.hpp | 17 +-- apps/opencs/main.cpp | 12 +- apps/opencs/model/settings/usersettings.cpp | 4 +- apps/opencs/model/world/resources.cpp | 4 +- apps/opencs/view/render/object.cpp | 4 +- apps/opencs/view/render/overlaymask.cpp | 52 -------- apps/opencs/view/render/overlaymask.hpp | 42 ------ apps/opencs/view/render/overlaysystem.cpp | 34 ----- apps/opencs/view/render/overlaysystem.hpp | 26 ---- .../view/render/pagedworldspacewidget.cpp | 7 +- .../view/render/pagedworldspacewidget.hpp | 1 - apps/opencs/view/render/scenewidget.cpp | 8 -- apps/opencs/view/render/scenewidget.hpp | 2 - apps/opencs/view/world/physicssystem.cpp | 5 +- apps/opencs/view/world/subviews.cpp | 2 +- components/CMakeLists.txt | 3 +- libs/openengine/bullet/physic.cpp | 2 + 19 files changed, 30 insertions(+), 319 deletions(-) delete mode 100644 apps/opencs/view/render/overlaymask.cpp delete mode 100644 apps/opencs/view/render/overlaymask.hpp delete mode 100644 apps/opencs/view/render/overlaysystem.cpp delete mode 100644 apps/opencs/view/render/overlaysystem.hpp diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index 1d6b40d5ff..3548c175a4 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -81,7 +81,7 @@ opencs_units (view/render opencs_units_noqt (view/render navigation navigation1st navigationfree navigationorbit lighting lightingday lightingnight - lightingbright object cell terrainstorage textoverlay overlaymask overlaysystem mousestate + lightingbright object cell terrainstorage textoverlay mousestate ) opencs_hdrs_noqt (view/render diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index 1d31c83969..92fd40492c 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -16,13 +16,12 @@ #include #include -#include #include "model/doc/document.hpp" #include "model/world/data.hpp" -CS::Editor::Editor (OgreInit::OgreInit& ogreInit) -: mUserSettings (mCfgMgr), mOverlaySystem (0), mDocumentManager (mCfgMgr), +CS::Editor::Editor () +: mUserSettings (mCfgMgr), mDocumentManager (mCfgMgr), mViewManager (mDocumentManager), mIpcServerName ("org.openmw.OpenCS"), mServer(NULL), mClientSocket(NULL), mPid(""), mLock() { @@ -33,14 +32,10 @@ CS::Editor::Editor (OgreInit::OgreInit& ogreInit) CSMSettings::UserSettings::instance().loadSettings ("opencs.ini"); mSettings.setModel (CSMSettings::UserSettings::instance()); - ogreInit.init ((mCfgMgr.getUserConfigPath() / "opencsOgre.log").string()); + //NifOgre::Loader::setShowMarkers(true); - NifOgre::Loader::setShowMarkers(true); - - mOverlaySystem.reset (new CSVRender::OverlaySystem); - - Bsa::registerResources (Files::Collections (config.first, !mFsStrict), config.second, true, - mFsStrict); + //Bsa::registerResources (Files::Collections (config.first, !mFsStrict), config.second, true, + // mFsStrict); mDocumentManager.listResources(); @@ -324,113 +319,10 @@ int CS::Editor::run() return QApplication::exec(); } -std::auto_ptr CS::Editor::setupGraphics() -{ - std::string renderer = -#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 - "Direct3D9 Rendering Subsystem"; -#else - "OpenGL Rendering Subsystem"; -#endif - std::string renderSystem = mUserSettings.setting("Video/render system", renderer.c_str()).toStdString(); - - Ogre::Root::getSingleton().setRenderSystem(Ogre::Root::getSingleton().getRenderSystemByName(renderSystem)); - - // Initialise Ogre::OverlaySystem after Ogre::Root but before initialisation - mOverlaySystem.get(); - - Ogre::Root::getSingleton().initialise(false); - - // Create a hidden background window to keep resources - Ogre::NameValuePairList params; - params.insert(std::make_pair("title", "")); - - std::string antialiasing = mUserSettings.settingValue("Video/antialiasing").toStdString(); - if(antialiasing == "MSAA 16") antialiasing = "16"; - else if(antialiasing == "MSAA 8") antialiasing = "8"; - else if(antialiasing == "MSAA 4") antialiasing = "4"; - else if(antialiasing == "MSAA 2") antialiasing = "2"; - else antialiasing = "0"; - params.insert(std::make_pair("FSAA", antialiasing)); - - params.insert(std::make_pair("vsync", "false")); - params.insert(std::make_pair("hidden", "true")); -#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE - params.insert(std::make_pair("macAPI", "cocoa")); -#endif - // NOTE: fullscreen mode not supported (doesn't really make sense for opencs) - Ogre::RenderWindow* hiddenWindow = Ogre::Root::getSingleton().createRenderWindow("InactiveHidden", 1, 1, false, ¶ms); - hiddenWindow->setActive(false); - - sh::OgrePlatform* platform = - new sh::OgrePlatform ("General", (mResources / "materials").string()); - // for font used in overlays - Ogre::Root::getSingleton().addResourceLocation ((mResources / "mygui").string(), - "FileSystem", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true); - - if (!boost::filesystem::exists (mCfgMgr.getCachePath())) - boost::filesystem::create_directories (mCfgMgr.getCachePath()); - - platform->setCacheFolder (mCfgMgr.getCachePath().string()); - - std::auto_ptr factory (new sh::Factory (platform)); + //Ogre::Root::getSingleton().addResourceLocation ((mResources / "mygui").string(), + // "FileSystem", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true); - QString shLang = mUserSettings.settingValue("General/shader mode"); - QString rend = renderSystem.c_str(); - bool openGL = rend.contains(QRegExp("^OpenGL", Qt::CaseInsensitive)); - bool glES = rend.contains(QRegExp("^OpenGL ES", Qt::CaseInsensitive)); - - // force shader language based on render system - if(shLang == "" - || (openGL && shLang == "hlsl") - || (!openGL && shLang == "glsl") - || (glES && shLang != "glsles")) - { - shLang = openGL ? (glES ? "glsles" : "glsl") : "hlsl"; - //no group means "General" group in the "ini" file standard - mUserSettings.setDefinitions("shader mode", (QStringList() << shLang)); - } - enum sh::Language lang; - if(shLang == "glsl") lang = sh::Language_GLSL; - else if(shLang == "glsles") lang = sh::Language_GLSLES; - else if(shLang == "hlsl") lang = sh::Language_HLSL; - else lang = sh::Language_CG; - - factory->setCurrentLanguage (lang); - factory->setWriteSourceCache (true); - factory->setReadSourceCache (true); - factory->setReadMicrocodeCache (true); - factory->setWriteMicrocodeCache (true); - - factory->loadAllFiles(); - - bool shaders = mUserSettings.setting("3d-render/shaders", QString("true")) == "true" ? true : false; - sh::Factory::getInstance ().setShadersEnabled (shaders); - - std::string fog = mUserSettings.setting("Shader/fog", QString("true")).toStdString(); - sh::Factory::getInstance().setGlobalSetting ("fog", fog); - - - std::string shadows = mUserSettings.setting("Shader/shadows", QString("false")).toStdString(); - sh::Factory::getInstance().setGlobalSetting ("shadows", shadows); - - std::string shadows_pssm = mUserSettings.setting("Shader/shadows_pssm", QString("false")).toStdString(); - sh::Factory::getInstance().setGlobalSetting ("shadows_pssm", shadows_pssm); - - std::string render_refraction = mUserSettings.setting("Shader/render_refraction", QString("false")).toStdString(); - sh::Factory::getInstance ().setGlobalSetting ("render_refraction", render_refraction); - - // internal setting - may be switched on or off by the use of shader configurations - sh::Factory::getInstance ().setGlobalSetting ("viewproj_fix", "false"); - - std::string num_lights = mUserSettings.setting("3d-render-adv/num_lights", QString("8")).toStdString(); - sh::Factory::getInstance ().setGlobalSetting ("num_lights", num_lights); - - /// \todo add more configurable shiny settings - - return factory; -} void CS::Editor::documentAdded (CSMDoc::Document *document) { diff --git a/apps/opencs/editor.hpp b/apps/opencs/editor.hpp index 273f0825b8..da4d639858 100644 --- a/apps/opencs/editor.hpp +++ b/apps/opencs/editor.hpp @@ -11,16 +11,12 @@ #include #include -#include - #ifndef Q_MOC_RUN #include #endif #include -#include - #include "model/settings/usersettings.hpp" #include "model/doc/documentmanager.hpp" @@ -30,12 +26,6 @@ #include "view/doc/newgame.hpp" #include "view/settings/dialog.hpp" -#include "view/render/overlaysystem.hpp" - -namespace OgreInit -{ - class OgreInit; -} namespace CS { @@ -43,10 +33,8 @@ namespace CS { Q_OBJECT - Nif::Cache mNifCache; Files::ConfigurationManager mCfgMgr; CSMSettings::UserSettings mUserSettings; - std::auto_ptr mOverlaySystem; CSMDoc::DocumentManager mDocumentManager; CSVDoc::ViewManager mViewManager; CSVDoc::StartupDialogue mStartup; @@ -71,7 +59,7 @@ namespace CS public: - Editor (OgreInit::OgreInit& ogreInit); + Editor (); ~Editor (); bool makeIPCServer(); @@ -80,9 +68,6 @@ namespace CS int run(); ///< \return error status - std::auto_ptr setupGraphics(); - ///< The returned factory must persist at least as long as *this. - private slots: void createGame(); diff --git a/apps/opencs/main.cpp b/apps/opencs/main.cpp index b11561c135..eb5dcc64e6 100644 --- a/apps/opencs/main.cpp +++ b/apps/opencs/main.cpp @@ -9,10 +9,6 @@ #include #include -#include - -#include - #include "model/world/universalid.hpp" #ifdef Q_OS_MAC @@ -53,10 +49,6 @@ int main(int argc, char *argv[]) qRegisterMetaType ("std::string"); qRegisterMetaType ("CSMWorld::UniversalId"); - OgreInit::OgreInit ogreInit; - - std::auto_ptr shinyFactory; - Application application (argc, argv); #ifdef Q_OS_MAC @@ -80,15 +72,13 @@ int main(int argc, char *argv[]) application.setWindowIcon (QIcon (":./openmw-cs.png")); - CS::Editor editor (ogreInit); + CS::Editor editor; if(!editor.makeIPCServer()) { editor.connectToIPCServer(); return 0; } - - shinyFactory = editor.setupGraphics(); return editor.run(); } catch (std::exception& e) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 7dac660c35..0aa1cb4ad7 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -472,11 +472,11 @@ void CSMSettings::UserSettings::updateUserSetting(const QString &settingKey, if(settingKey == "3d-render-adv/num_lights" && !list.empty()) { - sh::Factory::getInstance ().setGlobalSetting ("num_lights", list.at(0).toStdString()); + //sh::Factory::getInstance ().setGlobalSetting ("num_lights", list.at(0).toStdString()); } else if(settingKey == "3d-render/shaders" && !list.empty()) { - sh::Factory::getInstance ().setShadersEnabled (list.at(0).toStdString() == "true" ? true : false); + //sh::Factory::getInstance ().setShadersEnabled (list.at(0).toStdString() == "true" ? true : false); } emit userSettingUpdated (settingKey, list); diff --git a/apps/opencs/model/world/resources.cpp b/apps/opencs/model/world/resources.cpp index 13c8df84d1..25fada93a5 100644 --- a/apps/opencs/model/world/resources.cpp +++ b/apps/opencs/model/world/resources.cpp @@ -15,6 +15,7 @@ CSMWorld::Resources::Resources (const std::string& baseDirectory, UniversalId::T { int baseSize = mBaseDirectory.size(); + /* Ogre::StringVector resourcesGroups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups(); @@ -61,6 +62,7 @@ CSMWorld::Resources::Resources (const std::string& baseDirectory, UniversalId::T Misc::StringUtils::lowerCase (file), static_cast (mFiles.size())-1)); } } + */ } int CSMWorld::Resources::getSize() const @@ -105,4 +107,4 @@ int CSMWorld::Resources::searchId (const std::string& id) const CSMWorld::UniversalId::Type CSMWorld::Resources::getType() const { return mType; -} \ No newline at end of file +} diff --git a/apps/opencs/view/render/object.cpp b/apps/opencs/view/render/object.cpp index 3607fb415d..b54551c96d 100644 --- a/apps/opencs/view/render/object.cpp +++ b/apps/opencs/view/render/object.cpp @@ -77,8 +77,8 @@ void CSVRender::Object::update() } else { - mObject = NifOgre::Loader::createObjects (mBase, "Meshes\\" + model); - mObject->setVisibilityFlags (Element_Reference); + //mObject = NifOgre::Loader::createObjects (mBase, "Meshes\\" + model); + //mObject->setVisibilityFlags (Element_Reference); if (mPhysics && !mReferenceId.empty()) { diff --git a/apps/opencs/view/render/overlaymask.cpp b/apps/opencs/view/render/overlaymask.cpp deleted file mode 100644 index 09f020354d..0000000000 --- a/apps/opencs/view/render/overlaymask.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "overlaymask.hpp" - -#include -#include - -#include "textoverlay.hpp" -#include "../../model/world/cellcoordinates.hpp" - -namespace CSVRender -{ - -// ideas from http://www.ogre3d.org/forums/viewtopic.php?f=5&t=44828#p486334 -OverlayMask::OverlayMask(std::map &overlays, Ogre::Viewport* viewport) - : mTextOverlays(overlays), mViewport(viewport) -{ -} - -OverlayMask::~OverlayMask() -{ -} - -void OverlayMask::setViewport(Ogre::Viewport *viewport) -{ - mViewport = viewport; -} - -void OverlayMask::preViewportUpdate(const Ogre::RenderTargetViewportEvent &event) -{ - if(event.source == mViewport) - { - Ogre::OverlayManager &overlayMgr = Ogre::OverlayManager::getSingleton(); - for(Ogre::OverlayManager::OverlayMapIterator iter = overlayMgr.getOverlayIterator(); - iter.hasMoreElements();) - { - Ogre::Overlay* item = iter.getNext(); - for(Ogre::Overlay::Overlay2DElementsIterator it = item->get2DElementsIterator(); - it.hasMoreElements();) - { - Ogre::OverlayContainer* container = it.getNext(); - if(container) container->hide(); - } - } - - std::map::iterator it = mTextOverlays.begin(); - for(; it != mTextOverlays.end(); ++it) - { - it->second->show(true); - } - } -} - -} diff --git a/apps/opencs/view/render/overlaymask.hpp b/apps/opencs/view/render/overlaymask.hpp deleted file mode 100644 index ec050cac43..0000000000 --- a/apps/opencs/view/render/overlaymask.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef OPENCS_VIEW_OVERLAYMASK_H -#define OPENCS_VIEW_OVERLAYMASK_H - -#include - -namespace Ogre -{ - class Viewport; - class RendertargetViewportEvent; -} - -namespace CSMWorld -{ - class CellCoordinates; -} - -namespace CSVRender -{ - class TextOverlay; - - class OverlayMask : public Ogre::RenderTargetListener - { - - std::map &mTextOverlays; - Ogre::Viewport* mViewport; - - public: - - OverlayMask(std::map &overlays, - Ogre::Viewport* viewport); - - virtual ~OverlayMask(); - - void setViewport(Ogre::Viewport *viewport); - - protected: - - virtual void preViewportUpdate(const Ogre::RenderTargetViewportEvent &event); - }; -} - -#endif // OPENCS_VIEW_OVERLAYMASK_H diff --git a/apps/opencs/view/render/overlaysystem.cpp b/apps/opencs/view/render/overlaysystem.cpp deleted file mode 100644 index f565f5af06..0000000000 --- a/apps/opencs/view/render/overlaysystem.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "overlaysystem.hpp" - -#include - -#include - -namespace CSVRender -{ - OverlaySystem *OverlaySystem::mOverlaySystemInstance = 0; - - OverlaySystem::OverlaySystem() - { - assert(!mOverlaySystemInstance); - mOverlaySystemInstance = this; - mOverlaySystem = new Ogre::OverlaySystem(); - } - - OverlaySystem::~OverlaySystem() - { - delete mOverlaySystem; - } - - OverlaySystem &OverlaySystem::instance() - { - assert(mOverlaySystemInstance); - return *mOverlaySystemInstance; - } - - Ogre::OverlaySystem *OverlaySystem::get() - { - return mOverlaySystem; - } -} - diff --git a/apps/opencs/view/render/overlaysystem.hpp b/apps/opencs/view/render/overlaysystem.hpp deleted file mode 100644 index f8a78f3295..0000000000 --- a/apps/opencs/view/render/overlaysystem.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef OPENCS_VIEW_OVERLAYSYSTEM_H -#define OPENCS_VIEW_OVERLAYSYSTEM_H - -namespace Ogre -{ - class OverlaySystem; -} - -namespace CSVRender -{ - class OverlaySystem - { - Ogre::OverlaySystem *mOverlaySystem; - static OverlaySystem *mOverlaySystemInstance; - - public: - - OverlaySystem(); - ~OverlaySystem(); - static OverlaySystem &instance(); - - Ogre::OverlaySystem *get(); - }; -} - -#endif // OPENCS_VIEW_OVERLAYSYSTEM_H diff --git a/apps/opencs/view/render/pagedworldspacewidget.cpp b/apps/opencs/view/render/pagedworldspacewidget.cpp index cf9edb5483..90181a3679 100644 --- a/apps/opencs/view/render/pagedworldspacewidget.cpp +++ b/apps/opencs/view/render/pagedworldspacewidget.cpp @@ -15,7 +15,6 @@ #include #include "textoverlay.hpp" -#include "overlaymask.hpp" #include "../../model/world/tablemimedata.hpp" #include "../../model/world/idtable.hpp" @@ -160,11 +159,13 @@ bool CSVRender::PagedWorldspaceWidget::adjustCells() textDisp->setDesc(desc); // FIXME: config setting textDisp->update(); mTextOverlays.insert(std::make_pair(*iter, textDisp)); + /* if(!mOverlayMask) { mOverlayMask = new OverlayMask(mTextOverlays, getViewport()); addRenderTargetListener(mOverlayMask); } + */ modified = true; } @@ -342,7 +343,7 @@ std::string CSVRender::PagedWorldspaceWidget::getStartupInstruction() CSVRender::PagedWorldspaceWidget::PagedWorldspaceWidget (QWidget* parent, CSMDoc::Document& document) : WorldspaceWidget (document, parent), mDocument (document), mWorldspace ("std::default"), - mControlElements(NULL), mDisplayCellCoord(true), mOverlayMask(NULL) + mControlElements(NULL), mDisplayCellCoord(true) { QAbstractItemModel *cells = document.getData().getTableModel (CSMWorld::UniversalId::Type_Cells); @@ -371,11 +372,13 @@ CSVRender::PagedWorldspaceWidget::~PagedWorldspaceWidget() delete iter->second; } + /* if(mOverlayMask) { removeRenderTargetListener(mOverlayMask); delete mOverlayMask; } + */ } void CSVRender::PagedWorldspaceWidget::useViewHint (const std::string& hint) diff --git a/apps/opencs/view/render/pagedworldspacewidget.hpp b/apps/opencs/view/render/pagedworldspacewidget.hpp index 3db6ee4edb..22c6ed4786 100644 --- a/apps/opencs/view/render/pagedworldspacewidget.hpp +++ b/apps/opencs/view/render/pagedworldspacewidget.hpp @@ -29,7 +29,6 @@ namespace CSVRender CSVWidget::SceneToolToggle *mControlElements; bool mDisplayCellCoord; std::map mTextOverlays; - OverlayMask *mOverlayMask; private: diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index 55cf039fcd..3a660b5fd2 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -11,14 +11,12 @@ #include #include #include -#include #include "../widget/scenetoolmode.hpp" #include "../../model/settings/usersettings.hpp" #include "navigation.hpp" #include "lighting.hpp" -#include "overlaysystem.hpp" namespace CSVRender { @@ -61,9 +59,6 @@ namespace CSVRender setLighting (&mLightingDay); - mOverlaySystem = OverlaySystem::instance().get(); - mSceneMgr->addRenderQueueListener(mOverlaySystem); - QTimer *timer = new QTimer (this); connect (timer, SIGNAL (timeout()), this, SLOT (update())); @@ -165,9 +160,6 @@ namespace CSVRender if (mWindow) Ogre::Root::getSingleton().destroyRenderTarget (mWindow); - if (mSceneMgr) - mSceneMgr->removeRenderQueueListener (mOverlaySystem); - if (mSceneMgr) Ogre::Root::getSingleton().destroySceneManager (mSceneMgr); diff --git a/apps/opencs/view/render/scenewidget.hpp b/apps/opencs/view/render/scenewidget.hpp index 699d6a7a56..c570388696 100644 --- a/apps/opencs/view/render/scenewidget.hpp +++ b/apps/opencs/view/render/scenewidget.hpp @@ -15,7 +15,6 @@ namespace Ogre class SceneManager; class RenderWindow; class Viewport; - class OverlaySystem; class RenderTargetListener; } @@ -99,7 +98,6 @@ namespace CSVRender Ogre::SceneManager* mSceneMgr; Ogre::RenderWindow* mWindow; Ogre::Viewport *mViewport; - Ogre::OverlaySystem *mOverlaySystem; Navigation *mNavigation; Lighting *mLighting; diff --git a/apps/opencs/view/world/physicssystem.cpp b/apps/opencs/view/world/physicssystem.cpp index 2cbe17dcfa..4e23c185ae 100644 --- a/apps/opencs/view/world/physicssystem.cpp +++ b/apps/opencs/view/world/physicssystem.cpp @@ -16,8 +16,9 @@ namespace CSVWorld PhysicsSystem::PhysicsSystem() { // Create physics. shapeLoader is deleted by the physic engine - NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader(true); - mEngine = new OEngine::Physic::PhysicEngine(shapeLoader); + //NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader(true); + //mEngine = new OEngine::Physic::PhysicEngine(shapeLoader); + mEngine = 0; } PhysicsSystem::~PhysicsSystem() diff --git a/apps/opencs/view/world/subviews.cpp b/apps/opencs/view/world/subviews.cpp index c5d969d0df..d0b52a9ffc 100644 --- a/apps/opencs/view/world/subviews.cpp +++ b/apps/opencs/view/world/subviews.cpp @@ -170,4 +170,4 @@ void CSVWorld::addSubViewFactories (CSVDoc::SubViewFactoryManager& manager) //preview manager.add (CSMWorld::UniversalId::Type_Preview, new CSVDoc::SubViewFactory); -} \ No newline at end of file +} diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 475f9d01f1..311b980391 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -106,7 +106,8 @@ add_component_dir (translation translation ) -add_definitions(-DTERRAIN_USE_SHADER=1) +#add_definitions(-DTERRAIN_USE_SHADER=1) +add_definitions(-DTERRAIN_USE_SHADER=0) add_component_dir (terrain quadtreenode chunk world defaultworld terraingrid storage material buffercache defs ) diff --git a/libs/openengine/bullet/physic.cpp b/libs/openengine/bullet/physic.cpp index 1ef00a0e13..a0259a11fd 100644 --- a/libs/openengine/bullet/physic.cpp +++ b/libs/openengine/bullet/physic.cpp @@ -82,12 +82,14 @@ namespace Physic , mWalkingOnWater(false) , mCanWaterWalk(false) { + /* if (!NifBullet::getBoundingBox(mMesh, mHalfExtents, mMeshTranslation, mMeshOrientation)) { mHalfExtents = Ogre::Vector3(0.f); mMeshTranslation = Ogre::Vector3(0.f); mMeshOrientation = Ogre::Quaternion::IDENTITY; } + */ // Use capsule shape only if base is square (nonuniform scaling apparently doesn't work on it) if (std::abs(mHalfExtents.x-mHalfExtents.y)= mHalfExtents.x)