mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 06:39:49 +00:00
8e38dc410f
Animation sources are treated differently from base objects. When given "path\file.nif", base objects will look for "path\xfile.nif" and use that if it exists (falling back to the original name if not found). Animation sources will instead use "path\xfile.kf", ignoring it if the file doesn't exist.
32 lines
648 B
C++
32 lines
648 B
C++
#include "activatoranimation.hpp"
|
|
|
|
#include "renderconst.hpp"
|
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
namespace MWRender
|
|
{
|
|
|
|
ActivatorAnimation::~ActivatorAnimation()
|
|
{
|
|
}
|
|
|
|
ActivatorAnimation::ActivatorAnimation(const MWWorld::Ptr &ptr)
|
|
: Animation(ptr)
|
|
{
|
|
MWWorld::LiveCellRef<ESM::Activator> *ref = mPtr.get<ESM::Activator>();
|
|
|
|
assert (ref->mBase != NULL);
|
|
if(!ref->mBase->mModel.empty())
|
|
{
|
|
const std::string name = "meshes\\"+ref->mBase->mModel;
|
|
|
|
setObjectRoot(mPtr.getRefData().getBaseNode(), name, false);
|
|
setRenderProperties(mObjectRoot, RV_Misc, RQG_Main, RQG_Alpha);
|
|
|
|
addAnimSource(name);
|
|
}
|
|
}
|
|
|
|
}
|