Avoid using settings in components to get actor model

Settings::Values are initialized only for engine. Accessing them from other
binaries leads to a crash.
macos_ci_fix
elsid 1 year ago
parent 5d21d2758f
commit 1d94527a19
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -20,7 +20,7 @@
#include <components/esm3/loadnpc.hpp>
#include <components/esm3/loadrace.hpp>
#include <components/esm3/mappings.hpp>
#include <components/sceneutil/actorutil.hpp>
#include <components/settings/settings.hpp>
#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

@ -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

@ -2,7 +2,7 @@
#include <components/settings/values.hpp>
namespace SceneUtil
namespace MWRender
{
const std::string& getActorSkeleton(bool firstPerson, bool isFemale, bool isBeast, bool isWerewolf)
{

@ -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 <string>
namespace SceneUtil
namespace MWRender
{
const std::string& getActorSkeleton(bool firstPerson, bool female, bool beast, bool werewolf);
}

@ -34,7 +34,6 @@
#include <components/vfs/manager.hpp>
#include <components/sceneutil/actorutil.hpp>
#include <components/sceneutil/lightmanager.hpp>
#include <components/sceneutil/lightutil.hpp>
#include <components/sceneutil/positionattitudetransform.hpp>
@ -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<ESM::Race>().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());
}
}
}

@ -18,7 +18,6 @@
#include <components/esm3/loadrace.hpp>
#include <components/resource/resourcesystem.hpp>
#include <components/resource/scenemanager.hpp>
#include <components/sceneutil/actorutil.hpp>
#include <components/sceneutil/depth.hpp>
#include <components/sceneutil/keyframe.hpp>
#include <components/sceneutil/lightcommon.hpp>
@ -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())

@ -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
)

Loading…
Cancel
Save