diff --git a/apps/opencs/model/world/actoradapter.cpp b/apps/opencs/model/world/actoradapter.cpp index 3a54bb3b0e..e68d3e833f 100644 --- a/apps/opencs/model/world/actoradapter.cpp +++ b/apps/opencs/model/world/actoradapter.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "data.hpp" @@ -129,11 +129,14 @@ namespace CSMWorld if (mCreature || !mSkeletonOverride.empty()) return "meshes\\" + mSkeletonOverride; - bool firstPerson = false; bool beast = mRaceData ? mRaceData->isBeast() : false; - bool werewolf = false; - return SceneUtil::getActorSkeleton(firstPerson, mFemale, beast, werewolf); + if (beast) + return Settings::Manager::getString("baseanimkna", "Models"); + else if (mFemale) + return Settings::Manager::getString("baseanimfemale", "Models"); + else + return Settings::Manager::getString("baseanim", "Models"); } ESM::RefId ActorAdapter::ActorData::getPart(ESM::PartReferenceType index) const diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 96d54949b1..535d854239 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -24,6 +24,7 @@ add_openmw_dir (mwrender bulletdebugdraw globalmap characterpreview camera localmap water terrainstorage ripplesimulation renderbin actoranimation landmanager navmesh actorspaths recastmesh fogmanager objectpaging groundcover postprocessor pingpongcull luminancecalculator pingpongcanvas transparentpass navmeshmode precipitationocclusion ripples + actorutil ) add_openmw_dir (mwinput diff --git a/components/sceneutil/actorutil.cpp b/apps/openmw/mwrender/actorutil.cpp similarity index 97% rename from components/sceneutil/actorutil.cpp rename to apps/openmw/mwrender/actorutil.cpp index 63d3beccb7..6cef42d60f 100644 --- a/components/sceneutil/actorutil.cpp +++ b/apps/openmw/mwrender/actorutil.cpp @@ -2,7 +2,7 @@ #include -namespace SceneUtil +namespace MWRender { const std::string& getActorSkeleton(bool firstPerson, bool isFemale, bool isBeast, bool isWerewolf) { diff --git a/components/sceneutil/actorutil.hpp b/apps/openmw/mwrender/actorutil.hpp similarity index 52% rename from components/sceneutil/actorutil.hpp rename to apps/openmw/mwrender/actorutil.hpp index 038fc4e15e..bbffc4ad24 100644 --- a/components/sceneutil/actorutil.hpp +++ b/apps/openmw/mwrender/actorutil.hpp @@ -1,9 +1,9 @@ -#ifndef OPENMW_COMPONENTS_SCENEUTIL_ACTORUTIL_HPP -#define OPENMW_COMPONENTS_SCENEUTIL_ACTORUTIL_HPP +#ifndef OPENMW_APPS_OPENMW_MWRENDER_ACTORUTIL_H +#define OPENMW_APPS_OPENMW_MWRENDER_ACTORUTIL_H #include -namespace SceneUtil +namespace MWRender { const std::string& getActorSkeleton(bool firstPerson, bool female, bool beast, bool werewolf); } diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index aaf2c9390b..b49f382f66 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -34,7 +34,6 @@ #include -#include #include #include #include @@ -54,6 +53,7 @@ #include "../mwmechanics/character.hpp" // FIXME: for MWMechanics::Priority +#include "actorutil.hpp" #include "rotatecontroller.hpp" #include "util.hpp" #include "vismask.hpp" @@ -1411,12 +1411,13 @@ namespace MWRender const MWWorld::ESMStore& store = *MWBase::Environment::get().getESMStore(); const ESM::Race* race = store.get().find(ref->mBase->mRace); - bool isBeast = (race->mData.mFlags & ESM::Race::Beast) != 0; - bool isFemale = !ref->mBase->isMale(); + const bool firstPerson = false; + const bool isBeast = (race->mData.mFlags & ESM::Race::Beast) != 0; + const bool isFemale = !ref->mBase->isMale(); + const bool werewolf = false; - defaultSkeleton = SceneUtil::getActorSkeleton(false, isFemale, isBeast, false); - defaultSkeleton - = Misc::ResourceHelpers::correctActorModelPath(defaultSkeleton, mResourceSystem->getVFS()); + defaultSkeleton = Misc::ResourceHelpers::correctActorModelPath( + getActorSkeleton(firstPerson, isFemale, isBeast, werewolf), mResourceSystem->getVFS()); } } } diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 00f16e4ddc..cb7ef3626f 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -40,6 +39,7 @@ #include "../mwbase/soundmanager.hpp" #include "../mwbase/world.hpp" +#include "actorutil.hpp" #include "postprocessor.hpp" #include "renderbin.hpp" #include "rotatecontroller.hpp" @@ -500,8 +500,8 @@ namespace MWRender bool is1stPerson = mViewMode == VM_FirstPerson; bool isBeast = (race->mData.mFlags & ESM::Race::Beast) != 0; - std::string defaultSkeleton = SceneUtil::getActorSkeleton(is1stPerson, isFemale, isBeast, isWerewolf); - defaultSkeleton = Misc::ResourceHelpers::correctActorModelPath(defaultSkeleton, mResourceSystem->getVFS()); + const std::string defaultSkeleton = Misc::ResourceHelpers::correctActorModelPath( + getActorSkeleton(is1stPerson, isFemale, isBeast, isWerewolf), mResourceSystem->getVFS()); std::string smodel = defaultSkeleton; if (!is1stPerson && !isWerewolf && !mNpc->mModel.empty()) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 6b78e471e6..5ad7562e96 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -106,7 +106,7 @@ add_component_dir (shader add_component_dir (sceneutil clone attach visitor util statesetupdater controller skeleton riggeometry morphgeometry lightcontroller lightmanager lightutil positionattitudetransform workqueue pathgridutil waterutil writescene serialize optimizer - actorutil detourdebugdraw navmesh agentpath shadow mwshadowtechnique recastmesh shadowsbin osgacontroller rtt + detourdebugdraw navmesh agentpath shadow mwshadowtechnique recastmesh shadowsbin osgacontroller rtt screencapture depth color riggeometryosgaextension extradata unrefqueue lightcommon )