diff --git a/apps/launcher/CMakeLists.txt b/apps/launcher/CMakeLists.txt index 76b6e46bd9..bc1975ac9d 100644 --- a/apps/launcher/CMakeLists.txt +++ b/apps/launcher/CMakeLists.txt @@ -89,7 +89,6 @@ add_executable(openmw-launcher target_link_libraries(openmw-launcher ${Boost_LIBRARIES} - ${OGRE_LIBRARIES} ${SDL2_LIBRARY_ONLY} ${QT_LIBRARIES} components diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 00e6a9aa29..edbe48077a 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -199,7 +199,7 @@ bool Launcher::MainDialog::setup() // Now create the pages as they need the settings createPages(); - // Call this so we can exit on Ogre/SDL errors before mainwindow is shown + // Call this so we can exit on SDL errors before mainwindow is shown if (!mGraphicsPage->loadSettings()) return false; diff --git a/apps/openmw/mwmechanics/aicombat.cpp b/apps/openmw/mwmechanics/aicombat.cpp index 84cf6f5192..ac5d1691cd 100644 --- a/apps/openmw/mwmechanics/aicombat.cpp +++ b/apps/openmw/mwmechanics/aicombat.cpp @@ -16,13 +16,13 @@ #include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/dialoguemanager.hpp" -//#include "../mwrender/animation.hpp" +#include "../mwrender/animation.hpp" #include "creaturestats.hpp" #include "steering.hpp" #include "movement.hpp" -//#include "character.hpp" // fixme: for getActiveWeapon +#include "character.hpp" // fixme: for getActiveWeapon #include "aicombataction.hpp" #include "combat.hpp" @@ -188,7 +188,6 @@ namespace MWMechanics */ bool AiCombat::execute (const MWWorld::Ptr& actor, AiState& state, float duration) { -#if 0 // get or create temporary storage AiCombatStorage& storage = state.get(); @@ -257,9 +256,11 @@ namespace MWMechanics if(readyToAttack) { + if (!minMaxAttackDurationInitialised) { // TODO: this must be updated when a different weapon is equipped + // FIXME: attack durations would be easier to control if we interact more closely with the CharacterController getMinMaxAttackDuration(actor, minMaxAttackDuration); minMaxAttackDurationInitialised = true; } @@ -674,7 +675,6 @@ namespace MWMechanics // FIXME: can fool actors to stay behind doors, etc. // Related to Bug#1102 and to some degree #1155 as well } -#endif return false; } @@ -812,7 +812,6 @@ ESM::Weapon::AttackType chooseBestAttack(const ESM::Weapon* weapon, MWMechanics: return attackType; } -#if 0 void getMinMaxAttackDuration(const MWWorld::Ptr& actor, float (*fMinMaxDurations)[2]) { if (!actor.getClass().hasInventoryStore(actor)) // creatures @@ -876,7 +875,6 @@ void getMinMaxAttackDuration(const MWWorld::Ptr& actor, float (*fMinMaxDurations fMinMaxDurations[i][1] = fMinMaxDurations[i][0] + (start1 - start2) / weapSpeed; } } -#endif Ogre::Vector3 AimDirToMovingTarget(const MWWorld::Ptr& actor, const MWWorld::Ptr& target, const Ogre::Vector3& vLastTargetPos, float duration, int weapType, float strength) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 1f749ab4e1..888846789b 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -34,6 +34,8 @@ #include "../mwworld/esmstore.hpp" #include "../mwworld/class.hpp" +#include "../mwmechanics/character.hpp" // FIXME: for MWMechanics::Priority + #include "vismask.hpp" #include "util.hpp" @@ -1068,6 +1070,18 @@ namespace MWRender } } + bool Animation::upperBodyReady() const + { + for (AnimStateMap::const_iterator stateiter = mStates.begin(); stateiter != mStates.end(); ++stateiter) + { + if((stateiter->second.mPriority > MWMechanics::Priority_Movement + && stateiter->second.mPriority < MWMechanics::Priority_Torch) + || stateiter->second.mPriority == MWMechanics::Priority_Death) + return false; + } + return true; + } + bool Animation::hasNode(const std::string &name) { std::string lowerName = Misc::StringUtils::lowerCase(name); diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index c85f874038..81f0447075 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -309,7 +309,7 @@ public: bool isPlaying(const std::string &groupname) const; /// Returns true if no important animations are currently playing on the upper body. - //bool upperBodyReady() const; + bool upperBodyReady() const; /** Gets info about the given animation group. * \param groupname Animation group to check. diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index c1e31453fd..6ea38a8fbe 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -148,7 +149,7 @@ namespace MWWorld const std::vector& contentFiles, ToUTF8::Utf8Encoder* encoder, const std::map& fallbackMap, int activationDistanceOverride, const std::string& startCell, const std::string& startupScript) - : mPlayer (0), mLocalScripts (mStore), + : mResourceSystem(resourceSystem), mPlayer (0), mLocalScripts (mStore), mSky (true), mCells (mStore, mEsm), mActivationDistanceOverride (activationDistanceOverride), mFallback(fallbackMap), mTeleportEnabled(true), mLevitationEnabled(true), @@ -1170,7 +1171,7 @@ namespace MWWorld MWWorld::Ptr newPtr = ptr.getClass() .copyToCell(ptr, *newCell); - newPtr.getRefData().setBaseNodeOld(0); + newPtr.getRefData().setBaseNode(0); } else if (!currCellActive && !newCellActive) ptr.getClass().copyToCell(ptr, *newCell); @@ -1180,8 +1181,9 @@ namespace MWWorld ptr.getClass().copyToCell(ptr, *newCell, pos); //mRendering->updateObjectCell(ptr, copy); - ptr.getRefData().setBaseNodeOld(NULL); + ptr.getRefData().setBaseNode(NULL); MWBase::Environment::get().getSoundManager()->updatePtr (ptr, copy); + mPhysics->updatePtr(ptr, copy); MWBase::MechanicsManager *mechMgr = MWBase::Environment::get().getMechanicsManager(); mechMgr->updateCell(ptr, copy); @@ -2123,8 +2125,8 @@ namespace MWWorld MWBase::Environment::get().getMechanicsManager()->add(getPlayerPtr()); std::string model = getPlayerPtr().getClass().getModel(getPlayerPtr()); - //model = Misc::ResourceHelpers::correctActorModelPath(model); - //mPhysics->addActor(mPlayer->getPlayer(), model); + model = Misc::ResourceHelpers::correctActorModelPath(model, mResourceSystem->getVFS()); + mPhysics->addActor(getPlayerPtr(), model); } int World::canRest () diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 97515b7d08..279d35329b 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -70,6 +70,8 @@ namespace MWWorld class World : public MWBase::World { + Resource::ResourceSystem* mResourceSystem; + MWWorld::Fallback mFallback; MWRender::RenderingManager* mRendering;