diff --git a/CMakeLists.txt b/CMakeLists.txt index f2ecf0fb2..885589ba4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,6 +221,9 @@ IF(BOOST_STATIC) endif() find_package(OGRE REQUIRED) +if (${OGRE_VERSION} VERSION_LESS "1.9") + message(FATAL_ERROR "OpenMW requires Ogre 1.9 or later, please install the latest stable version from http://ogre3d.org") +endif() find_package(MyGUI REQUIRED) if (${MYGUI_VERSION} VERSION_LESS "3.2.1") diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp index 034163469..a446266d9 100644 --- a/apps/openmw/mwgui/loadingscreen.cpp +++ b/apps/openmw/mwgui/loadingscreen.cpp @@ -66,11 +66,8 @@ namespace MWGui // Temporarily turn off VSync, we want to do actual loading rather than waiting for the screen to sync. // Threaded loading would be even better, of course - especially because some drivers force VSync to on and we can't change it. - // In Ogre 1.8, the swapBuffers argument is useless and setVSyncEnabled is bugged with GLX, nothing we can do :/ mVSyncWasEnabled = mWindow->isVSyncEnabled(); - #if OGRE_VERSION >= (1 << 16 | 9 << 8 | 0) mWindow->setVSyncEnabled(false); - #endif bool showWallpaper = (MWBase::Environment::get().getStateManager()->getState() == MWBase::StateManager::State_NoGame); @@ -113,10 +110,7 @@ namespace MWGui void LoadingScreen::loadingOff() { // Re-enable vsync now. - // In Ogre 1.8, the swapBuffers argument is useless and setVSyncEnabled is bugged with GLX, nothing we can do :/ - #if OGRE_VERSION >= (1 << 16 | 9 << 8 | 0) mWindow->setVSyncEnabled(mVSyncWasEnabled); - #endif setVisible(false); diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index 7c530034d..71cf7fdb3 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -294,15 +294,6 @@ namespace MWGui newState = true; } - if (_sender == mVSyncButton) - { - // Ogre::Window::setVSyncEnabled is bugged in 1.8 -#if OGRE_VERSION < (1 << 16 | 9 << 8 | 0) - MWBase::Environment::get().getWindowManager()-> - messageBox("VSync will be applied after a restart", std::vector()); -#endif - } - if (_sender == mShadersButton) { if (newState == false) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index abbc2b879..ef5418159 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -113,13 +113,7 @@ RenderingManager::RenderingManager(OEngine::Render::OgreRenderer& _rend, const b mFactory->loadAllFiles(); - // Compressed textures with 0 mip maps are bugged in 1.8, so disable mipmap generator in that case - // ( https://ogre3d.atlassian.net/browse/OGRE-259 ) -#if OGRE_VERSION >= (1 << 16 | 9 << 8 | 0) TextureManager::getSingleton().setDefaultNumMipmaps(Settings::Manager::getInt("num mipmaps", "General")); -#else - TextureManager::getSingleton().setDefaultNumMipmaps(0); -#endif // Set default texture filtering options TextureFilterOptions tfo; @@ -772,13 +766,6 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec || it->second == "resolution y" || it->second == "fullscreen")) changeRes = true; - else if (it->first == "Video" && it->second == "vsync") - { - // setVSyncEnabled is bugged in 1.8 -#if OGRE_VERSION >= (1 << 16 | 9 << 8 | 0) - mRendering.getWindow()->setVSyncEnabled(Settings::Manager::getBool("vsync", "Video")); -#endif - } else if (it->second == "field of view" && it->first == "General") mRendering.setFov(Settings::Manager::getFloat("field of view", "General")); else if ((it->second == "texture filtering" && it->first == "General") diff --git a/libs/openengine/bullet/BulletShapeLoader.cpp b/libs/openengine/bullet/BulletShapeLoader.cpp index bcb2ba6b2..5e3eeec96 100644 --- a/libs/openengine/bullet/BulletShapeLoader.cpp +++ b/libs/openengine/bullet/BulletShapeLoader.cpp @@ -105,7 +105,6 @@ BulletShapeManager::~BulletShapeManager() sThis = 0; } -#if (OGRE_VERSION >= ((1 << 16) | (9 << 8) | 0)) BulletShapePtr BulletShapeManager::getByName(const Ogre::String& name, const Ogre::String& groupName) { return getResourceByName(name, groupName).staticCast(); @@ -117,7 +116,6 @@ BulletShapePtr BulletShapeManager::create (const Ogre::String& name, const Ogre: { return createResource(name,group,isManual,loader,createParams).staticCast(); } -#endif BulletShapePtr BulletShapeManager::load(const Ogre::String &name, const Ogre::String &group) { diff --git a/libs/openengine/bullet/BulletShapeLoader.h b/libs/openengine/bullet/BulletShapeLoader.h index 612481c29..a95640cf1 100644 --- a/libs/openengine/bullet/BulletShapeLoader.h +++ b/libs/openengine/bullet/BulletShapeLoader.h @@ -55,53 +55,7 @@ public: * */ -#if (OGRE_VERSION < ((1 << 16) | (9 << 8) | 0)) -class BulletShapePtr : public Ogre::SharedPtr -{ -public: - BulletShapePtr() : Ogre::SharedPtr() {} - explicit BulletShapePtr(BulletShape *rep) : Ogre::SharedPtr(rep) {} - BulletShapePtr(const BulletShapePtr &r) : Ogre::SharedPtr(r) {} - BulletShapePtr(const Ogre::ResourcePtr &r) : Ogre::SharedPtr() - { - if( r.isNull() ) - return; - // lock & copy other mutex pointer - OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME) - OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME) - pRep = static_cast(r.getPointer()); - pUseCount = r.useCountPointer(); - useFreeMethod = r.freeMethod(); - if (pUseCount) - { - ++(*pUseCount); - } - } - - /// Operator used to convert a ResourcePtr to a BulletShapePtr - BulletShapePtr& operator=(const Ogre::ResourcePtr& r) - { - if(pRep == static_cast(r.getPointer())) - return *this; - release(); - if( r.isNull() ) - return *this; // resource ptr is null, so the call to release above has done all we need to do. - // lock & copy other mutex pointer - OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME) - OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME) - pRep = static_cast(r.getPointer()); - pUseCount = r.useCountPointer(); - useFreeMethod = r.freeMethod(); - if (pUseCount) - { - ++(*pUseCount); - } - return *this; - } -}; -#else typedef Ogre::SharedPtr BulletShapePtr; -#endif /** *Hold any BulletShape that was created by the ManualBulletShapeLoader. @@ -146,7 +100,6 @@ public: virtual ~BulletShapeManager(); -#if (OGRE_VERSION >= ((1 << 16) | (9 << 8) | 0)) /// Get a resource by name /// @see ResourceManager::getByName BulletShapePtr getByName(const Ogre::String& name, const Ogre::String& groupName = Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME); @@ -156,7 +109,6 @@ public: BulletShapePtr create (const Ogre::String& name, const Ogre::String& group, bool isManual = false, Ogre::ManualResourceLoader* loader = 0, const Ogre::NameValuePairList* createParams = 0); -#endif virtual BulletShapePtr load(const Ogre::String &name, const Ogre::String &group);