1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-05 15:55:45 +00:00
OpenMW/apps/openmw/mwrender/activatoranimation.cpp
2014-02-23 20:11:05 +01:00

34 lines
686 B
C++

#include "activatoranimation.hpp"
#include <components/esm/loadacti.hpp>
#include "../mwbase/world.hpp"
#include "renderconst.hpp"
namespace MWRender
{
ActivatorAnimation::~ActivatorAnimation()
{
}
ActivatorAnimation::ActivatorAnimation(const MWWorld::Ptr &ptr)
: Animation(ptr, ptr.getRefData().getBaseNode())
{
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(name, false);
setRenderProperties(mObjectRoot, RV_Misc, RQG_Main, RQG_Alpha);
addAnimSource(name);
}
}
}