From f5868f7ae138cafda38e65d3708a0892c89f22e9 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 20 Sep 2014 13:07:38 +0200 Subject: [PATCH 01/10] Fix layout problems in generate class result dialog --- apps/openmw/mwgui/class.cpp | 7 ++++--- .../openmw_chargen_generate_class_result.layout | 13 +++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwgui/class.cpp b/apps/openmw/mwgui/class.cpp index 9f6306830..b661f9945 100644 --- a/apps/openmw/mwgui/class.cpp +++ b/apps/openmw/mwgui/class.cpp @@ -17,9 +17,6 @@ namespace MWGui GenerateClassResultDialog::GenerateClassResultDialog() : WindowModal("openmw_chargen_generate_class_result.layout") { - // Centre dialog - center(); - setText("ReflectT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sMessageQuestionAnswer1", "")); getWidget(mClassImage, "ClassImage"); @@ -34,6 +31,8 @@ namespace MWGui getWidget(okButton, "OKButton"); okButton->setCaptionWithReplacing("#{sMessageQuestionAnswer2}"); okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked); + + center(); } std::string GenerateClassResultDialog::getClassId() const @@ -46,6 +45,8 @@ namespace MWGui mCurrentClassId = classId; mClassImage->setImageTexture(std::string("textures\\levelup\\") + mCurrentClassId + ".dds"); mClassName->setCaption(MWBase::Environment::get().getWorld()->getStore().get().find(mCurrentClassId)->mName); + + center(); } // widget controls diff --git a/files/mygui/openmw_chargen_generate_class_result.layout b/files/mygui/openmw_chargen_generate_class_result.layout index f7178042f..edbbaeb57 100644 --- a/files/mygui/openmw_chargen_generate_class_result.layout +++ b/files/mygui/openmw_chargen_generate_class_result.layout @@ -1,29 +1,30 @@ - + + + + + - + - + - - - From dec9ffdb6c247345dc3f36df1de3e92b83305891 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 20 Sep 2014 13:32:32 +0200 Subject: [PATCH 02/10] ESM: Make sure to clear old list when a list is overwritten by another content file (Fixes #1932) --- components/esm/aipackage.cpp | 1 + components/esm/effectlist.cpp | 1 + components/esm/loadarmo.cpp | 1 + components/esm/loadcont.cpp | 1 + components/esm/loadnpc.cpp | 1 + components/esm/loadpgrd.cpp | 3 +++ components/esm/loadregn.cpp | 1 + components/esm/loadscpt.cpp | 2 ++ components/esm/spelllist.cpp | 1 + 9 files changed, 12 insertions(+) diff --git a/components/esm/aipackage.cpp b/components/esm/aipackage.cpp index cf4951de7..209a1fe26 100644 --- a/components/esm/aipackage.cpp +++ b/components/esm/aipackage.cpp @@ -13,6 +13,7 @@ namespace ESM void AIPackageList::load(ESMReader &esm) { + mList.clear(); while (esm.hasMoreSubs()) { // initialize every iteration AIPackage pack; diff --git a/components/esm/effectlist.cpp b/components/esm/effectlist.cpp index bc126846b..fc9acccf2 100644 --- a/components/esm/effectlist.cpp +++ b/components/esm/effectlist.cpp @@ -7,6 +7,7 @@ namespace ESM { void EffectList::load(ESMReader &esm) { + mList.clear(); ENAMstruct s; while (esm.isNextSub("ENAM")) { esm.getHT(s, 24); diff --git a/components/esm/loadarmo.cpp b/components/esm/loadarmo.cpp index 5bf38c840..f8c3a4718 100644 --- a/components/esm/loadarmo.cpp +++ b/components/esm/loadarmo.cpp @@ -9,6 +9,7 @@ namespace ESM void PartReferenceList::load(ESMReader &esm) { + mParts.clear(); while (esm.isNextSub("INDX")) { PartReference pr; diff --git a/components/esm/loadcont.cpp b/components/esm/loadcont.cpp index 7bdf9f05b..51a385f06 100644 --- a/components/esm/loadcont.cpp +++ b/components/esm/loadcont.cpp @@ -9,6 +9,7 @@ namespace ESM void InventoryList::load(ESMReader &esm) { + mList.clear(); ContItem ci; while (esm.isNextSub("NPCO")) { diff --git a/components/esm/loadnpc.cpp b/components/esm/loadnpc.cpp index 2fe9fe3c1..ef4b5211b 100644 --- a/components/esm/loadnpc.cpp +++ b/components/esm/loadnpc.cpp @@ -51,6 +51,7 @@ void NPC::load(ESMReader &esm) else mHasAI = false; + mTransport.clear(); while (esm.isNextSub("DODT") || esm.isNextSub("DNAM")) { if (esm.retSubName() == 0x54444f44) { // DODT struct Dest dodt; diff --git a/components/esm/loadpgrd.cpp b/components/esm/loadpgrd.cpp index efdbdd86b..974e928d9 100644 --- a/components/esm/loadpgrd.cpp +++ b/components/esm/loadpgrd.cpp @@ -27,6 +27,9 @@ void Pathgrid::load(ESMReader &esm) esm.getHNT(mData, "DATA", 12); mCell = esm.getHNString("NAME"); + mPoints.clear(); + mEdges.clear(); + // keep track of total connections so we can reserve edge vector size int edgeCount = 0; diff --git a/components/esm/loadregn.cpp b/components/esm/loadregn.cpp index 0c3ccbffb..1b08b7217 100644 --- a/components/esm/loadregn.cpp +++ b/components/esm/loadregn.cpp @@ -39,6 +39,7 @@ void Region::load(ESMReader &esm) esm.getHNT(mMapColor, "CNAM"); + mSoundList.clear(); while (esm.hasMoreSubs()) { SoundRef sr; diff --git a/components/esm/loadscpt.cpp b/components/esm/loadscpt.cpp index 5a7d65775..19e3f3bb3 100644 --- a/components/esm/loadscpt.cpp +++ b/components/esm/loadscpt.cpp @@ -22,6 +22,8 @@ void Script::load(ESMReader &esm) mData = data.mData; mId = data.mName.toString(); + mVarNames.clear(); + // List of local variables if (esm.isNextSub("SCVR")) { diff --git a/components/esm/spelllist.cpp b/components/esm/spelllist.cpp index 24d3c3d0a..aeface617 100644 --- a/components/esm/spelllist.cpp +++ b/components/esm/spelllist.cpp @@ -7,6 +7,7 @@ namespace ESM { void SpellList::load(ESMReader &esm) { + mList.clear(); while (esm.isNextSub("NPCS")) { mList.push_back(esm.getHString()); } From d3554084add9b58dd73c883d28f5dfbbf6b04827 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 20 Sep 2014 13:50:23 +0200 Subject: [PATCH 03/10] Fix weird behaviour of options menu sliders when value was changed out of bounds via cfg file --- apps/openmw/mwgui/settingswindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index c3fbe88ab..7c530034d 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -136,6 +136,7 @@ namespace MWGui float min,max; getSettingMinMax(scroll, min, max); float value = Settings::Manager::getFloat(getSettingName(current), getSettingCategory(current)); + value = std::max(min, std::min(value, max)); value = (value-min)/(max-min); scroll->setScrollPosition( value * (scroll->getScrollRange()-1)); From 023d7072f921b34e68a8c2722ee4c30ff0cd2188 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 20 Sep 2014 13:55:57 +0200 Subject: [PATCH 04/10] Don't play battle music for enemies out of AI processing range --- apps/openmw/mwmechanics/actors.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 1ee498d84..36c71adeb 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1116,6 +1116,8 @@ namespace MWMechanics MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); + int hostilesCount = 0; // need to know this to play Battle music + // AI and magic effects update for(PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter) { @@ -1125,6 +1127,8 @@ namespace MWMechanics // AI processing is only done within distance of 7168 units to the player. Note the "AI distance" slider doesn't affect this // (it only does some throttling for targets beyond the "AI distance", so doesn't give any guarantees as to whether AI will be enabled or not) + // This distance could be made configurable later, but the setting must be marked with a big warning: + // using higher values will make a quest in Bloodmoon harder or impossible to complete (bug #1876) if (MWBase::Environment::get().getMechanicsManager()->isAIActive() && Ogre::Vector3(player.getRefData().getPosition().pos).squaredDistance(Ogre::Vector3(iter->first.getRefData().getPosition().pos)) <= 7168*7168) @@ -1147,6 +1151,12 @@ namespace MWMechanics if (iter->first != player) iter->first.getClass().getCreatureStats(iter->first).getAiSequence().execute(iter->first, duration); + + CreatureStats &stats = iter->first.getClass().getCreatureStats(iter->first); + if(!stats.isDead()) + { + if (stats.getAiSequence().isInCombat()) hostilesCount++; + } } if(iter->first.getTypeName() == typeid(ESM::NPC).name()) @@ -1192,19 +1202,6 @@ namespace MWMechanics } } - int hostilesCount = 0; // need to know this to play Battle music - - for(PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter) - { - const MWWorld::Class &cls = iter->first.getClass(); - CreatureStats &stats = cls.getCreatureStats(iter->first); - - if(!stats.isDead()) - { - if (stats.getAiSequence().isInCombat()) hostilesCount++; - } - } - killDeadActors(); // check if we still have any player enemies to switch music From 144c818b412dbe5b6e452d7ae5a27b137250683b Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 20 Sep 2014 16:12:52 +0200 Subject: [PATCH 05/10] Throw an exception if a required Ogre plugin is not found --- components/ogreinit/ogreinit.cpp | 3 ++- components/ogreinit/ogreplugin.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/ogreinit/ogreinit.cpp b/components/ogreinit/ogreinit.cpp index cd3723354..60306459a 100644 --- a/components/ogreinit/ogreinit.cpp +++ b/components/ogreinit/ogreinit.cpp @@ -216,7 +216,8 @@ namespace OgreInit Files::loadOgrePlugin(pluginDir, "RenderSystem_GL3Plus", *mRoot); Files::loadOgrePlugin(pluginDir, "RenderSystem_Direct3D9", *mRoot); Files::loadOgrePlugin(pluginDir, "Plugin_CgProgramManager", *mRoot); - Files::loadOgrePlugin(pluginDir, "Plugin_ParticleFX", *mRoot); + if (!Files::loadOgrePlugin(pluginDir, "Plugin_ParticleFX", *mRoot)) + throw std::runtime_error("Required Plugin_ParticleFX for Ogre not found!"); } void OgreInit::loadParticleFactories() diff --git a/components/ogreinit/ogreplugin.cpp b/components/ogreinit/ogreplugin.cpp index 6070c43a8..069b25e7b 100644 --- a/components/ogreinit/ogreplugin.cpp +++ b/components/ogreinit/ogreplugin.cpp @@ -42,4 +42,4 @@ bool loadOgrePlugin(const std::string &pluginDir, std::string pluginName, Ogre:: } } -} \ No newline at end of file +} From 3ac04060c1b2b0d5b3a1644d2fd29ea7d22a775c Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 20 Sep 2014 16:17:09 +0200 Subject: [PATCH 06/10] Fix NPCs being able to practice Block skill --- apps/openmw/mwmechanics/combat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index d3cb678be..657cbf92e 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -133,7 +133,7 @@ namespace MWMechanics blockerStats.setBlock(true); - if (blocker.getClass().isNpc()) + if (blocker.getCellRef().getRefId() == "player") blocker.getClass().skillUsageSucceeded(blocker, ESM::Skill::Block, 0); return true; From 4d6ebfb496e1b0fa7f8369684cf9ec4f34703892 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 20 Sep 2014 17:13:51 +0200 Subject: [PATCH 07/10] Allow KeyFrameControllers on the RootCollisionNode and its children (Bug #1934) --- components/nifogre/ogrenifloader.cpp | 31 +++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/components/nifogre/ogrenifloader.cpp b/components/nifogre/ogrenifloader.cpp index 504c24c2a..57d3cbe17 100644 --- a/components/nifogre/ogrenifloader.cpp +++ b/components/nifogre/ogrenifloader.cpp @@ -1063,11 +1063,11 @@ class NIFObjectLoader static void createObjects(const Nif::NIFFilePtr& nif, const std::string &name, const std::string &group, Ogre::SceneNode *sceneNode, const Nif::Node *node, - ObjectScenePtr scene, int flags, int animflags, int partflags) + ObjectScenePtr scene, int flags, int animflags, int partflags, bool isRootCollisionNode=false) { // Do not create objects for the collision shape (includes all children) if(node->recType == Nif::RC_RootCollisionNode) - return; + isRootCollisionNode = true; // Marker objects: just skip the entire node branch /// \todo don't do this in the editor @@ -1120,20 +1120,23 @@ class NIFObjectLoader if(!node->controller.empty()) createNodeControllers(nif, name, node->controller, scene, animflags); - if(node->recType == Nif::RC_NiCamera) + if (!isRootCollisionNode) { - /* Ignored */ - } + if(node->recType == Nif::RC_NiCamera) + { + /* Ignored */ + } - if(node->recType == Nif::RC_NiTriShape && !(flags&0x80000000)) - { - createEntity(name, group, sceneNode->getCreator(), scene, node, flags, animflags); - } + if(node->recType == Nif::RC_NiTriShape && !(flags&0x80000000)) + { + createEntity(name, group, sceneNode->getCreator(), scene, node, flags, animflags); + } - if((node->recType == Nif::RC_NiAutoNormalParticles || - node->recType == Nif::RC_NiRotatingParticles) && !(flags&0x40000000)) - { - createParticleSystem(name, group, sceneNode, scene, node, flags, partflags, animflags); + if((node->recType == Nif::RC_NiAutoNormalParticles || + node->recType == Nif::RC_NiRotatingParticles) && !(flags&0x40000000)) + { + createParticleSystem(name, group, sceneNode, scene, node, flags, partflags, animflags); + } } const Nif::NiNode *ninode = dynamic_cast(node); @@ -1143,7 +1146,7 @@ class NIFObjectLoader for(size_t i = 0;i < children.length();i++) { if(!children[i].empty()) - createObjects(nif, name, group, sceneNode, children[i].getPtr(), scene, flags, animflags, partflags); + createObjects(nif, name, group, sceneNode, children[i].getPtr(), scene, flags, animflags, partflags, isRootCollisionNode); } } } From ef43196ef24c0a0bf9f55d3b73271b664ab19a03 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 20 Sep 2014 18:34:01 +0200 Subject: [PATCH 08/10] Add spacing to savegame dialog --- files/mygui/openmw_savegame_dialog.layout | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/files/mygui/openmw_savegame_dialog.layout b/files/mygui/openmw_savegame_dialog.layout index 701533636..a2b2bcca7 100644 --- a/files/mygui/openmw_savegame_dialog.layout +++ b/files/mygui/openmw_savegame_dialog.layout @@ -2,18 +2,19 @@ - - + + - - - + + + + @@ -31,9 +32,9 @@ - + - + @@ -52,6 +53,8 @@ + + From b1e74e2a85d195d23336dee24077ea00d290f5c5 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 21 Sep 2014 10:38:44 +0200 Subject: [PATCH 09/10] Remove support for Ogre 1.8 versions --- CMakeLists.txt | 3 ++ apps/openmw/mwgui/loadingscreen.cpp | 6 --- apps/openmw/mwgui/settingswindow.cpp | 9 ---- apps/openmw/mwrender/renderingmanager.cpp | 13 ------ libs/openengine/bullet/BulletShapeLoader.cpp | 2 - libs/openengine/bullet/BulletShapeLoader.h | 48 -------------------- 6 files changed, 3 insertions(+), 78 deletions(-) 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); From fb26c2c2ded454972c550fb4984c9d99543a09a0 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 21 Sep 2014 11:38:55 +0200 Subject: [PATCH 10/10] Fix autocalculated NPCs not having health/magicka/fatigue set correctly (Fixes #1943) --- apps/openmw/mwclass/npc.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 6a7630d39..80b6088f2 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -335,6 +335,8 @@ namespace MWClass data->mNpcStats.setLevel(ref->mBase->mNpdt52.mLevel); data->mNpcStats.setBaseDisposition(ref->mBase->mNpdt52.mDisposition); data->mNpcStats.setReputation(ref->mBase->mNpdt52.mReputation); + + data->mNpcStats.setNeedRecalcDynamicStats(false); } else { @@ -349,6 +351,8 @@ namespace MWClass autoCalculateAttributes(ref->mBase, data->mNpcStats); autoCalculateSkills(ref->mBase, data->mNpcStats, ptr); + + data->mNpcStats.setNeedRecalcDynamicStats(true); } // race powers @@ -388,8 +392,6 @@ namespace MWClass data->mNpcStats.setGoldPool(gold); - data->mNpcStats.setNeedRecalcDynamicStats(false); - // store ptr.getRefData().setCustomData (data.release());